On Wednesday, August 14, 2002, at 10:45  PM, Scott Ellsworth wrote:

> I have been asked to put the contents of my resources directory at the 
> top level.  What makes this hard is that the resources dirctory may not 
> exist.

Further, doing

   <target name="jar-files" description="Jar files">
     <available file="${jar.resources}" type="dir" 
property="jar.resources.exists" />
     <jar
       jarfile="${jar.dist}/${jar.baseName}.jar"
       compress="${jar.compress}" >
       <fileset dir="${compile.classes}"/>
     </jar>
   </target>

   <target name="jar-resources" if="jar.resources.exists">
     <!-- icky hack, as jar only checks file timestamps in 1.5.  If they 
check internal timestamps as 1.4 did, this can be removed. -->
     <touch file="${jar.dist}/${jar.baseName}.jar" datetime="01/01/2000 
2:02 pm"/>
     <jar
       jarfile="${jar.dist}/${jar.baseName}.jar"
       update="true">
       <zipfileset dir="${jar.resources}" />
     </jar>
   </target>

   <target name="jar" depends="compile, jar-files, jar-resources, 
jar-manifest, jar-sign" description="Build jar"/>

> foo
> -resources
> --blah.gif

foo.jar
-blah.gif

as desired, but I get a rebuild on this jar with every execution.  This 
is _very_ expensive.

Is there a way to use an uptodate task to check each file against that 
in the jar, and to force a rebuild if the files do not exist?

NB, fixing 11270 would fix this for me, as I could then put all of my 
filesets in just one jar task.  Having fileset take an if would also do 
it, as then I could just ignore it.

Scott


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

Reply via email to