source: main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml@ 24146

Last change on this file since 24146 was 24146, checked in by sjm84, 10 years ago

Upgraded this release kit to the new way of expressing versions (post.2.83.version)

File size: 18.3 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!--
3 ..........................................................
4 March 2009
5 CD Release Kit for Greenstone2 (cdrk2)
6 Oran Fry
7 ..........................................................
8 -->
9
10<project name="cdrk2-build" default="cdrk2">
11
12 <!-- IMPORT OTHER ANT SCRIPTS -->
13 <import file="${rk.home}/shared/core/ant-scripts/shared.xml"/>
14 <import file="${rk.home}/shared/greenstone2/ant-scripts/greenstone2-shared.xml"/>
15
16 <!-- THE MAIN TARGET -->
17 <target name="cdrk2" depends="init">
18
19 <property name="linux.file" value="null"/>
20 <property name="mac.file" value="null"/>
21 <property name="windows.file" value="null"/>
22 <property name="doc.file" value="null"/>
23
24 <if><bool><not><equals arg1="${linux.file}" arg2="null"/></not></bool>
25 <property name="software.archive.linux" value="file://${linux.file}"/>
26 </if>
27
28 <if><bool><not><equals arg1="${mac.file}" arg2="null"/></not></bool>
29 <property name="software.archive.mac" value="file://${mac.file}"/>
30 </if>
31
32 <if><bool><not><equals arg1="${windows.file}" arg2="null"/></not></bool>
33 <property name="software.archive.windows" value="file://${windows.file}"/>
34 </if>
35
36 <if><bool><not><equals arg1="${doc.file}" arg2="null"/></not></bool>
37 <property name="software.archive.documented-examples" value="file://${doc.file}"/>
38 </if>
39
40 <!-- figure out where the compiled software is coming from -->
41 <property name="software.archive.linux" value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-linux.tar.gz"/>
42 <property name="software.archive.windows" value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-windows.tar.gz"/>
43 <property name="software.archive.mac" value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-mac.tar.gz"/>
44 <property name="software.archive.documented-examples" value="http://www.greenstone.org/caveat-emptor/Greenstone-documented-examples-${date}.tar.gz"/>
45
46 <!-- show the properties we're using -->
47 <if><bool><not><equals arg1="${no.linux}" arg2="true"/></not></bool>
48 <echo message="software.archive.linux: ${software.archive.linux}"/>
49 </if>
50
51 <if><bool><not><equals arg1="${no.windows}" arg2="true"/></not></bool>
52 <echo message="software.archive.windows: ${software.archive.windows}"/>
53 </if>
54
55 <if><bool><not><equals arg1="${no.mac}" arg2="true"/></not></bool>
56 <echo message="software.archive.mac: ${software.archive.mac}"/>
57 </if>
58
59 <if><bool><not><equals arg1="${no.doc}" arg2="true"/></not></bool>
60 <echo message="software.archive.documented-examples: ${software.archive.documented-examples}"/>
61 </if>
62
63 <!-- create a directory for the cdrom contents -->
64 <mkdir dir="cdrom"/>
65
66 <!-- checkout and compile documentation java/fop code -->
67 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
68 <exec executable="svn">
69 <arg value="export"/>
70 <arg value="${svn.root}/documentation/${branch.path}/shared"/>
71 <arg value="documentation/shared"/>
72 </exec>
73
74 <else>
75 <exec executable="svn">
76 <arg value="export"/>
77 <arg value="${svn.root}/main/${branch.path}/documentation/shared"/>
78 <arg value="documentation/shared"/>
79 </exec>
80 </else>
81 </if>
82
83 <javac srcdir="documentation/shared" destdir="documentation/shared" debug="on" classpath="documentation/shared/xalan.jar">
84 <include name="*.java"/>
85 </javac>
86
87 <!-- checkout tutorials and build them -->
88 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
89 <exec executable="svn">
90 <arg value="checkout"/>
91 <arg value="${svn.root}/documentation/${branch.path}/tutorials"/>
92 <arg value="documentation/tutorials"/>
93 </exec>
94 <exec executable="svn">
95 <arg value="checkout"/>
96 <arg value="${svn.root}/main/${branch.path}/gli"/>
97 <arg value="documentation/gli"/>
98 </exec>
99 <exec executable="svn">
100 <arg value="checkout"/>
101 <arg value="${svn.root}/main/${branch.path}/greenstone2/perllib"/>
102 <arg value="documentation/perllib"/>
103 </exec>
104 <exec executable="svn">
105 <arg value="checkout"/>
106 <arg value="${svn.root}/main/${branch.path}/greenstone2/macros"/>
107 <arg value="documentation/macros"/>
108 </exec>
109 <exec executable="svn">
110 <arg value="checkout"/>
111 <arg value="${svn.root}/documentation/${branch.path}/tutorial_sample_files"/>
112 <arg value="documentation/tutorial_sample_files"/>
113 </exec>
114
115 <else>
116 <exec executable="svn">
117 <arg value="checkout"/>
118 <arg value="${svn.root}/main/${branch.path}/documentation/tutorials"/>
119 <arg value="documentation/tutorials"/>
120 </exec>
121 <exec executable="svn">
122 <arg value="checkout"/>
123 <arg value="${svn.root}/main/${branch.path}/gli"/>
124 <arg value="documentation/gli"/>
125 </exec>
126 <exec executable="svn">
127 <arg value="checkout"/>
128 <arg value="${svn.root}/main/${branch.path}/gsdl/perllib"/>
129 <arg value="documentation/perllib"/>
130 </exec>
131 <exec executable="svn">
132 <arg value="checkout"/>
133 <arg value="${svn.root}/main/${branch.path}/gsdl/macros"/>
134 <arg value="documentation/macros"/>
135 </exec>
136 <exec executable="svn">
137 <arg value="checkout"/>
138 <arg value="${svn.root}/main/${branch.path}/documentation/tutorial_sample_files"/>
139 <arg value="documentation/tutorial_sample_files"/>
140 </exec>
141 </else>
142 </if>
143
144 <delete dir="documentation/tutorials/html"/>
145 <exec dir="documentation/tutorials" executable="/bin/bash">
146 <arg value="generate-html.sh"/>
147 <env key="GSDLHOME" value="${basedir}/documentation"/>
148 </exec>
149 <delete dir="cdrom/Tutorial Exercises"/>
150 <mkdir dir="cdrom/Tutorial Exercises/sample_files"/>
151
152 <!-- copy tutorial html into place on the cd -->
153 <copy todir="cdrom/Tutorial Exercises/English"><fileset dir="documentation/tutorials/html/en"/></copy>
154 <copy todir="cdrom/Tutorial Exercises/French"><fileset dir="documentation/tutorials/html/fr"/></copy>
155 <copy todir="cdrom/Tutorial Exercises/Spanish"><fileset dir="documentation/tutorials/html/es"/></copy>
156 <copy todir="cdrom/Tutorial Exercises/Russian"><fileset dir="documentation/tutorials/html/ru"/></copy>
157
158 <!-- create tutorial sample files zips in place on the cdrom -->
159 <copy todir="cdrom/Tutorial Exercises/sample_files">
160 <fileset dir="documentation/tutorial_sample_files"/>
161 </copy>
162
163 <!--<zip destfile="cdrom/Tutorial Exercises/sample_files/beatles.zip" basedir="documentation/tutorial_sample_files/beatles"/>
164 <zip destfile="cdrom/Tutorial Exercises/sample_files/custom.zip" basedir="documentation/tutorial_sample_files/custom"/>
165 <zip destfile="cdrom/Tutorial Exercises/sample_files/demo_NewFiles.zip" basedir="documentation/tutorial_sample_files/demo_NewFiles"/>
166 <zip destfile="cdrom/Tutorial Exercises/sample_files/dspace.zip" basedir="documentation/tutorial_sample_files/dspace"/>
167 <zip destfile="cdrom/Tutorial Exercises/sample_files/images.zip" basedir="documentation/tutorial_sample_files/images"/>
168 <zip destfile="cdrom/Tutorial Exercises/sample_files/isis.zip" basedir="documentation/tutorial_sample_files/isis"/>
169 <zip destfile="cdrom/Tutorial Exercises/sample_files/marc.zip" basedir="documentation/tutorial_sample_files/marc"/>
170 <zip destfile="cdrom/Tutorial Exercises/sample_files/niupepa.zip" basedir="documentation/tutorial_sample_files/niupepa"/>
171 <zip destfile="cdrom/Tutorial Exercises/sample_files/oai.zip" basedir="documentation/tutorial_sample_files/oai"/>
172 <zip destfile="cdrom/Tutorial Exercises/sample_files/simple_html.zip" basedir="documentation/tutorial_sample_files/simple_html"/>
173 <zip destfile="cdrom/Tutorial Exercises/sample_files/tudor.zip" basedir="documentation/tutorial_sample_files/tudor"/>
174 <zip destfile="cdrom/Tutorial Exercises/sample_files/Word_and_PDF.zip" basedir="documentation/tutorial_sample_files/Word_and_PDF"/>-->
175
176 <!-- checkout manuals and build them -->
177 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
178 <exec executable="svn">
179 <arg value="checkout"/>
180 <arg value="${svn.root}/documentation/${branch.path}/manuals"/>
181 <arg value="documentation/manuals"/>
182 </exec>
183 <exec executable="svn">
184 <arg value="checkout"/>
185 <arg value="${svn.root}/documentation/${branch.path}/shared"/>
186 <arg value="documentation/shared"/>
187 </exec>
188 <else>
189 <exec executable="svn">
190 <arg value="checkout"/>
191 <arg value="${svn.root}/main/${branch.path}/documentation/manuals"/>
192 <arg value="documentation/manuals"/>
193 </exec>
194 <exec executable="svn">
195 <arg value="checkout"/>
196 <arg value="${svn.root}/main/${branch.path}/documentation/shared"/>
197 <arg value="documentation/shared"/>
198 </exec>
199 </else>
200 </if>
201
202 <exec executable="svn">
203 <arg value="checkout"/>
204 <arg value="${svn.root}/main/${branch.path}/gli"/>
205 <arg value="documentation/gli"/>
206 </exec>
207
208 <unzip src="documentation/shared/fop.zip" dest="documentation/shared"/>
209 <chmod perm="a+x" file="documentation/shared/fop/fop.sh"/>
210
211 <antcall target="generate-gli-chapter"><param name="language" value="en"/></antcall>
212 <antcall target="generate-gli-chapter"><param name="language" value="fr"/></antcall>
213 <antcall target="generate-gli-chapter"><param name="language" value="es"/></antcall>
214 <antcall target="generate-gli-chapter"><param name="language" value="ru"/></antcall>
215
216 <delete dir="documentation/manuals/build"/>
217 <exec dir="documentation/manuals" executable="/bin/bash">
218 <arg value="generate-pdf.sh"/>
219 <arg value="all"/>
220 <arg value="en es ru fr"/>
221 </exec>
222
223 <exec spawn="true" dir="documentation/manuals" executable="/bin/bash">
224 <arg value="generate-pdf.sh"/>
225 <arg value="Install"/>
226 <arg value="ar"/>
227 </exec>
228
229 <!-- put manuals in place on cdrom -->
230 <delete dir="cdrom/Documentation"/>
231 <copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
232 <copy todir="cdrom/Documentation/French"><fileset dir="documentation/manuals/build/fr/pdf"/></copy>
233 <copy todir="cdrom/Documentation/Spanish"><fileset dir="documentation/manuals/build/es/pdf"/></copy>
234 <copy todir="cdrom/Documentation/Russian"><fileset dir="documentation/manuals/build/ru/pdf"/></copy>
235 <copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
236
237 <!-- top off manuals with a few more from the web -->
238 <antcall target="get-doc"><param name="docsrc" value="http://wiki.greenstone.org/wiki/gsdoc/others/CDS-ISIS_to_DL.pdf"/><param name="docdest" value="cdrom/Documentation/English/CDS-ISIS_to_DL.pdf"/></antcall>
239 <antcall target="get-doc"><param name="docsrc" value="http://www.greenstone.org/docs/inside_greenstone.pdf"/><param name="docdest" value="cdrom/Documentation/English/inside_greenstone.pdf"/></antcall>
240 <antcall target="get-doc"><param name="docsrc" value="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Users_Guide_Arabic.doc"/><param name="docdest" value="cdrom/Documentation/Arabic/Users_Guide_Arabic.doc"/></antcall>
241 <antcall target="get-doc"><param name="docsrc" value="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Install_ar.pdf"/><param name="docdest" value="cdrom/Documentation/Arabic/Install_ar.pdf"/></antcall>
242
243 <mkdir dir="cdrom/Documentation/Brazilian Portuguese"/>
244 <antcall target="get-doc"><param name="docsrc" value="http://www.greenstone.org/manuals/gsdl2/pt-br/pdf/Install_pt-br.pdf"/><param name="docdest" value="cdrom/Documentation/Brazilian Portuguese/Install_pt-br.pdf"/></antcall>
245
246 <mkdir dir="cdrom/Documentation/Vietnamese"/>
247 <antcall target="get-doc">
248 <param name="docsrc" value="http://ftp.heanet.ie/disk1/sourceforge/g/project/gr/greenstone/OldFiles/Install-2.39-vi.pdf"/>
249 <param name="docdest" value="cdrom/Documentation/Vietnamese/Install-2.39-vi.pdf"/>
250 </antcall>
251 <antcall target="get-doc">
252 <param name="docsrc" value="http://ftp.heanet.ie/disk1/sourceforge/g/project/gr/greenstone/OldFiles/User-2.39-vi.pdf"/>
253 <param name="docdest" value="cdrom/Documentation/Vietnamese/User-2.39-vi.pdf"/>
254 </antcall>
255 <antcall target="get-doc">
256 <param name="docsrc" value="http://ftp.heanet.ie/disk1/sourceforge/g/project/gr/greenstone/OldFiles/Paper-2.39-vi.pdf"/>
257 <param name="docdest" value="cdrom/Documentation/Vietnamese/Paper-2.39-vi.pdf"/>
258 </antcall>
259
260 <mkdir dir="cdrom/Documentation/Kazakh"/>
261 <antcall target="get-doc">
262 <param name="docsrc" value="http://ftp.heanet.ie/disk1/sourceforge/g/project/gr/greenstone/OldFiles/Install-2.39-kz.pdf"/>
263 <param name="docdest" value="cdrom/Documentation/Kazakh/Install-2.39-kz.pdf"/>
264 </antcall>
265 <antcall target="get-doc">
266 <param name="docsrc" value="http://ftp.heanet.ie/disk1/sourceforge/g/project/gr/greenstone/OldFiles/User-2.39-kz.pdf"/>
267 <param name="docdest" value="cdrom/Documentation/Kazakh/User-2.39-kz.pdf"/>
268 </antcall>
269 <antcall target="get-doc">
270 <param name="docsrc" value="http://ftp.heanet.ie/disk1/sourceforge/g/project/gr/greenstone/OldFiles/Paper-2.39-kz.pdf"/>
271 <param name="docdest" value="cdrom/Documentation/Kazakh/Paper-2.39-kz.pdf"/>
272 </antcall>
273
274 <!-- insert the documented examples onto cdrom -->
275 <if><bool><not><equals arg1="${no.doc}" arg2="true"/></not></bool>
276 <mkdir dir="archives"/>
277 <get src="${software.archive.documented-examples}" dest="archives/documented-examples.zip"/>
278 <delete dir="cdrom/Documented Examples"/>
279 <copy toDir="cdrom">
280 <fileset dir="archives">
281 <include name="documented-examples.zip"/>
282 </fileset>
283 </copy>
284 <!--<exec executable="tar" dir="cdrom/Documented Examples"><arg value="-xzf"/><arg value="../../archives/documented-examples.tar.gz"/></exec>-->
285 </if>
286
287 <!-- insert readmes -->
288 <copy todir="cdrom"><fileset dir="${rk.home}/shared/greenstone2/docs"/></copy>
289 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
290
291 <!-- insert linux software -->
292 <if><bool><not><equals arg1="${no.linux}" arg2="true"/></not></bool>
293 <mkdir dir="cdrom"/>
294 <mkdir dir="archives"/>
295 <get src="${software.archive.linux}" dest="archives/linux.tar.gz"/>
296 <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/linux.tar.gz"/></exec>
297 </if>
298
299 <!-- insert windows software -->
300 <if><bool><not><equals arg1="${no.windows}" arg2="true"/></not></bool>
301 <mkdir dir="cdrom"/>
302 <mkdir dir="archives"/>
303 <get src="${software.archive.windows}" dest="archives/windows.tar.gz"/>
304 <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/windows.tar.gz"/></exec>
305 </if>
306
307 <!-- insert mac software -->
308 <if><bool><not><equals arg1="${no.mac}" arg2="true"/></not></bool>
309 <mkdir dir="cdrom"/>
310 <mkdir dir="archives"/>
311 <get src="${software.archive.mac}" dest="archives/mac.tar.gz"/>
312 <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/mac.tar.gz"/></exec>
313 </if>
314
315 <!-- create autorun (windows) -->
316 <exec executable="cp">
317 <arg value="${rk.home}/kits/${rk.name}/resources/AUTORUN.INF"/>
318 <arg value="cdrom"/>
319 </exec>
320
321 <!-- finally create the cdrom image -->
322 <mkdir dir="products"/>
323 <exec executable="mkisofs">
324 <arg value="-V"/>
325 <arg value="Greenstone-${version}"/>
326 <arg value="-input-charset"/>
327 <arg value="utf-8"/>
328 <arg value="-o"/>
329 <arg value="products/Greenstone-${version}-cdrom.iso"/>
330 <arg value="-J"/>
331 <arg value="-R"/>
332 <arg value="-D"/>
333 <arg value="cdrom"/>
334 </exec>
335 <exec executable="/bin/bash" dir="products">
336 <arg value="-c"/>
337 <arg value="cat Greenstone-${version}-cdrom.iso | gzip > Greenstone-${version}-cdrom.iso.gz"/>
338 </exec>
339 <exec executable="/bin/bash" dir="products">
340 <arg value="-c"/>
341 <arg value="zip Greenstone-${version}-cdrom.zip Greenstone-${version}-cdrom.iso"/>
342 </exec>
343 </target>
344
345 <target name="properties" depends="core-properties">
346 <echo>no.linux (optional) specifies that this cd should not use files from the linux distribution</echo>
347 <echo>no.windows (optional) specifies that this cd should not use files from the windows distribution</echo>
348 <echo>no.mac (optional) specifies that this cd should not use files from the mac distribution</echo>
349 <echo>no.doc (optional) specifies that this cd should not use the documented examples</echo>
350 <echo>linux.file (optional) use this if you would like to specify a file path to the linux software archive rather than a URL</echo>
351 <echo>windows.file (optional) use this if you would like to specify a file path to the windows software archive rather than a URL</echo>
352 <echo>mac.file (optional) use this if you would like to specify a file path to the mac software archive rather than a URL</echo>
353 <echo>doc.file (optional) use this if you would like to specify a file path to the documented examples software archive rather than a URL</echo>
354 <echo>software.archive.linux (optional) the URL to the linux archive of components</echo>
355 <echo>software.archive.windows (optional) the URL to the windows archive of components</echo>
356 <echo>software.archive.mac (optional) the URL to the mac archive of components</echo>
357 <echo>software.archive.documented-examples (optional) the URL to the archive of documented examples</echo>
358 </target>
359
360 <!-- target to generate the manual chapter about gli in a given language -->
361 <target name="generate-gli-chapter">
362 <path id="documentation.compile.classpath">
363 <fileset dir="documentation">
364 <include name="**/*.jar"/>
365 </fileset>
366 <pathelement path="documentation/gli/classes"/>
367 <pathelement path="documentation/shared"/>
368 <pathelement path="documentation/manuals"/>
369 </path>
370 <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="documentation/manuals/xml-source/${language}/help-${language}.xml">
371 <arg value="${language}" />
372 <arg value="documentation/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
373 <arg value="documentation/gli/help/${language}/help.xml" />
374 <arg value="compiled" />
375 </java>
376 <copy file="documentation/manuals/xml-source/${language}/help-${language}.xml" todir="documentation/manuals"/>
377 </target>
378
379 <target name="get-doc">
380 <try>
381 <get src="${docsrc}" dest="${docdest}"/>
382 <catch>
383 </catch>
384 </try>
385 </target>
386</project>
Note: See TracBrowser for help on using the repository browser.