Roedy said:
You mean winzip, PkZip, 7Zip, WinRar?
Zip utilitiies don't build manifests. I gather you are doing that
manually?
Zip utilities are highly tuned native assembler code. So it is no
surprise that the generic code in jar.exe is much slower.
I'm using solaris & cygwin zip.
I'm creating manifests manually.
I'm exec'ing the zip from ant, as opposed to using ant's jar task.
<macrodef name="fastJar"><!-- jar is slow, so zip -->
<attribute name="jarFile"/>
<attribute name="basedir"/>
<attribute name="javaVersion" default="1.4.2"/>
<attribute name="zipdirs" default="com"/>
<sequential>
<dirname file="@{jarFile}" property="dir_@{jarFile}"/>
<echo message="dbg:fastJar @{jarFile} @{baseDir} @{zipdirs}"/>
<mkdir dir="@{basedir}/META-INF"/>
<property name="metaInf.@{jarFile}" value=" META-INF"/>
<echo file="@{basedir}/META-INF/MANIFEST.MF"
message="Manifest-Version: 1.0${line.separator}Created-By:
@{javaVersion} (Sun Microsystems Inc.)${line.separator}"/>
<echo message="exec: zip -q -r @{jarFile}${metaInf.@{jarFile}}
@{zipdirs}"/>
<dirname property="dir.@{jarFile}" file="@{jarFile}"/>
<mkdir dir="${dir.@{jarFile}}"/>
<tempfile property="tmpJar.@{jarFile}"
destDir="${dir.@{jarFile}}" prefix="tmpJar" suffix=".zip"/>
<exec executable="zip" failonerror="true" dir="@{basedir}">
<arg line="-q -r ${tmpJar.@{jarFile}}${metaInf.@{jarFile}}
@{zipdirs}"/>
</exec>
<move file="${tmpJar.@{jarFile}}" tofile="@{jarFile}"/>
</sequential>
</macrodef>