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
structure.
A <javac> task can be very simple. For example, this <javac> task:
<javac destdir="${build.dev.class.dir}"
debug="true"
deprecation="true">
<src path="${src.code.src.dir}" />
<src path="${src.code.test.dir}" />
</javac>
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.
>>> [EMAIL PROTECTED] 02/28/02 12:57PM >>>
Diane,
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
expect
java file to be in the 'srcdir' rather than a txt file - Or does it
know
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}"
</target>
As for the below - How would this work - Again - javac would expect
java
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" />
</target>
-----Original Message-----
From: Diane Holt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 1:10 PM
To: Ant Users List
Subject: RE: ANT Capability
--- "Atluri, Vamsi NYC" <[EMAIL PROTECTED]> wrote:
> I am having a bit of trouble understanding how to put the code
together
> 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
it
> 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
just
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.
The
filenames should start with the next directory down from your
'srcdir'.
For example:
com/atluri/io/Input.java
com/atluri/tools/parser/*.java
com/atluri/utils/**/*.java
> 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.)
Diane
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>