Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Ant's not figuring out the order of compilation

Reply
Thread Tools

Ant's not figuring out the order of compilation

 
 
Roshan Pai
Guest
Posts: n/a
 
      10-07-2004
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
 
Reply With Quote
 
 
 
 
bugbear
Guest
Posts: n/a
 
      10-07-2004
Roshan Pai wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Figuring out which form button was pressed darrel ASP .Net 19 01-30-2006 04:15 PM
Figuring Out String Value for Font Constructor kvnsmnsn@hotmail.com Java 2 02-15-2005 08:19 AM
Need help figuring out scope in Java rboelio Java 1 02-03-2004 04:57 AM
trouble figuring out HttpURLConnection Flip Java 8 11-13-2003 05:33 AM
Figuring Out Why My Program Eats So Much Memory Dale Java 4 09-25-2003 02:11 AM



Advertisments