Consider the following project layout (assuming that A and B are dependent on each other):
.
|
|
|
| `
`
`
After compilation, I want the classes to be in the appropriate folders:
.
|
| `
|
| `
|
| `
`
`
This is pretty simple from the command line:
$ javac -implicit:none -sourcepath src1:src2 -d bin1 src1/*
$ javac -implicit:none -sourcepath src1:src2 -d bin2 src2/*
Eclipse also does it this way if it is so configured. But I can’t figure out how to do this with Ant.
Appendix: My current tasks javac:
<javac destdir="${classes.1.dir}">
<src path="${src.1.dir}" />
<src path="${src.2.dir}" />
</javac>
<javac destdir="${classes.2.dir}">
<classpath path="${classes.1.dir}" />
<src path="${src.2.dir}" />
</javac>
Pay attention to circular dependence. The second task works well, it only compiles whats in src2, since it has a dependency classpathon another assembly. However, the first task cannot be accepted classpath, since nothing has been compiled yet, and with the help of srcit, of course, it compiles too much.