Ant's not figuring out the order of compilation

Discussion in 'Java' started by Roshan Pai, Oct 7, 2004.

  1. Roshan Pai

    Roshan Pai Guest

    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
    Roshan Pai, Oct 7, 2004
    #1
    1. Advertising

  2. Roshan Pai

    bugbear Guest

    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
    bugbear, Oct 7, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel
    Replies:
    19
    Views:
    591
    darrel
    Jan 30, 2006
  2. Dale
    Replies:
    4
    Views:
    356
  3. Flip
    Replies:
    8
    Views:
    665
  4. rboelio
    Replies:
    1
    Views:
    338
    Andrew Thompson
    Feb 3, 2004
  5. Replies:
    2
    Views:
    570
    Thomas Weidenfeller
    Feb 15, 2005
Loading...

Share This Page