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_schu...@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.mate...@rzf.fin-nrw.de 
><jan.mate...@rzf.fin-nrw.de> wrote:
>
>
>From: jan.mate...@rzf.fin-nrw.de <jan.mate...@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_schu...@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-unsubscr...@ant.apache.org
>For additional commands, e-mail: user-h...@ant.apache.org
>
>
>
>
>      
>

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

Reply via email to