ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen <>
Subject combining fileset's
Date Thu, 15 Jan 2004 20:29:11 GMT
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" />

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


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" />


        <!-- 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 id="generated_jars.patternset">
            <include name="birthprint/output/birthprint.jar" />
            <include name="model3/output/model3.jar" />
        <fileset id="generated_jars.fileset" dir="${code_root}" >
            <patternset refid="runtime.patternset" />
            <patternset refid="generated_jars.patternset" />

          <!-- 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/*" />

          <!-- all the files needed to run the software  -->
        <fileset id="runtime.fileset" dir="${code_root}" >
            <patternset refid="runtime.patternset" />

        <fileset id="buildtime.fileset" dir="${code_root}" >
            <patternset refid="buildtime.patternset" />

       <!-- 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" />


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message