You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Glen <gl...@model3.net> on 2004/01/15 21:29:11 UTC

combining fileset's

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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: combining fileset's

Posted by Glen <gl...@model3.net>.
Your example will do wonderfully.  Very sheek and elegant thank you very 
much....

Said another way I have enough complexity in my development projects no 
need to add more... 

thanks again,
-Glen



Matt Benson wrote:

>Unless your actual needs are much more complicated
>than your example, do check my last post before you
>get too deep into coding your own selector.
>
>-Matt
>
>--- Glen <gl...@model3.net> wrote:
>  
>
>>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 <gl...@model3.net> 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/"/>
>>>>>          
>>>>>
>=== message truncated ===
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
>http://hotjobs.sweepstakes.yahoo.com/signingbonus
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>  
>

Re: combining fileset's

Posted by Matt Benson <gu...@yahoo.com>.
Unless your actual needs are much more complicated
than your example, do check my last post before you
get too deep into coding your own selector.

-Matt

--- Glen <gl...@model3.net> wrote:
> 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 <gl...@model3.net> 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/"/>
> 
=== message truncated ===


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

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


Re: combining fileset's

Posted by Glen <gl...@model3.net>.
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 <gl...@model3.net> 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:
>>> user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail:
>>> user-help@ant.apache.org
>>>
>>>   
>>
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
>> http://hotjobs.sweepstakes.yahoo.com/signingbonus
>>
>> ---------------------------------------------------------------------
>> 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


Re: combining fileset's

Posted by Matt Benson <gu...@yahoo.com>.
--- Glen <gl...@model3.net> wrote:
> Matt I am intrigued could you elaborate or give an
> example?
> 
The bug is one thing, but what I have done (though
Dominique apparently disputes the validity of my
approach) is to define selectors that will yield the
smallest filesets I need, then mix & match them.  If
it makes more sense, I can define a selector for the
complement to the files I actually want.  The only
restriction here is that all the files must live under
the same directory.  You have met that requirement in
the example below, so there is no need for you to wait
for enhancements:

<selector id="a.selector">
  <filename name="xyzpdq.jar" />
</selector>

<selector id="b.selector">
  <filename name="redist/**" />
</selector>

<fileset id="a" dir="./myproject">
  <selector refid="a.selector" />
</fileset>

<fileset id="b" dir="./myproject">
  <selector refid="b.selector" />
</fileset>

<fileset id="c" dir="./myproject">
  <and>
    <selector refid="a.selector" />
    <selector refid="b.selector" />
  </and>
</fileset>

-Matt

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

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


Re: combining fileset's

Posted by Glen <gl...@model3.net>.
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 <gl...@model3.net> 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:
>>user-unsubscribe@ant.apache.org
>>For additional commands, e-mail:
>>user-help@ant.apache.org
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
>http://hotjobs.sweepstakes.yahoo.com/signingbonus
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>  
>

Re: combining fileset's

Posted by Matt Benson <gu...@yahoo.com>.
Use selectors in Ant 1.6.0.

-Matt

--- Glen <gl...@model3.net> 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:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 


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

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