ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey Jensen" <>
Subject RE: ANT Capability
Date Thu, 28 Feb 2002 19:44:48 GMT
Is there a reason for supplying a manually-maintained file containing a
list of files to compile?  

If not, perhaps there is a misunderstanding of one of the powers of
Ant.  That file is not required for Ant to compile the files.  Ant
automatically works on sets of files in a file set or directory

A <javac> task can be very simple.  For example, this <javac> task:

    <javac destdir="${}"
      <src path="${src.code.src.dir}" />
      <src path="${src.code.test.dir}" />

compiles all code in the directory (and subdirectories) specified by
each <src>.

Unless I misinterpret your emails, that is the feature you are looking
for, but just don't know it is built in.  

May I suggest reviewing the Ant docs more, particularly the <javac>
task and the examples in the "Using Ant" topic.

If I misunderstand, apologies in advance, and I suggest to get
something compiling first and then work on excluding any files from
compiling if necessary.

>>> 02/28/02 12:57PM >>>

So - All i have to is

Define a property for bean.txt 

<property name="JList" value="${cfnDir}\bean.txt" />

I guess it my lack of unserstanding of how javac works - Doesnt it
java file to be in the 'srcdir' rather than a txt file - Or does it
that it should read from the txt

Currently i specify javac
srcdir=\cfn\sicav\citco\java\com\citco\cfn\sicav\bean - 

Is this what i would do ?
     <target name="compile" depends="init">
             <!-- Compile the java code from ${src} into ${build} -->
             <javac srcdir="${JList}" destdir="${buildCfn}" 

As for the below - How would this work - Again - javac would expect
files. Correct ?

     <target name="compile" depends="init">
             <!-- Compile the java code from ${src} into ${build} -->
             <javac srcdir="${srcDir}" destdir="${buildCfn}" 
		  includesfile name="d:\scripts\cfn\bean.txt" /> 

-----Original Message-----
From: Diane Holt [] 
Sent: Thursday, February 28, 2002 1:10 PM
To: Ant Users List
Subject: RE: ANT Capability

--- "Atluri, Vamsi                NYC" <> wrote:
> I am having a bit of trouble understanding how to put the code
> for javac to read in
> I have not tried the below yet - Obviously it wont work - But i dont
> understand how to parse the file into - or how to let javac know that
> should compile from the bean.txt
>     <target name="compile" depends="init">
>             <!-- Compile the java code from ${src} into ${build} -->
>             <javac srcdir="${cfnCoreDB}" destdir="${buildCfn}" 
>             <patternset>
>       		<includesfile name="d:\scripts\cfn\bean.txt" />

>       	    <patternset/>
>     </target>

Get rid of the <patternset> -- <includesfile> nests under <javac> (or
use the simple 'includesfile' attribute).

> Also - What should my bean.txt look like - At the moment i have each
> java file listed on every line

You can do that, or you can use wildcards, or a combination of both.
filenames should start with the next directory down from your
For example:

> Even this example - Looks closer to what i want but - when you tell
> javac src path - Would it compile everything in src and src2 then 
>     <javac destdir="${buildcfn}"
>                  debug="on">
>         <src path="${src}"/>
>         <src path="${src2}"/>
>         <includesfile name="d:\scripts\cfn\bean.txt"/>
>   </javac>

No -- it'll compile (when necessary) all the files specified in the
bean.txt file, looking for them relative to ${src} or ${src2} (if not
found in ${src}).

(Just as a side note: You might want to reconsider that hard-coded
full-path for the includes file -- better to define the directory in a
property, along with the other directory properties you're defining.)



Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion! 

To unsubscribe, e-mail:  
For additional commands, e-mail:

To unsubscribe, e-mail:  
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message