Changeset 15900 for release-kits/wirk3

Show
Ignore:
Timestamp:
06.06.2008 11:59:58 (12 years ago)
Author:
oranfry
Message:

now making use of the SplitResource? ant task instead of the split.exe program. also moved all constants to init

Location:
release-kits/wirk3/ant-scripts
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • release-kits/wirk3/ant-scripts/init.xml

    r15691 r15900  
    3131    <property name="basedir.local" refid="basedir.path"/> 
    3232 
    33     <!-- svn root --> 
    34     <property name="svn.root" value="http://svn.greenstone.org"/> 
    3533 
    3634    <!-- self defined tasks and types--> 
     
    4139    <typedef name="addressedcall" classname="TreeCallTarget" classpathref="project.classpath"/> 
    4240    <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/> 
     41    <typedef name="rsplit" classname="SplitResource" classpathref="project.classpath"/> 
    4342    <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>  
    4443     
     
    4645    <property file="build.properties" /> 
    4746     
    48     <!-- the version numbers of bundled things --> 
     47    <!-- CONSTANTS --> 
     48    <property name="resources.chunksize" value="8388608"/><!-- resources split into 8MiB chunks --> 
     49    <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/><!-- somewhere to store temporary text --> 
     50    <property name="svn.root" value="http://svn.greenstone.org"/><!-- svn root --> 
     51    <property name="java.min.version" value="1.5.0_00"/><!-- the minimum java version we require end users to have --> 
     52    <property name="java.installer" value="jre-6u3-windows-i586-p-s.exe"/><!-- relative to WIRK3_HOME/wrapper --> 
     53 
     54    <!-- the version numbers of bundled things (entered manually to save us autodetecting; update as needed) --> 
    4955    <property name="bundled.version.java" value="1.6.0_05"/> 
    5056    <property name="bundled.version.tomcat" value="5.5.25"/> 
    5157    <property name="bundled.version.ant" value="1.6.5"/> 
    52  
    53     <!-- somewhere to store temporary text --> 
    54     <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/> 
    55  
     58         
    5659    <!-- stuff to do before all tasks --> 
    5760    <target name="init"> 
  • release-kits/wirk3/ant-scripts/wrap.xml

    r15691 r15900  
    1010 
    1111<project name="wirk3-wrap" default="wrap"> 
    12     <property name="java.installer" value="jre-6u3-windows-i586-p-s.exe"/> 
    13     <property name="java.min.version" value="1.5.0_00"/> 
    14  
    1512 
    1613    <target name="wrap"> 
     
    2118        <addressedcall target="link-wrapper-no-java"/> 
    2219        <addressedcall target="link-wrapper-with-java"/> 
    23         <!--<addressedcall target="clean-up-after-wrapping"/>--> 
    2420    </target> 
    25  
    2621 
    2722    <target name="copy-files-for-wrapping"> 
     
    3328            <!-- copy source files --> 
    3429            <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper.cpp"/> 
     30            <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/search4j/libsearch4j.cpp"/> 
    3531            <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/search4j/libsearch4j.h"/> 
    36             <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper.rc"/> 
    3732         
    3833        </if> 
     
    4439            <!-- substitute the real java installer filename and min version into various files --> 
    4540            <echo>Substitute concrete values of things into source files</echo> 
    46             <rsr file="${basedir}/wrapped-installer/build/wrapper.rc" pattern="@java.installer@" replacement="${java.installer}"/> 
    4741            <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.installer@" replacement="${java.installer}"/> 
    4842            <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/> 
     
    6963                 
    7064                <echo>Compiling resources</echo> 
    71  
    72                 <echo>copying the resource files into place</echo> 
     65                 
     66                <echo>getting the template resource script</echo> 
     67                <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper.rc" overwrite="true"/> 
     68                 
     69                <echo>copying the small resource files into place</echo> 
    7370                <copy todir="${basedir}/wrapped-installer/build"> 
    74                     <fileset dir="${wirk3.home}/wrapper" includes="*.bmp,${java.installer}"/> 
     71                    <fileset dir="${wirk3.home}/wrapper" includes="*.bmp"/> 
    7572                    <fileset dir="${wirk3.home}/icon" includes="gs3.ico"/> 
    7673                </copy> 
    77                 <copy tofile="${basedir}/wrapped-installer/build/greenstone3.jar" file="${basedir}/installer/greenstone-${version}-win32.jar"/> 
    78  
    79                 <echo>splitting the big resources into chunks</echo> 
    80                 <property name="resource.chunk.size" value="8388608" /><!-- 8Mib --> 
    81                 <delete><fileset dir="${basedir}/wrapped-installer/build" includes="greenstone3.jar.*"/></delete> 
    82                 <exec executable="split.exe" dir="${basedir}/wrapped-installer/build"> 
    83                     <arg value="${basedir}/wrapped-installer/build/greenstone3.jar" /> 
    84                     <arg value="${resource.chunk.size}" /> 
    85                 </exec> 
    86                 <delete><fileset dir="${basedir}/wrapped-installer/build" includes="${java.installer}.*"/></delete> 
    87                 <exec executable="split.exe" dir="${basedir}/wrapped-installer/build"> 
    88                     <arg value="${basedir}/wrapped-installer/build/${java.installer}" /> 
    89                     <arg value="${resource.chunk.size}" /> 
    90                 </exec> 
    9174                 
    92                 <echo>adding the chunks to the resource scripts</echo> 
    93                  
    94                 <!-- compile the resources with bundled java--> 
     75                <echo>adding greenstone3.jar to the resource script as chunks</echo> 
     76                <rsplit 
     77                    resource="${basedir}/installer/greenstone-${version}-win32.jar" 
     78                    outputDir="${basedir}/wrapped-installer/build" 
     79                    resourceScript="${basedir}/wrapped-installer/build/wrapper.rc" 
     80                    resourceName="JAR" 
     81                    resourceType="JAR" 
     82                    chunkSize="${resources.chunksize}" 
     83                    /> 
     84             
     85                <echo>resource compiling the resource script</echo> 
    9586                <exec executable="rc" dir="${basedir}/wrapped-installer/build"> 
    9687                    <arg line="wrapper.rc"/> 
    9788                </exec> 
    98                 <move file="${basedir}/wrapped-installer/build/wrapper.RES" tofile="${basedir}/wrapped-installer/build/wrapper-with-jre.RES"/> 
     89                 
     90                <echo>making a copy of the resource script</echo> 
     91                <copy file="${basedir}/wrapped-installer/build/wrapper.rc" tofile="${basedir}/wrapped-installer/build/wrapper-with-jre.rc"/> 
     92                 
     93                <echo>adding ${java.installer} to the copy as chunks</echo> 
     94                <rsplit 
     95                    resource="${wirk3.home}/wrapper/${java.installer}" 
     96                    outputDir="${basedir}/wrapped-installer/build"                   
     97                    resourceScript="${basedir}/wrapped-installer/build/wrapper-with-jre.rc" 
     98                    resourceName="JAVA" 
     99                    resourceType="EXE" 
     100                    chunkSize="${resources.chunksize}" 
     101                    /> 
    99102 
    100                 <!-- compile the resources without bundled java --> 
    101                 <rsr file="${basedir}/wrapped-installer/build/wrapper.rc" pattern="^.*//bundled java only$" replacement=""/> 
     103                <echo>resource compiling the generated resource script again</echo> 
    102104                <exec executable="rc" dir="${basedir}/wrapped-installer/build"> 
    103                     <arg line="wrapper.rc"/> 
     105                    <arg line="wrapper-with-jre.rc"/> 
    104106                </exec> 
    105107                 
     
    117119 
    118120            <exec executable="cl" dir="${basedir}/wrapped-installer/build"> 
     121                <arg line="/c -GX /DWINDOWS=yes libsearch4j.cpp /out:libsearch4j.obj"/> 
     122            </exec> 
     123 
     124            <exec executable="cl" dir="${basedir}/wrapped-installer/build"> 
    119125                <arg line="/c -GX /DWINDOWS=yes wrapper.cpp /out:wrapper.obj"/> 
    120126            </exec> 
     
    126132        <if><bool><istrue value="${execute}"/></bool> 
    127133            <exec executable="link" dir="${basedir}/wrapped-installer/build"> 
    128                 <arg line="/OUT:..\greenstone-${version}-win32.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper.res"/> 
     134                <arg line="/OUT:..\greenstone-${version}-win32.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/> 
    129135            </exec> 
    130136        </if> 
     
    134140        <if><bool><istrue value="${execute}"/></bool> 
    135141            <exec executable="link" dir="${basedir}/wrapped-installer/build"> 
    136                 <arg line="/OUT:..\greenstone-${version}-win32-with-java.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper-with-jre.res"/> 
     142                <arg line="/OUT:..\greenstone-${version}-win32-with-java.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper-with-jre.res"/> 
    137143            </exec> 
    138144        </if> 
    139145    </target> 
    140146 
    141     <target name="clean-up-after-wrapping"> 
    142         <if><bool><istrue value="${execute}"/></bool> 
    143             <delete dir="${basedir}/wrapped-installer/build"/> 
    144         </if> 
    145     </target> 
    146  
    147  
    148  
    149147</project>