0

My build script is failing because it is building class A before the dependency is built.

Is there a way to trace when exactly class A is being loaded during compilation? I know the task which fails but the task is compiling other classes C,D,E and There is no direct relations between them. The compiled classes import a Class B which is extended by Class A.

Like

Import Class B

Class C
{
}

Class A extends Class B
{
}

I am using eclipse to debug this. Ant verbose mode did not help either.

Any tips would be appreciated.

Thanks.

fireBand
  • 947
  • 7
  • 23
  • 42
  • Ant has two debug flags, -d (debug) and -v (verbose) - if you enable both of those I think you should get some useful info. – gareth_bowles Apr 19 '12 at 22:58
  • I ve used this. It does show me the last java file that compiled before trying to compile class A but still not sure why its been loaded. – fireBand Apr 20 '12 at 02:58

1 Answers1

0

If you are compiling all classes in the same javac task, then javac (the executable) will determine the correct dependency order.

However, if you are intending to compile class A sometime after class B has been compiled, then you need to ensure the class file for B is in the classpath of the javac target for compiling A.

For example:

<javac srcdir="b-project/src" destdir="classes"/>

... then sometime later, perhaps in another target (set the depends attribute) ...

<path id="compile.classpath">
    <fileset dir="classes"/><!-- contains compiled class B -->
</path>
<javac classpathref="compile.classpath" srcdir="a-project/src" destdir="classes"/>

If this doesn't help you then please post the relevant portions of your build file.

Synesso
  • 37,610
  • 35
  • 136
  • 207