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 wrapper source into place -->
|
---|
17 | <antcall target="get-copy-of-wrapper-source"><param name="todir" value="wrapped-installer"/></antcall>
|
---|
18 |
|
---|
19 |
|
---|
20 | </target>
|
---|
21 |
|
---|
22 | <target name="tweak-files-for-wrapping">
|
---|
23 | <echo>Substitute concrete values of things into source files</echo>
|
---|
24 | <rsr file="${basedir}/wrapped-installer/wrapper.cpp">
|
---|
25 | <job pattern="@java.installer@" replacement="${windows-java.installer}"/>
|
---|
26 | <job pattern="@java.min.version@" replacement="${java.min.version}"/>
|
---|
27 | <job pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
|
---|
28 | <job pattern="@java.extracted@" replacement="${windows-java.extracted}"/>
|
---|
29 | </rsr>
|
---|
30 | </target>
|
---|
31 |
|
---|
32 | <target name="compile-resources">
|
---|
33 |
|
---|
34 | <echo>Compiling resources</echo>
|
---|
35 |
|
---|
36 | <echo>getting the template resource script</echo>
|
---|
37 | <copy todir="${basedir}/wrapped-installer" file="${wirk2.home}/windows/wrapper/wrapper.rc" overwrite="true"/>
|
---|
38 |
|
---|
39 | <echo>copying the small resource files into place</echo>
|
---|
40 |
|
---|
41 | <echo>adding ${windows-java.installer} to the copy as chunks</echo>
|
---|
42 | <rsplit
|
---|
43 | resource="${wirk2.home}/windows/wrapper/${windows-java.installer}"
|
---|
44 | outputDir="${basedir}/wrapped-installer"
|
---|
45 | resourceScript="${basedir}/wrapped-installer/wrapper.rc"
|
---|
46 | resourceName="JAVA"
|
---|
47 | resourceType="EXE"
|
---|
48 | chunkSize="${resources.chunksize}"/>
|
---|
49 |
|
---|
50 | <echo>adding greenstone2.jar to the resource script as chunks</echo>
|
---|
51 | <rsplit
|
---|
52 | resource="${basedir}/installer/Greenstone-${version}-win32.jar"
|
---|
53 | outputDir="${basedir}/wrapped-installer"
|
---|
54 | resourceScript="${basedir}/wrapped-installer/wrapper.rc"
|
---|
55 | resourceName="JAR"
|
---|
56 | resourceType="JAR"
|
---|
57 | chunkSize="${resources.chunksize}"
|
---|
58 | />
|
---|
59 |
|
---|
60 | <echo>resource compiling the resource script</echo>
|
---|
61 | <exec executable="rc" dir="${basedir}/wrapped-installer">
|
---|
62 | <arg line="wrapper.rc"/>
|
---|
63 | </exec>
|
---|
64 |
|
---|
65 | </target>
|
---|
66 |
|
---|
67 | <target name="compile-wrapper">
|
---|
68 | <exec executable="cl" dir="${basedir}/wrapped-installer">
|
---|
69 | <arg line="/c -GX /DWINDOWS=yes libsearch4j.cpp /out:libsearch4j.obj"/>
|
---|
70 | </exec>
|
---|
71 |
|
---|
72 | <exec executable="cl" dir="${basedir}/wrapped-installer">
|
---|
73 | <arg line="/c -GX /DWINDOWS=yes wrapper.cpp /out:wrapper.obj"/>
|
---|
74 | </exec>
|
---|
75 | </target>
|
---|
76 |
|
---|
77 | <target name="link-wrapper">
|
---|
78 | <mkdir dir="products"/>
|
---|
79 | <exec executable="link" dir="${basedir}/wrapped-installer">
|
---|
80 | <arg line="/OUT:..\products\Greenstone-${version}-win32.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/>
|
---|
81 | </exec>
|
---|
82 | </target>
|
---|
83 |
|
---|
84 | </project>
|
---|