You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by J Kary <jk...@yahoo.com> on 2000/09/23 21:01:28 UTC

Newbie Question

I have a silly question:

Our source tree is a bit messy.  We've devided the major functionality
into separate packages, however the core functionality is at the top of
the subpackages.  (IE.

app/corefile1.java
app/corefile2.java
app/pkg1/file1.java
app/pkg1/file2.java


How do I tell ANT to just build the core files?  Does ANT take care of
depends like:

corefile1.java depends on pkg1/file1.java  AND
pkg1/file1.java depends on corefile1.java

In the above case you need to do a 'javac corefile1.java
pkg1/file1.java
'

Take Care
Jason Kary



__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

RE: Newbie Question

Posted by Conor MacNeill <co...@m64.com>.
Jason,


> -----Original Message-----
> From: J Kary [mailto:jkary_98@yahoo.com]
> Sent: Sunday, 24 September 2000 6:01
> To: ANT MAILING LIST
> Subject: Newbie Question
>
>
> app/corefile1.java
> app/corefile2.java
> app/pkg1/file1.java
> app/pkg1/file2.java
>
>
> How do I tell ANT to just build the core files?  Does ANT take care of
> depends like:

Add an include element to the javac task like this
     <javac srcdir="app" destdir="build">
       <include name="*.java"/>
     </javac>

This will only include those files in the unnamed package.

>
> corefile1.java depends on pkg1/file1.java  AND
> pkg1/file1.java depends on corefile1.java
>
> In the above case you need to do a 'javac corefile1.java
> pkg1/file1.java
> '

ant won't take care of it but the underlying compiler used by ant should. By
that I mean the compiler will find pkg1/file.java when compiling
corefile1.java and compile it if necessary. It will not, however,
necessarily recompile corefile1.java if pkg1/file.java is updated.

I should also add that the Java language spec does not encourage the use of
the unamed package.

"Unnamed packages are provided by the Java platform principally for
convenience when developing small or temporary applications or when just
beginning development. "

Good Luck
Conor