ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Javac task design problems
Date Sat, 22 Feb 2003 22:56:01 GMT
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.

> 
> 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. IOW, 
there is a disconnect between javac the task and javac the compiler.

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 ...

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.

Conor



Mime
View raw message