ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: AW: Use the same <fileset> in multiple <javac> tasks
Date Thu, 28 Jan 2010 05:54:25 GMT
Have you tried id+refid?

<path id="srcpath"><fileset > <include>.....
<path refid="srcpath"/> <!-- reference to the other -->


Jan 

>-----Ursprüngliche Nachricht-----
>Von: Dean Schulze [mailto:dean_w_schulze@yahoo.com] 
>Gesendet: Mittwoch, 27. Januar 2010 17:11
>An: Ant Users List
>Betreff: Re: AW: Use the same <fileset> in multiple <javac> tasks
>
>Jan,
> 
>I appreciate your response, but please do not accuse me of not 
>researching this problem before posting.  The example you 
>posted does not address my problem, so please consider my 
>question more thoroughly.
> 
>The example you included from the manual has nested <include 
>.../> and <exclude .../> tags.  That is what I want to avoid.  
>I don't want to repeat the <include .../> and <exclude .../> 
>tags in multiple <javac ...> tasks.
> 
>If I define a <path ...> structure with a <fileset> that has 
>those  <include .../> and <exclude .../> tags the <javac ..> 
>task fails because with the message that the .java files in 
>the <path> "is not a directory."  The script showing this is below.
> 
>Apparently the <src ..> tag and the srcdir attribute have to 
>refer to directories, whereas fileset (and the <include ..> 
>and <exclude ...> tags) refer to files.  That makes sense, but 
>it still leaves my problem unsolved.
> 
>How do I define a set of files to be used in <javac ...> 
>external to the <javac ...> task?
> 
>Here is the script:
> 
><path id="cmdbServiceFiles">
><fileset dir="${src.main.java.dir}">
><include name="**/cmdb/**" />
><include name="**/handler/**" />
></fileset> 
></path>
> 
><target name="compile-client" >
><javac destdir="${classes.dir}" debug="true" listfiles="true">
><src refid="cmdbServiceFiles" />
><classpath refid="classpath.metro.tools" />
><classpath refid="classpath.lib.other" />
></javac>
></target>
> 
> 
> 
> 
> 
>
>--- On Tue, 1/26/10, Jan.Materne@rzf.fin-nrw.de 
><Jan.Materne@rzf.fin-nrw.de> wrote:
>
>
>From: Jan.Materne@rzf.fin-nrw.de <Jan.Materne@rzf.fin-nrw.de>
>Subject: AW: Use the same <fileset> in multiple <javac> tasks
>To: user@ant.apache.org
>Date: Tuesday, January 26, 2010, 11:24 PM
>
>
>Ok, you have read the manual
>"This task forms an implicit FileSet and supports most 
>attributes of <fileset> (dir becomes srcdir) as well as the 
>nested <include>, <exclude> and <patternset> elements."
>
>But then - directly the next paragraph:
>"<javac>'s srcdir, classpath, sourcepath, bootclasspath, and 
>extdirs attributes are path-like structures and can also be 
>set via nested <src> (note the different name!), <classpath>, 
><sourcepath>, <bootclasspath> and <extdirs> elements, respectively."
>
>And in the examples:
>
>is the same as the previous example, with the addition of a 
>second source path, defined by the property src2. This can 
>also be represented using nested <src> elements as follows:
>
>  <javac destdir="${build}"
>         classpath="xyz.jar"
>         debug="on">
>    <src path="${src}"/>
>    <src path="${src2}"/>
>    <include name="mypackage/p1/**"/>
>    <include name="mypackage/p2/**"/>
>    <exclude name="mypackage/p1/testpackage/**"/>
>  </javac>
>
>
>
>Jan 
>
>>-----Ursprüngliche Nachricht-----
>>Von: Dean Schulze [mailto:dean_w_schulze@yahoo.com] 
>>Gesendet: Dienstag, 26. Januar 2010 20:45
>>An: user@ant.apache.org
>>Betreff: Use the same <fileset> in multiple <javac> tasks
>>
>>Instead of repeating <include .../> and <exclude ... /> tags I 
>>want to declare a <fileset> once and use it in multiple <javac 
>>.../> tasks.
>> 
>>The problem is that <javac ...> contains an implicit fileset 
>>and does not allow the <fileset > tag inside of it.
>> 
>>Is there a way to include an external fileset in <javac /> ?
>>
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam protection around 
>>http://mail.yahoo.com 
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>
>      
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message