Changeset 65504e8 for build.xml


Ignore:
Timestamp:
Jan 27, 2012 6:53:52 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b54c9fd2
Parents:
c902d4c
Message:
  • Build: Repack release jars with pack200 -r, saves about 1% and

might save a little memory at runtime too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    rc902d4c r65504e8  
    619619    </target>
    620620
     621    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
     622        <ant target="repack200" />
     623        <!-- no use doing repack200 on jbigi.jar -->
     624        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
     625        <copy todir="pkg-temp/lib/wrapper/solaris/">
     626            <fileset dir="installer/lib/wrapper/solaris/" />
     627        </copy>
     628    </target>
     629
    621630    <target name="preppkg-freebsd" depends="preppkg-unix">
    622631        <copy todir="pkg-temp/lib/wrapper/freebsd/">
     
    866875    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
    867876    <target name="updater" depends="prepupdate, preplicenses, zipit" />
     877    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
    868878    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
    869879    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
    870880    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
    871881    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
     882    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
    872883    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
    873884    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
     
    894905
    895906    <target name="pack200">
    896 <!-- *nix here -->
     907        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
     908        <!-- *nix here -->
    897909        <exec executable="sh" osfamily="unix" failonerror="true">
    898910            <arg value="-c" />
     
    901913        <exec executable="sh" osfamily="mac" failonerror="true">
    902914            <arg value="-c" />
    903             <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
    904915            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
    905916        </exec>
    906 <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
    907                 <exec executable="cmd" osfamily="windows" failonerror="true">
    908                         <arg value="/c" />
    909                         <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -g pkg-temp\webapps\%~ni.war.pack %i.jar &amp;&amp; del %i.jar" />
    910         </exec>
    911                 <exec executable="cmd" osfamily="windows" failonerror="true">
    912                         <arg value="/c" />
    913                         <arg value="for %i in (pkg-temp\lib\*.jar) do move %i %i.jar &amp;&amp; pack200 -g pkg-temp\lib\%~ni.jar.pack %i.jar &amp;&amp; del %i.jar" />
     917        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
     918        <exec executable="cmd" osfamily="windows" failonerror="true">
     919            <arg value="/c" />
     920            <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -g pkg-temp\webapps\%~ni.war.pack %i.jar &amp;&amp; del %i.jar" />
     921        </exec>
     922        <exec executable="cmd" osfamily="windows" failonerror="true">
     923                <arg value="/c" />
     924                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
     925        </exec>
     926    </target>
     927
     928    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
     929    <target name="repack200">
     930        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
     931        <!-- *nix here -->
     932        <exec executable="sh" osfamily="unix" failonerror="true">
     933            <arg value="-c" />
     934            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
     935        </exec>
     936        <exec executable="sh" osfamily="mac" failonerror="true">
     937            <arg value="-c" />
     938            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
     939        </exec>
     940        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
     941        <exec executable="cmd" osfamily="windows" failonerror="true">
     942            <arg value="/c" />
     943            <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -r %i.jar &amp;&amp; move %i.jar %i" />
     944        </exec>
     945        <exec executable="cmd" osfamily="windows" failonerror="true">
     946                <arg value="/c" />
     947                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
    914948        </exec>
    915949    </target>
     
    12681302    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
    12691303-->
    1270     <target name="release" depends="verifyReleaseBuildNumbers, distclean, testscripts, updater, updater200, preppkg, installer" >
     1304    <target name="release" depends="verifyReleaseBuildNumbers, distclean, testscripts, updaterRepack, updater200, preppkgRepack, installer" >
    12711305        <echo message="================================================================" />
    12721306        <echo message="Did you update these files?" />
Note: See TracChangeset for help on using the changeset viewer.