ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Javac task design problems
Date Sun, 23 Feb 2003 09:31:43 GMT
Conor MacNeill wrote:
> Stefano Mazzocchi wrote:
> 
>>
>> Build time went from 25 minutes to 5 minutes on my machine (a pentium 
>> II 366 ronzputer). Other people experienced equivalent speedups and 
>> everybody is joyful, singing and dancing and with renewed faith on 
>> mankind.
> 
> 
> If you keep that up, the government will declare it illegal.

LOL :)

>>
>> The ideal solution to the problem (without requiring to filter 
>> everything out would be)
>>
>>     <copy todir="${build.src}" filtering="on">
>>       <fileset dir="${src}">
>>         <include name="**/Constants.java"/>
>>       </fileset>
>>     </copy>
>>
>>     <javac destdir="${build.dest}">
>>       <src>
>>        <fileset dir="${src}">
>>         <exclude name="**/Constants.java"/>
>>        </fileset>
>>        <path location="${build.src}"/>
>>       </src>
>>     </javac>
>>
>> too bad it doesn't work because the <javac> tasks assumes that each 
>> file in its fileset is a directory!
> 
> 
> Not quite true, I think. The problem is more likely to come from javac 
> itself since it will go looking for files based on the source paths. 

then how do the exclude/include work?

> IOW, there is a disconnect between javac the task and javac the compiler.

Did you guys ever thought about usign the Eclipse java compiler? It's 
*very* nice, fast as hell and entirely embeddable and incremental. Plus 
is IBM public license so its totally legal to redistribute with Ant.

> Why not this:
>      <javac destdir="${build.dest}">
>        <src>
>         <path location="${build.src}"/>
>         <path location="${src}"/>
>        </src>
>      </javac>
> 
> That should cause javac to pick up the changed files first and ignore 
> the other copy in src. Well I haven't tried it, so YMMV ...

Nop, tried that and doesn't work. Javac tries to compile both copies of 
the file, complians about the duplication and fails.

> BTW, the other thing to consider is why you need to copy and filter at 
> all at the java source level. Ant's own build approach is to stick all 
> that sort of stuff in a resource and filter it.

yeah, well, if I start fixing all those things in half a million lines 
of code, I will never finish :)

-- 
Stefano Mazzocchi                               <stefano@apache.org>
    Pluralitas non est ponenda sine necessitate [William of Ockham]
--------------------------------------------------------------------



Mime
View raw message