ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Advanced includes/excludes for javac
Date Mon, 23 Jun 2008 12:57:40 GMT
Roman Kennke wrote:
> Hi there,
> 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/
> src/proj1/
> src/proj2/
> src/proj2/
> 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?

You are in trouble as javac is going to take over. If it wants 
something, it may take it anyway.

If you have to do this -and the only place I've even encountered such a 
thing was laptop bioses- the trick is to copy all the files you want to 
one location, and none of the files you dont want.

This will build, but leave you with another nightmare, working out which 
files are actually included.

I would strongly encourage you not to do this. The laptop bioses almost 
made sense, because they had to fit into a small amount of memory, but 
even then the copies and the mess of #ifdef blocks meant the usual test 
for 'is some code in the build' was to edit the file so that it couldn't 
compile, then see if that broke the build.

Steve Loughran        
Author: Ant in Action 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message