Ant's not figuring out the order of compilation

R

Roshan Pai

Hi,

I am using Ant1.5 for my application build.

I am facing a peculiar problem.

I have a target timework.

<target depends="init" name="timework">
<javac debug="${debugInfo}" deprecation="false"
destdir="${ANT_BINARIES_DIR}" srcdir="../src">
<classpath refid="ecp.class.path"/>
<include name="com/cbb/cup/timework/**"/>
<patternset>
<include name="com/cbb/cup/timework/**/test/*"
if="buildTestSources"/>
<include name="com/cbb/cup/timework/**/*Test.java"
if="buildTestSources"/>
<exclude name="com/cbb/cup/timework/**/test/*"
unless="buildTestSources"/>
<exclude name="com/cbb/cup/timework/**/*Test.java"
unless="buildTestSources"/>
</patternset>
</javac>
</target>



In the com.cbb.cup.timework.business folder there is a file
GlobalErrors.java, that a lot files in the com.cbb.cup.timework
folders use.
However this file is not getting compiled before the other files, and
hence all the files give errors that GlobalErrors.ERROR_CODES is not
resolved. Using the -debug option I have found that Ant is actually
listing the GlobalErrors.java file to be compiled. Only it does not
seem to understand that this file is used by others, and hence has to
be compiled first.

This was not happenning before, as Ant was somehow sorting out which
files to compile first.

How can I force Ant to compile this particular file first before the
other files? Could this be a bug?

Any help would be greatly appreciated.

Regards,
Pai
 
B

bugbear

Roshan said:
Hi,

I am using Ant1.5 for my application build.
However this file is not getting compiled before the other files, and
hence all the files give errors that GlobalErrors.ERROR_CODES is not
resolved. Using the -debug option I have found that Ant is actually
listing the GlobalErrors.java file to be compiled. Only it does not
seem to understand that this file is used by others, and hence has to
be compiled first.

This was not happenning before, as Ant was somehow sorting out which
files to compile first.


Strange. Javac doesn't compile one file first. AFAIK
all the files (it wants to compile...) are compiled
as a set. This is important, since Java supports
mutual references without forward declaration.

BugBear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top