Changeset afb3c76 for build.xml


Ignore:
Timestamp:
May 3, 2010 4:42:45 PM (10 years ago)
Author:
walking <walking@…>
Branches:
master
Children:
16bec08f
Parents:
2dc32aa3
Message:
  • rewrite portable targets

pkg-portable-clean
preppkg-portable-win32-jbigi
preppkg-portable-linux-jbigi
preppkg-portable-basic
preppkg-portable-win32
pkg-portable-win32

  • add windoz support to target pack200
File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    r2dc32aa3 rafb3c76  
    474474       -->
    475475    </target>
     476
    476477    <target name="pack200">
    477         <exec executable="sh" failifexecutionfails="true">
     478<!-- *nix here -->
     479        <exec executable="sh" osfamily="unix" failifexecutionfails="true">
     480            <arg value="-c" />
     481            <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" />
     482        </exec>
     483        <exec executable="sh" osfamily="mac" failifexecutionfails="true">
    478484            <arg value="-c" />
    479485            <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
    480486            <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" />
     487        </exec>
     488<!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
     489                <exec executable="cmd" osfamily="windows" failifexecutionfails="true">
     490                        <arg value="/c" />
     491                        <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" />
     492        </exec>
     493                <exec executable="cmd" osfamily="windows" failifexecutionfails="true">
     494                        <arg value="/c" />
     495                        <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" />
    481496        </exec>
    482497    </target>
     
    524539        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
    525540        <!-- decapitalized the file in 0.7.8 -->
    526         <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
     541       <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
    527542    </target>
    528543    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
     
    844859        <target name = "pkg-portable-clean">
    845860                <delete dir="build/" />
    846                 <delete dir="portable/" />
     861                <delete dir="pkg-temp/" />
    847862                <delete>
    848863                        <fileset dir="." includes="portable-**.zip**" />
     
    850865        </target>
    851866<!-- build a portable archive -->
    852 <!-- command for windows only packing -->
    853         <target name = "pkg-portable-win32"  depends="check-built-jars, preppkg-portable-windows-only, preppkg-portable-basic, preppkg-portable-win" >
    854                 <!-- i need the portable\ folder in .zip so basedir is set to . -->
    855                 <zip destfile="portable-win32.zip" basedir="." includes="portable\**" />
    856                 <checksum file="portable-win32.zip" forceOverwrite="yes"/>
    857         </target>
    858 <!-- *0* check libs -->
    859         <target name = "check-built-jars">
    860                 <fail message="Please run 'ant buildSmall' first">
    861                         <condition>
    862                                 <or>
    863                                         <not>
    864                                                 <available file="build/" type="dir" />
    865                                         </not>
    866                                         <!-- we cant accept more files or they will be bundled into the package during 'for x in y do'-->
    867                                         <not>
    868                                                 <resourcecount count="14">
    869                                                         <fileset id="fs" dir="build/" includes="**.jar"/>
    870                                                 </resourcecount>
    871                                         </not>
    872                                         <not>
    873                                                 <resourcecount count="3">
    874                                                         <fileset id="fs" dir="build/" includes="**.war"/>
    875                                                 </resourcecount>
    876                                         </not>
    877                                 </or>
    878                         </condition>
    879                 </fail>
    880         </target>
     867
     868<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
     869                we need to make sure its small, with NO redundent jars or wars.
     870                thus cleaning is required before each build-->
     871        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
    881872<!-- *1* preparing the jars by OS dependent de-bloating -->
    882         <target name="preppkg-portable-windows-only" depends="chk-bigi-size" if="bloated-jbigi">
     873        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly">
    883874                <!-- rip the non-windows stuff out of jbigi.jar -->
    884875                <mkdir dir="tmpextract" />
     
    889880                <delete dir="tmpextract/" />
    890881        </target>
    891         <target name="preppkg-portable-linux-only"  depends="chk-bigi-size" if="bloated-jbigi">
     882        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly">
    892883                <!-- rip the non-linux stuff out of jbigi.jar -->
    893884                <mkdir dir="tmpextract" />
    894885                <unjar src="build/jbigi.jar" dest="tmpextract/" />
    895                 <jar destfile="pkg-temp/lib/jbigi.jar" >
     886                <jar destfile="build/jbigi.jar" >
    896887                        <fileset dir="tmpextract/" includes="*linux*" />
    897888                </jar>
    898889                <delete dir="tmpextract/" />
    899890        </target>
    900         <target name="chk-bigi-size">
    901                 <condition property="bloated-jbigi">
    902                         <length file="build/jbigi.jar" length="900000" when="gt" />
    903                 </condition>
    904         </target>
    905 <!-- *2* os independent procedure -->
     891
     892<!-- *2* os independent procedure  -->
    906893        <target name="preppkg-portable-basic" >
    907                 <mkdir dir="portable" />
     894                <mkdir dir="pkg-temp" />
    908895                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
    909                         <copy todir="portable">
     896                        <copy todir="pkg-temp">
    910897                                <fileset dir="installer/resources/portable/configs/" />
    911898                        </copy>
    912                         <copy file="installer/resources/blocklist.txt" todir="portable/" />
    913                         <copy file="installer/resources/hosts.txt" todir="portable/" />
    914                         <copy file="installer/resources/readme.license.txt" todir="portable/" />
    915                 <mkdir dir="portable/addressbook" />
    916                         <copy file="apps/addressbook/subscriptions.txt" todir="portable/addressbook/" />
    917                         <copy file="apps/addressbook/myhosts.txt"  todir="portable/addressbook/" />
     899                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
     900                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
     901                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
     902                <mkdir dir="pkg-temp/addressbook" />
     903                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
     904                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
    918905                        <!-- config.txt is in installer/resources/portable -->
    919                 <mkdir dir="portable/docs" />
    920                         <copy file="installer/resources/initialNews.xml" tofile="portable/docs/news.xml" overwrite="true" />
    921                         <copy file="installer/resources/readme/readme.html" tofile="portable/docs/readme.html" />
    922                         <copy file="installer/resources/startconsole.html" todir="portable/docs/" />
    923                         <copy file="installer/resources/start.ico" todir="portable/docs/" />
    924                         <copy file="installer/resources/console.ico" todir="portable/docs/" />
    925                         <!-- http error respond, english only,
     906                <mkdir dir="pkg-temp/docs" />
     907                        <copy file="installer/resources/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
     908                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
     909                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
     910                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
     911                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
     912                        <!-- HTTP Header files, english only,
    926913                                if you need a different lang do it in a sepreate target -->
    927                         <copy todir="portable/docs/" >
     914                        <copy todir="pkg-temp/docs/" >
    928915                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
    929916                        </copy>
    930                         <!-- here we choose light theme only -->
    931                         <copy todir="portable/docs/themes/console/light/" overwrite="true" >
     917                        <!-- Theme light only -->
     918                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
    932919                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
    933920                        </copy>
    934921<!-- @dr.zed where is your CJK fix for the default theme ??     put it here             <copy file="installer/resources/themes/console/classic/console_big.css" todir="portable/docs/themes/console/light/" / -->
    935                         <copy todir="portable/docs/themes/console/images/" >
     922                        <copy todir="pkg-temp/docs/themes/console/images/" >
    936923                                <fileset dir="installer/resources/themes/console/images/" />
    937924                        </copy>
    938                         <!-- flags for language icon (not for ip)-->
    939                         <copy todir="portable/docs/icons/flags" >
     925                        <!-- FLAGs for language icon (not for ip)-->
     926                        <copy todir="pkg-temp/docs/icons/flags" >
    940927                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
    941928                        </copy>
    942                 <mkdir dir="portable/lib" />
    943                 <mkdir dir="portable/webapps" />
    944                         <copy todir="portable/webapps/">
     929                <mkdir dir="pkg-temp/webapps" />
     930                        <copy todir="pkg-temp/webapps/">
    945931                                <fileset dir="build/" includes="**.war" />
    946932                        </copy>
     933                <mkdir dir="pkg-temp/lib" />
     934                        <copy todir ="pkg-temp/lib/" >
     935                                <fileset dir="build/" includes="**.jar" />
     936                        </copy>
     937                        <!-- 3rd party jars from apps/  -->
     938                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
     939                        <copy file="apps/jrobin/jrobin-1.4.0.jar" tofile="pkg-temp/lib/jrobin.jar" />
    947940        </target>
    948941<!-- *3* os dependent procedure/commands -->
    949         <target name = "preppkg-portable-win">
    950                 <!-- *a* all jar in build/ -->
    951                         <!-- the following will not be pack200ed
    952                         since they got bloated rather than slimer after compression 00d -->
    953                 <move file="build\jasper-runtime.jar" todir ="portable\lib\" />
    954                 <move file="build\javax.servlet.jar" todir ="portable\lib\" />
    955                 <move file="build\jbigi.jar" todir ="portable\lib\" />
    956                 <exec executable="cmd" failifexecutionfails="true">
    957                         <arg value="/c" />
    958                         <arg value="for %i in (build\*.jar) do pack200 -g -G portable\lib\%~ni.pack %i" />
    959         </exec>
    960                 <copy todir ="build\" >
    961                         <fileset dir = "portable\lib\" includes = "**.jar" />
    962                 </copy>
    963                 <!-- *b* 3rd party jars from apps/  -->
    964                         <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
    965                 <exec executable="cmd" failifexecutionfails="true">
    966                         <arg value="/c"/>
    967                         <arg value="pack200 -g -G portable\lib\jrobin.pack apps\jrobin\jrobin-1.4.0.jar" />
    968                 </exec>
    969 <!---->
     942        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
    970943                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
    971                 <copy file="apps/systray/java/lib/systray4j.dll" todir="portable/lib" />
    972                 <exec executable="cmd" failifexecutionfails="true">
    973                         <arg value="/c"/>
    974                         <arg value="pack200 -g -G portable\lib\systray4j.pack apps\systray\java\lib\systray4j.jar" />
    975                 </exec>
    976 <!---->
     944                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
     945                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
    977946                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
    978                 <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="portable/lib" />
    979                 <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="portable/i2psvc.ex_" />
    980                 <exec executable="cmd" failifexecutionfails="true">
    981                         <arg value="/c"/>
    982                         <arg value="pack200 -g -G portable\lib\wrapper.pack installer\lib\wrapper\win32\wrapper.jar" />
    983                 </exec>
    984                 <!-- *c* copy the unpack/start batchfiles -->
    985                 <copy todir="portable">
     947                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
     948                <copy file="installer/lib/wrapper/win32/wrapper.jar" todir="pkg-temp/lib" />
     949                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
     950                        <!--  copy the unpack/start batchfiles -->
     951                <copy todir="pkg-temp">
    986952                        <fileset dir="installer/resources/portable/win32/" />
    987953                </copy>
    988954        </target>
     955<!-- *4* command for windows package -->
     956        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
     957                <!-- i need the portable\ folder in .zip so basedir is set to . -->
     958                <move file="pkg-temp" tofile="portable"/>
     959                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
     960                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
     961                <move file="portable" tofile="pkg-temp"/>
     962        </target>
    989963</project>
Note: See TracChangeset for help on using the changeset viewer.