source: release-kits/wirk2/ant-scripts/wrap.xml@ 19586

Last change on this file since 19586 was 19586, checked in by oranfry, 15 years ago

grouped code for creating cdrom components

File size: 3.4 KB
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"/>
15
16 <!-- copy source files -->
17 <copy todir="${basedir}/wrapped-installer" file="${wirk2.home}/windows/wrapper/wrapper.cpp" overwrite="true"/>
18 <copy todir="${basedir}/wrapped-installer" file="${wirk2.home}/core/search4j/libsearch4j.cpp" overwrite="true"/>
19 <copy todir="${basedir}/wrapped-installer" 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/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" 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" 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 ${windows-java.installer} to the copy as chunks</echo>
48 <rsplit
49 resource="${wirk2.home}/windows/wrapper/${windows-java.installer}"
50 outputDir="${basedir}/wrapped-installer"
51 resourceScript="${basedir}/wrapped-installer/wrapper.rc"
52 resourceName="JAVA"
53 resourceType="EXE"
54 chunkSize="${resources.chunksize}"/>
55
56 <echo>adding greenstone2.jar to the resource script as chunks</echo>
57 <rsplit
58 resource="${basedir}/installer/Greenstone-${version}-win32.jar"
59 outputDir="${basedir}/wrapped-installer"
60 resourceScript="${basedir}/wrapped-installer/wrapper.rc"
61 resourceName="JAR"
62 resourceType="JAR"
63 chunkSize="${resources.chunksize}"
64 />
65
66 <echo>resource compiling the resource script</echo>
67 <exec executable="rc" dir="${basedir}/wrapped-installer">
68 <arg line="wrapper.rc"/>
69 </exec>
70
71 </target>
72
73 <target name="compile-wrapper">
74 <exec executable="cl" dir="${basedir}/wrapped-installer">
75 <arg line="/c -GX /DWINDOWS=yes libsearch4j.cpp /out:libsearch4j.obj"/>
76 </exec>
77
78 <exec executable="cl" dir="${basedir}/wrapped-installer">
79 <arg line="/c -GX /DWINDOWS=yes wrapper.cpp /out:wrapper.obj"/>
80 </exec>
81 </target>
82
83 <target name="link-wrapper">
84 <mkdir dir="products"/>
85 <exec executable="link" dir="${basedir}/wrapped-installer">
86 <arg line="/OUT:..\products\Greenstone-${version}-win32.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/>
87 </exec>
88 </target>
89
90</project>
Note: See TracBrowser for help on using the repository browser.