I think I know what you are saying now. I have found this page on programming custom selectors

http://ant.apache.org/manual/CoreTypes/selectors-program.html

Which looks fairly straightforward. I am starting to code it now...

Thanks :-)



Glen wrote:

Matt I am intrigued could you elaborate or give an example?

Are you suggesting I should create a custom selector that can take a reference to another fileset?

Or is what I am trying to do (combine fileset A and fileset b into fileset C) possible with the selector's that come with 1.6 ?



Matt Benson wrote:

Use selectors in Ant 1.6.0.

-Matt

--- Glen <[EMAIL PROTECTED]> wrote:


I am wondering if there is an easier way to do
something. I have several different tasks each requiring a slightly
different classpath or fileset. I have modified my build.xml so that I am
sharing this information as much as possible. You know if I add
a jar I only have to add it in one place in the build.xml and all the
proper places pick up the appropriate reference.


My solution has been to define pattern sets, then
file sets using those pattern sets, and then a classpath from the file
sets (the code is at the bottom).  It works great but I am a programmer
and I like to fiddle so here is what I am asking.

Are there any ways to use just filesets and NO
pattern sets. Ultimately I would like to be able to combine to filesets say
like so...


      <fileset id="a"
file="./myproject/xyzpdq..jar"  />
             <fileset id="b" dir="./myproject/redist/" />

<fileset id="c" dir="./myproject/" >
<fileset refid="a" />
<fileset refid="b" />
</fileset> This would greatly simplify the script at the end
because I currently have to create a pattern set and a file set for each
bit I need. I am wondering if anyone has some clever recommendations
since I can't do what I just laid out (at least as far as I know)...



At least the when we add a jar now the build fails once then we add the jar to the build.xml where as before it would fail several times in a row each time showing a new place that needed the jar referenced LOL


-Glen






Here is the code snippet....

      <!-- jars needed to build the software but
NOT needed at runtime -->
       <patternset id="buildtime.patternset">
                 <include
name="tools/resin3/lib/jsdk-24.jar" />
           <include
name="tools/resin3/lib/resin.jar" />

           <include name="tools/batik/lib/*.jar" />
           <include
name="tools/xdoclet-1.2/lib/*.jar" />

</patternset>

       <!-- jars needed to buildtime and at runtime
-->
       <patternset id="runtime.patternset">

           <include
name="tools/sun/jaf-1.0.2/activation.jar"/>
           <include
name="tools/sun/javamail-1.3.1/mail.jar"/>

<include name="birthprint/lib/*.jar" />

           <include
name="tools/sun/jai-1_1_2/lib/*.jar" />

           <include name="model3/lib.deploy/*.jar"
/>
           <include
name="tools/hibernate-2.1/lib/*.jar" />

           <include
name="tools/sun/commapi/lib/*.jar" />

</patternset>
<patternset id="generated_jars.patternset">
<include
name="birthprint/output/birthprint.jar" />
<include name="model3/output/model3.jar"
/>
</patternset> <fileset id="generated_jars.fileset"
dir="${code_root}" >
<patternset refid="runtime.patternset"
/>
<patternset
refid="generated_jars.patternset" />
</fileset>


         <!-- all the files I need to copy to the
lib directory  -->
       <fileset id="deploy.fileset"
dir="${code_root}" >
           <patternset refid="runtime.patternset"
/>
           <patternset
refid="generated_jars.patternset" />

<filename name="birthprint/lib/*" />
<filename name="tools/sun/commapi/lib/*"
/>
<filename
name="tools/sun/jai-1_1_2/lib/*" />
</fileset> <!-- all the files needed to run the
software -->
<fileset id="runtime.fileset"
dir="${code_root}" >
<patternset refid="runtime.patternset"
/>
</fileset> <fileset id="buildtime.fileset"
dir="${code_root}" >
<patternset refid="buildtime.patternset"
/>
</fileset> <!-- the classpath is made up of the
<path id="project.classpath" >
<pathelement location="${classes}"/>
<pathelement location="${resources}"/>
<pathelement
location="${model3}/classes/"/>


<fileset refid="runtime.fileset" />

<fileset refid="buildtime.fileset" />

</path>





---------------------------------------------------------------------


To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]




__________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to