1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
2 |
|
---|
3 | <!--
|
---|
4 | ..........................................................
|
---|
5 | September 2007
|
---|
6 | Greenstone3 'release maker' script
|
---|
7 | Oran Fry
|
---|
8 | ..........................................................
|
---|
9 | -->
|
---|
10 |
|
---|
11 | <project name="wirk3-wrap" default="wrap">
|
---|
12 |
|
---|
13 | <target name="wrap">
|
---|
14 | <addressedcall target="copy-files-for-wrapping"/>
|
---|
15 | <addressedcall target="tweak-files-for-wrapping"/>
|
---|
16 | <addressedcall target="compile-resources"/>
|
---|
17 | <addressedcall target="compile-wrapper"/>
|
---|
18 | <addressedcall target="link-wrapper-no-java"/>
|
---|
19 | <addressedcall target="link-wrapper-with-java"/>
|
---|
20 | </target>
|
---|
21 |
|
---|
22 | <target name="copy-files-for-wrapping">
|
---|
23 | <if><bool><istrue value="${execute}"/></bool>
|
---|
24 |
|
---|
25 | <!--create a directory to build the wrapped installer in -->
|
---|
26 | <mkdir dir="${basedir}/wrapped-installer/build"/>
|
---|
27 |
|
---|
28 | <!-- copy source files -->
|
---|
29 | <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"/>
|
---|
31 | <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/search4j/libsearch4j.h"/>
|
---|
32 |
|
---|
33 | </if>
|
---|
34 | </target>
|
---|
35 |
|
---|
36 | <target name="tweak-files-for-wrapping">
|
---|
37 | <if><bool><istrue value="${execute}"/></bool>
|
---|
38 |
|
---|
39 | <!-- substitute the real java installer filename and min version into various files -->
|
---|
40 | <echo>Substitute concrete values of things into source files</echo>
|
---|
41 | <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.installer@" replacement="${java.installer}"/>
|
---|
42 | <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/>
|
---|
43 | <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@bundled.version.java@" replacement="${bundled.version.java}"/>
|
---|
44 |
|
---|
45 | </if>
|
---|
46 | </target>
|
---|
47 |
|
---|
48 | <target name="compile-resources">
|
---|
49 | <if><bool><istrue value="${execute}"/></bool>
|
---|
50 |
|
---|
51 | <if>
|
---|
52 | <bool>
|
---|
53 | <not>
|
---|
54 | <uptodate targetfile="${basedir}/wrapped-installer/build/wrapper.RES">
|
---|
55 | <srcfiles dir="${wirk3.home}/icon" includes="gs3.ico"/>
|
---|
56 | <srcfiles dir="${wirk3.home}/wrapper" includes="${java.installer}"/>
|
---|
57 | <srcfiles dir="${wirk3.home}/wrapper" includes="*.bmp"/>
|
---|
58 | <srcfiles dir="${wirk3.home}/wrapper" includes="*.rc"/>
|
---|
59 | <srcfiles dir="${basedir}/installer" includes="greenstone3.jar"/>
|
---|
60 | </uptodate>
|
---|
61 | </not>
|
---|
62 | </bool>
|
---|
63 |
|
---|
64 | <echo>Compiling resources</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>
|
---|
70 | <copy todir="${basedir}/wrapped-installer/build">
|
---|
71 | <fileset dir="${wirk3.home}/wrapper" includes="*.bmp"/>
|
---|
72 | <fileset dir="${wirk3.home}/icon" includes="gs3.ico"/>
|
---|
73 | </copy>
|
---|
74 |
|
---|
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>
|
---|
86 | <exec executable="rc" dir="${basedir}/wrapped-installer/build">
|
---|
87 | <arg line="wrapper.rc"/>
|
---|
88 | </exec>
|
---|
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 | />
|
---|
102 |
|
---|
103 | <echo>resource compiling the generated resource script again</echo>
|
---|
104 | <exec executable="rc" dir="${basedir}/wrapped-installer/build">
|
---|
105 | <arg line="wrapper-with-jre.rc"/>
|
---|
106 | </exec>
|
---|
107 |
|
---|
108 | <else>
|
---|
109 | <echo>Resourses are up-to-date, will not compile</echo>
|
---|
110 | </else>
|
---|
111 | </if>
|
---|
112 |
|
---|
113 |
|
---|
114 | </if>
|
---|
115 | </target>
|
---|
116 |
|
---|
117 | <target name="compile-wrapper">
|
---|
118 | <if><bool><istrue value="${execute}"/></bool>
|
---|
119 |
|
---|
120 | <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">
|
---|
125 | <arg line="/c -GX /DWINDOWS=yes wrapper.cpp /out:wrapper.obj"/>
|
---|
126 | </exec>
|
---|
127 |
|
---|
128 | </if>
|
---|
129 | </target>
|
---|
130 |
|
---|
131 | <target name="link-wrapper-no-java">
|
---|
132 | <if><bool><istrue value="${execute}"/></bool>
|
---|
133 | <exec executable="link" dir="${basedir}/wrapped-installer/build">
|
---|
134 | <arg line="/OUT:..\greenstone-${version}-win32.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/>
|
---|
135 | </exec>
|
---|
136 | </if>
|
---|
137 | </target>
|
---|
138 |
|
---|
139 | <target name="link-wrapper-with-java">
|
---|
140 | <if><bool><istrue value="${execute}"/></bool>
|
---|
141 | <exec executable="link" dir="${basedir}/wrapped-installer/build">
|
---|
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"/>
|
---|
143 | </exec>
|
---|
144 | </if>
|
---|
145 | </target>
|
---|
146 |
|
---|
147 | </project>
|
---|