Hi there,
wrote:
> Hi,
>
> I have
>
> <target name="compile" depends="prepare">
> <javac destdir="${build.dir}" classpathref="build.classpath"
> debug="on">
> <src path="${framework.dir}:${src.dir}"/>
> </javac>
> </target>
>
> The files in the src.dir
>
> com.mysite.myapp...
>
> are dependent on the framework files
>
> com.mysite.myframework...
....
> How can I compile two directories with one dependent on the other?
You don't have circular dependencies right? (which would be very
ugly).
Then you can simply call Ant's javac task twice from your compile
target.
For example, if you'ge got a ${myapp.dir} defined :
<target name="compile" depends="prepare">
<javac destdir="${build.dir}" classpathref="build.classpath">
<src path="${framework.dir}:${src.dir}"/>
</javac>
<javac destdir="${build.dir}" classpathref="build.classpath">
<src path="${myapp.dir}:${src.dir}"/>
</javac>
</target>
This will work if "myapp" depends on "framework" but not the other
way round. Note that you must call javac on your "framework" first,
otherwise it won't work. Note also that you must use the same destdir.
This is relatively simple and straightforward, but there may be other,
better, ways to do it, which I leave to other posters to explain,
Alex