ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: Selecting source files if they have been compiled
Date Thu, 20 Aug 2009 21:13:47 GMT
Patternsets to the rescue!


<patternset id="src">
    <include ${pattern1}.java/>
</patternset>

<javac
    sourcepath="">
    <patterset refid="src"/>
</javac>

Your different tasks can define different patternsets for source files.

On Thu, Aug 20, 2009 at 10:08 AM, Stefan Walter <sw@gegenunendlich.de>wrote:

> Hi,
>
> is there a good/elegant recipe for selecting those source files that javac
> chose to compile?
>
> I have a single source directory containing the project's classes and
> multiple targets compiling subsets of these classes into distinct
> destination directories. For at least one of these subsets, I would like
> to also copy the source files over to the destination directory to include
> it in the distribution.
>
> At the moment, I could imagine two ways:
>
> - Using the output of the 'listfiles' parameter of the javac task in some
>  way.
> - Taking the names of the class files in the destination directory,
>  replacing '.class' with '.java' and filtering out inner classes.
>
> Does anyone know a better/more elegant approach?
>
> Stefan
> --
> No reading beyond this point
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
David Weintraub
qazwart@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message