source: release-kits/shared/greenstone3/ant-scripts/rk3-targets.xml@ 20115

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

limit use of static flag to lirk3

File size: 9.0 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!--
3 ..........................................................
4 August 2008
5 Targets for Greenstone3 release kits
6 Oran Fry
7 ..........................................................
8-->
9
10<project name="rk3-targets">
11
12 <property name="version.major" value="3"/>
13
14 <!-- create the property set to be forwarded to greenstone3 -->
15 <propertyset id="forward.properties">
16 <propertyref prefix="forward."/>
17 <mapper type="glob" from="forward.*" to="*"/>
18 <propertyref name="app.version"/>
19 <propertyref name="branch.path"/>
20 <propertyref name="branch.revision"/>
21 </propertyset>
22
23 <target name="greenstone3-set-version-numbers">
24 <rsr
25 file="${greenstone3basedir}/resources/java/global.properties.in"
26 pattern="@gsdl3version@"
27 replacement="${version}" />
28 </target>
29
30 <target name="gs3-init">
31
32 <!-- don't let greenstone3 block and wait for user input to accept
33 the properties for the build -->
34 <property name="forward.properties.accepted" value="true"/>
35
36 <!-- make sure all c++ compilation is done statically on linux -->
37 <if><bool><equals arg1="${rk.os}" arg2="linux"></bool>
38 <property name="forward.compile.static" value="true"/>
39 </if>
40
41 <!-- show the property set to be forwarded to greenstone3 -->
42 <echo>Properties to be forwarded to greenstone3 build</echo>
43 <echoproperties><propertyset refid="forward.properties"/></echoproperties>
44
45 </target>
46
47 <target name="insert-uninstaller-jar">
48 <copy file="compiled/uninst.jar" tofile="distributions/web/uninst.jar"/>
49 </target>
50
51 <!--
52 inserts a copy of the release kit's own ant into the greenstone3
53 installation. the ant from the release kit is minified so is a good choice.
54 -->
55 <target name="insert-ant">
56
57 <!-- remove any existing ant -->
58 <delete dir="compiled/packages/ant"/>
59
60 <!-- windows copy -->
61 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
62 <copy todir="compiled/packages">
63 <fileset dir="${rk.home}/core" includes="ant/**/*"/>
64 </copy>
65
66 <!-- linux, mac copy-->
67 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
68 <exec executable="cp">
69 <arg value="-r"/>
70 <arg value="${rk.home}/core/ant"/>
71 <arg value="compiled/packages"/>
72 </exec>
73
74 <!-- otherwise fail -->
75 <else>
76 <fail>this target does not support the current os</fail>
77
78 </else></if></else></if>
79
80 </target>
81
82 <target name="generate-build-properties">
83 <copy file="${greenstone3.basedir}/build.properties.in" tofile="${greenstone3.basedir}/build.properties"/>
84 <if><bool><istrue value="${install.flax}"/></bool>
85 <rsr file="${greenstone3.basedir}/build.properties" pattern="^#install.flax\s*[=:].*" replacement="install.flax=true"/>
86 </if>
87 <if><bool><isset property="server.default.servlet"/></bool>
88 <rsr file="${greenstone3.basedir}/build.properties" pattern="^#?server.default.servlet\s*[=:].*" replacement="server.default.servlet=${server.default.servlet}"/>
89 </if>
90 </target>
91
92 <target name="checkout-greenstone3">
93 <svn>
94 <checkout url="${svn.root}/greenstone3/${branch.path}" destPath="compiled" revision="${branch.revision}"/>
95 <!-- <checkout url="${svn.root}/gli/${branch.path}" destPath="compiled/gli" revision="${branch.revision}"/> -->
96 </svn>
97 </target>
98
99 <target name="export-greenstone3">
100 <svn>
101 <export srcUrl="${svn.root}/greenstone3/${branch.path}" destPath="${dest}" revision="${branch.revision}"/>
102 </svn>
103 </target>
104
105 <target name="insert-xml-parser">
106 <copy todir="compiled/gs2build/perllib/cpan">
107 <fileset dir="${rk.home}/greenstone3" includes="XML-Parser/**/*"/>
108 </copy>
109 </target>
110
111 <target name="insert-documented-examples">
112 <echo>NOT IMPLEMENTED: Remember to put code in this target to grab and install the documented examples.</echo>
113 <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
114 </target>
115
116 <target name="prepare-documentation">
117
118 <mkdir dir="compiled/gsdl-manuals"/>
119 <svn>
120 <checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="compiled/gsdl-manuals/manuals"/>
121 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="compiled/gsdl-manuals/shared"/>
122 </svn>
123 <path id="documentation.compile.classpath">
124 <fileset dir="compiled/gsdl-manuals">
125 <include name="**/*.jar"/>
126 </fileset>
127 <pathelement path="compiled/gsdl-manuals/shared"/>
128 <pathelement path="compiled/gsdl-manuals/manuals"/>
129 </path>
130 <javac srcdir="compiled/gsdl-manuals/shared"
131 destdir="compiled/gsdl-manuals/shared"
132 debug="on"
133 classpathref="documentation.compile.classpath">
134 <include name="*.java"/>
135 </javac>
136 <unzip src="compiled/gsdl-manuals/shared/fop.zip" dest="compiled/gsdl-manuals/shared"/>
137
138 <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="compiled/gsdl-manuals/manuals/xml-source/en/help-en.xml">
139 <arg value="compiled/gsdl-manuals/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
140 <arg value="compiled/gli/help/en/help.xml" />
141 <arg value="compiled" />
142 </java>
143
144 <chmod perm="a+x" file="compiled/gsdl-manuals/shared/fop/fop.sh"/>
145 <echo>Run generate-pdf script</echo>
146 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
147 <exec dir="compiled/gsdl-manuals/manuals" executable="cmd">
148 <arg value="/C" />
149 <arg file="${basedir}/compiled/gsdl-manuals/manuals/generate-pdf.bat" />
150 <arg value="u" />
151 <arg value="en" />
152 </exec>
153 <else>
154 <exec dir="compiled/gsdl-manuals/manuals" executable="/bin/bash">
155 <arg line="generate-pdf.sh u en" />
156 </exec>
157 </else></if>
158 </target>
159
160 <target name="clean">
161 <antcall target="clean-compiled"/>
162 <antcall target="clean-distributions"/>
163 <antcall target="clean-components"/>
164 <antcall target="clean-installer"/>
165 <antcall target="clean-wrapped-installer"/>
166 </target>
167
168 <target name="clean-compiled">
169 <delete dir="compiled"/>
170 </target>
171
172 <target name="clean-distribution">
173 <delete dir="distributions"/>
174 </target>
175
176 <target name="clean-components">
177 <delete dir="components"/>
178 </target>
179
180 <target name="clean-installer">
181 <delete dir="installer"/>
182 </target>
183
184 <target name="clean-wrapped-installer">
185 <delete dir="wrapped-installer"/>
186 </target>
187
188 <target name="copy-greenstone3-installer-files">
189
190 <!-- the installer descriptors -->
191 <copy todir="installer" file="${rk.home}/greenstone3/installer/antinstall-config.xml" overwrite="true"/>
192 <copy todir="installer" file="${rk.home}/greenstone3/installer/build.xml" overwrite="true"/>
193
194 </target>
195
196 <target name="clean-user-manual">
197 <copy file="distributions/web/gsdl-manuals/manuals/build/en/pdf/User_en.pdf" tofile="distributions/web/docs/manual/gs2_user_en.pdf"/>
198 <delete dir="distributions/web/gsdl-manuals"/>
199 </target>
200
201 <target name="clean-uninstaller">
202 <delete dir="distributions/web/uninstaller"/>
203 </target>
204
205
206 <!-- prepare the component named in ${component} -->
207 <target name="prepare-component">
208 <mkdir dir="components"/>
209 <zip destfile="components/${component}.comp" compress="false">
210 <zipfileset dir="distributions/web">
211 <patternset refid="greenstone3.${component}.component"/>
212 </zipfileset>
213 </zip>
214 </target>
215
216 <target name="compress-component">
217 <!-- windows -->
218 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
219 <exec executable="${rk.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 ${component}.lzma ${component}.comp"/></exec>
220
221 <!-- linux, mac -->
222 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
223 <sevenzip task="encode" input="components/${component}.comp" output="components/${component}.lzma" dictionnary="26"/>
224
225 <!-- else warn -->
226 <else>
227 <fail>this target does not support this os (was a new release-kit os added?)</fail>
228
229 </else></if></else></if>
230 </target>
231
232 <target name="greenstone3-compile">
233 <antcall target="checkout-greenstone3" />
234 <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
235 <ant dir="compiled" inheritAll="false">
236 <target name="prepare"/>
237 <propertyset refid="forward.properties"/>
238 </ant>
239 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli" /></antcall>
240 <ant dir="compiled" inheritAll="false">
241 <target name="install"/>
242 <target name="dist-tidy"/>
243 <propertyset refid="forward.properties"/>
244 </ant>
245 <antcall target="insert-xml-parser"/>
246 <antcall target="insert-ant"/>
247 <antcall target="insert-documented-examples"/>
248 <antcall target="compile-uninstaller" /> <!-- from rk3-targets -->
249 <antcall target="prepare-documentation"/> <!-- from rk3-targets -->
250 </target>
251
252 <target name="greenstone3-create-distribution">
253 <!-- create distribution -->
254 <antcall target="copy-compiled-to-dist"/> <!-- from init -->
255 <antcall target="insert-uninstaller"/>
256 <antcall target="clean-user-manual"/>
257 <antcall target="clean-uninstaller"/>
258 <antcall target="strip-svn-dirs"><param name="dir" value="distributions"/></antcall> <!-- from init -->
259 </target>
260
261
262</project>
Note: See TracBrowser for help on using the repository browser.