DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7719>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7719

need to ref filesets

           Summary: need to ref filesets
           Product: Ant
           Version: unspecified
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Ant does not allow the user to create filesets or filelists and then refer to 
them by id.  This would be a very great feature because it would enable 
generalization of tasks.

For example, I could create a "smartjar" task that would check dependencies and 
jar if anything has changed...

  <target name="smartJar" description="helper target">
        <!--
        * Creates a jar if any of it's source files have been updated
        *   Parameters:
        *     sourceFileset = a refid to the source fileset
        *     jarFile       = a refid to a filelist containing
        *                     the jar file to create
        -->

        <dependset>
          <srcfileset refid="${sourceFileset}"/>
          <targetfilelist refid="${jarFile}"/>
        </dependset>

        <jar jarfilerefid="${jarFile}">
          <fileset refid="${sourceFileset}"/>
        </jar>
  </target> <!-- smartJar -->

Then call it as follows...


  <fileset id="classfiles.production" dir="classes">
    <include name="**/*.class"/>
    <exclude name="**/test/*" />
  </fileset>

  <filelist id="jarfile.production" dir="release" files="myApplication.jar">

 <antcall target="smartJar">
    <param name="sourceFileset" value="classfiles.production"/>
    <param name="jarFile" value="jarfile.production"/>
 </antcall>

  <fileset id="classfiles.unittests" dir="classes">
    <include name="**/test/*.class"/>
  </fileset>

  <filelist id="jarfile.unittests" dir="release" files="unittests.jar">

 <antcall target="smartJar">
    <param name="sourceFileset" value="classfiles.unittests"/>
    <param name="jarFile" value="unittests.jar"/>
 </antcall>

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

Reply via email to