ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7719] New: - need to ref filesets
Date Wed, 03 Apr 2002 14:58:16 GMT
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: ant-dev@jakarta.apache.org
        ReportedBy: ghouston@iss.net


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


Mime
View raw message