You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/07/19 01:14:41 UTC

DO NOT REPLY [Bug 21723] New: - FileSet should have "if" and "unless"

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=21723>.
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=21723

FileSet should have "if" and "unless"

           Summary: FileSet should have "if" and "unless"
           Product: Ant
           Version: 1.5.1
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: kk@kohsuke.org


If the @dir of a <fileset> does not exist, it causes the build to fail, but this
causes a problem in the following scenario:

1. my build script needs to accept two env variables.
   either one (or both) of them need to be present.

2. Those two env vars are used to build a classpath. thus:

   <path id="classpath">
     <fileset dir="${env.VARIABLE1}/lib" includes="*.jar" />
     <fileset dir="${env.VARIABLE2}/sub/lib" includes="*.jar" />
   </path>

3. this classpath is shared from various targets in the build script,
   therefore it needs to be defined at the top-level.

4. but if only VARIABLE1 is defined and VARIABLE2 is not, it causes
   the build failure, and there's no workaround for it.


this would have been very simple if I could write:

   <path id="classpath">
     <fileset dir="${env.VARIABLE1}/lib" includes="*.jar" if="env.VARIABLE1"/>
     <fileset dir="${env.VARIABLE2}/sub/lib" includes="*.jar" if="env.VARIABLE2" />
   </path>

This feature would have many uses. For example, when I create a zip file, I
could change the contents of it based on the build property.


Also, little Google search shows that I'm not the only one who'd like to see
this feature. See http://ant-contrib.sourceforge.net/fileset.html

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