ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <sc...@alodar.com>
Subject Can a jar fileset/zipfileset refer to a nonexistent directory?
Date Thu, 01 Aug 2002 22:30:51 GMT
Our developers want to include the contents of the "images" directory 
into produced zip files if it exists.

The code is simple enough:

   <property name="compile.images" value="${project.work.dir}/images"/>

   <target name="jar" >
     <mkdir dir="${jar.dist}"/>
     <jar
       jarfile="${jar.dist}/${jar.baseName}.jar"
       compress="${jar.compress}">
       <zipgroupfileset dir="${compile.product.dir}" 
includes="${jar.extra.product.zip}"/>
       <zipgroupfileset dir="${compile.library.dir}" 
includes="${jar.extra.library.zip}"/>
       <zipfileset dir="${compile.images}" prefix="images"/>
       <fileset dir="${compile.classes}"/>
     </jar>
   </target>

The problem comes if the "images" directory does not exist.  The build 
will then fail with

file:/Users/work/Documents/coding/isis/source/build/standard-
build.xml:202: 
/Users/work/Documents/coding/isis/source/metagraph/persistence/persistable/
images not found.

I could create it in every one of our hundred or so projects with a one 
line mkdir, but the developers have already said that they do not want 
that.  They feel that the directory should only exist in the file system 
if there are actually images to process, and thus making a zillion such 
directories just in case they may exist some day.

So, any suggestions?

Scott


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


Mime
View raw message