On Mon, Jun 23, 2008 at 5:40 AM, Roman Kennke <[EMAIL PROTECTED]> wrote: > I have a problem with the javac task that I cannot solve, maybe somebody > can help me. Let's say I have a directory layout like this: > > src/proj1/Class1.java > src/proj1/Class2.java > src/proj2/Class1.java > src/proj2/Class2.java > > Now I want to compile Class1 from proj1 and Class2 from proj2 and > exclude the other two. Also, I need to compile those in one go because > they depend on each other. I didn't find a way to implement this using > the srcdir attribute, or nested src tags. Any ideas?
The only way to do this is by resetting srcdir to an empty string. That's the technique <compilewithwalls> and others (including me) have used in the past. That way, Javac will compile *only* the file explicitly given to it, and never implicitly compile files the explicitly given classes depend on (which will lead to compile failures if the depend classes aren't found via the classpath). AFAIK, <javac> will accept several nested <fileset>s, so that's how you include source files from several directories (but remember to scrdir=""). --DD
