ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Donath <>
Subject Re: JAR target
Date Thu, 23 Nov 2000 11:22:11 GMT

What I want to do is similiar to updating a JAR archive as with the "jar uf0" command.

Here is a snippet from a MSDOS batch file that does exactly what I want to do with Ant:

echo creating java archive...
jar cvmf %PACKAGE%/alarmbrowser/%METAINFO% %TARGET% %PACKAGE%/alarmbrowser/*.class
jar uvf  %TARGET% %PACKAGE%/alarmbrowser/res/*.properties
jar uvf  %TARGET% %PACKAGE%/alarmbrowser/action/*.class
jar uvf0 %TARGET% %PACKAGE%/alarmbrowser/img/*.gif
jar uvf  %TARGET% %PACKAGE%/global/*.class

Here is my task that creates the JAR file with Ant:

<target name="alarmbrowser" depends="compile, init"> 		
  <copy todir="${buildDir}/${packagePath}/${packageAlarmBrowser}/img">
    <fileset dir="${sourceDir}/${packagePath}/${packageAlarmBrowser}/img">
      <include name="**/*.gif"/>

  <copy todir="${buildDir}/${packagePath}/${packageAlarmBrowser}/res">
    <fileset dir="${sourceDir}/${packagePath}/${packageAlarmBrowser}/res">
      <include name="**/*.properties"/>

  <jar jarfile="${targetDir}/${targetAlarmBrowser}" 
        includes="**/${packageAlarmBrowser}/, **/${packageGlobal}/"			           

When I use compress="true" then the GIF files become also compressed and cannot be 
loaded from the classpath afterwards (when running as applet). 

I would appreciate any suggestions or comments!

Thanks, Bernd

> Hi,
> has anyone produced a JAR archive containing compressed AND uncompressed
> data (i.e GIFs) using the JAR or JLINK task? It seems as if the
> compress-Attribute does always affect the whole archive. Or is there a way
> to use the compress-Attr. with the fileset or pathelement tag?
> I am using version: Ant version 1.2 compiled on October 24 2000
> Thanks, Bernd

View raw message