root/release-kits/wirk2/ant-scripts/wrap.xml @ 19539

Revision 19539, 3.8 KB (checked in by oranfry, 11 years ago)

removing up-to-dateness check for now

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="wirk2-wrap" default="wrap">
3
4    <target name="wrap">
5        <antcall target="copy-files-for-wrapping"/>
6        <antcall target="tweak-files-for-wrapping"/>
7        <antcall target="compile-resources"/>
8        <antcall target="compile-wrapper"/>
9        <antcall target="link-wrapper"/>
10    </target>
11
12    <target name="copy-files-for-wrapping">
13        <!--create a directory to build the wrapped installer in -->
14        <mkdir dir="${basedir}/wrapped-installer/build"/>
15       
16        <!-- copy source files -->
17        <copy todir="${basedir}/wrapped-installer/build" file="${wirk2.home}/windows/wrapper/wrapper.cpp"  overwrite="true"/>
18        <copy todir="${basedir}/wrapped-installer/build" file="${wirk2.home}/core/search4j/libsearch4j.cpp" overwrite="true"/>
19        <copy todir="${basedir}/wrapped-installer/build" file="${wirk2.home}/core/search4j/libsearch4j.h" overwrite="true"/>
20
21    </target>
22   
23    <target name="tweak-files-for-wrapping">
24        <echo>Substitute concrete values of things into source files</echo>
25        <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp">
26            <job pattern="@java.installer@" replacement="${windows-java.installer}"/>
27            <job pattern="@java.min.version@" replacement="${java.min.version}"/>
28            <job pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
29            <job pattern="@java.extracted@" replacement="${windows-java.extracted}"/>
30        </rsr>
31    </target>
32
33    <target name="compile-resources">
34           
35            <echo>Compiling resources</echo>
36           
37            <echo>getting the template resource script</echo>
38            <copy todir="${basedir}/wrapped-installer/build" file="${wirk2.home}/windows/wrapper/wrapper.rc" overwrite="true"/>
39           
40            <echo>copying the small resource files into place</echo>
41            <copy todir="${basedir}/wrapped-installer/build" overwrite="true">
42                <fileset dir="${wirk2.home}/windows/wrapper" includes="*.bmp"/>
43                <fileset dir="${wirk2.home}/greenstone2/wrapper" includes="*.bmp"/>
44                <fileset dir="${wirk2.home}/greenstone2/icon" includes="icon.ico"/>
45            </copy>
46           
47            <echo>adding greenstone2.jar to the resource script as chunks</echo>
48            <rsplit
49                resource="${basedir}/installer/Greenstone-${version}-win32.jar"
50                outputDir="${basedir}/wrapped-installer/build"
51                resourceScript="${basedir}/wrapped-installer/build/wrapper.rc"
52                resourceName="JAR"
53                resourceType="JAR"
54                chunkSize="${resources.chunksize}"
55                />
56           
57            <echo>adding ${windows-java.installer} to the copy as chunks</echo>
58            <rsplit
59                resource="${wirk2.home}/windows/wrapper/${windows-java.installer}"
60                outputDir="${basedir}/wrapped-installer/build"                 
61                resourceScript="${basedir}/wrapped-installer/build/wrapper.rc"
62                resourceName="JAVA"
63                resourceType="EXE"
64                chunkSize="${resources.chunksize}"/>
65           
66            <echo>resource compiling the generated resource script</echo>
67            <exec executable="rc" dir="${basedir}/wrapped-installer/build">
68                <arg line="wrapper.rc"/>
69            </exec>
70           
71    </target>
72
73    <target name="compile-wrapper">
74        <exec executable="cl" dir="${basedir}/wrapped-installer/build">
75            <arg line="/c -GX /DWINDOWS=yes libsearch4j.cpp /out:libsearch4j.obj"/>
76        </exec>
77
78        <exec executable="cl" dir="${basedir}/wrapped-installer/build">
79            <arg line="/c -GX /DWINDOWS=yes wrapper.cpp /out:wrapper.obj"/>
80        </exec>
81    </target>
82   
83    <target name="link-wrapper">
84        <exec executable="link" dir="${basedir}/wrapped-installer/build">
85            <arg line="/OUT:..\..\products\Greenstone-${version}-win32.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/>
86        </exec>
87    </target>
88
89    <target name="archive-cdrom-components-and-installer">
90        <mkdir dir="products"/>
91        <tar destfile="products/cdrom-components-${version}-linux.tar.gz" compression="gzip">
92            <tarfileset dir="components/tmp"><include name="cdrom/**/*"/></tarfileset>
93            <tarfileset dir="wrapped-installer"><include name="cdrom-windows.exe"/></tarfileset>
94        </tar>
95    </target>
96
97</project>
Note: See TracBrowser for help on using the browser.