source: other-projects/trunk/gs2-release-maker/build.xml@ 14826

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

various changes

File size: 54.6 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2
3<!--
4 ..........................................................
5 September 2007
6 Greenstone2 'release maker' script
7 Oran Fry
8 ..........................................................
9-->
10
11<project name="gs2-release-maker" default="help">
12
13 <!-- classpath -->
14 <path id="project.classpath">
15 <fileset dir="tasks">
16 <include name="**/*.jar"/>
17 </fileset>
18 <fileset dir="lib">
19 <include name="*.jar"/>
20 </fileset>
21 <pathelement path="tasks/orans"/>
22 </path>
23
24 <!-- svn root -->
25 <property name="svn.root" value="http://svn.greenstone.org"/>
26
27 <!-- self defined tasks -->
28 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
29 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
30 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
31 <taskdef name="setloglevel" classname="SetLogLevel" classpathref="project.classpath"/>
32 <typedef name="addressedcall" classname="TreeCallTarget" classpathref="project.classpath"/>
33 <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
34 <taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.SCP" classpathref="project.classpath"/>
35 <taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.SSHExec" classpathref="project.classpath"/>
36
37
38 <!-- load in static properties from build.properties -->
39 <property file="build.properties" />
40
41 <!-- stuff to do before all tasks -->
42 <target name="init">
43
44 <echo level="info">CHECKING PRE-CONDITIONS</echo>
45 <echo level="info"/>
46
47 <!-- version number -->
48 <echo level="info">Checking if version number is set...</echo>
49 <if>
50 <bool>
51 <or>
52 <not><isset property="version"/></not>
53 <not><isset property="version.minor"/></not>
54 </or>
55 </bool>
56 <echo level="error">No, not set</echo>
57 <echo level="error">Please specify a version number</echo>
58 <echo level="error">E.g., ant -Dversion=3.03 -Dversion.minor=03 create-release</echo>
59 <echo level="error">or, ant -Dversion=trunk -Dversion.minor=03 create-release</echo>
60 <fail>Version number not set</fail>
61 </if>
62 <echo level="info">Version number: ${version}</echo>
63 <property name="app.version" value="${version}"/>
64 <echo level="info"/>
65
66 <!-- where to put the release -->
67 <echo level="info">Determining where to put the release...</echo>
68 <if>
69 <bool>
70 <or>
71 <not><isset property="release.dir"/></not>
72 <not><isset property="mac.release.dir"/></not>
73 <not><isset property="windows.release.dir"/></not>
74 </or>
75
76 </bool>
77 <echo level="error">No release directory specified.</echo>
78 <echo level="error">Please specify release directory on the command line.</echo>
79 <echo level="error">E.g., ant -Drelease.dir=/research/me/releases/3.03 -Dmac.release.dir=/Users/me/releases/3.03 -Dwindows.release.dir=c:\research\me\releases\3.03 create-release</echo>
80 <fail>Release directorys not set</fail>
81 </if>
82 <echo level="info">Release directory: ${release.dir}</echo>
83 <echo level="info">Mac release directory: ${mac.release.dir}</echo>
84 <echo level="info">Windows release directory: ${windows.release.dir}</echo>
85 <echo level="info"/>
86
87 <!-- check start from -->
88 <echo level="info">Checking if we are resuming from a given target...</echo>
89 <if>
90 <bool>
91 <not><isset property="resume.from"/></not>
92 </bool>
93 <echo level="info">No, start from the beginning</echo>
94 <property name="resume.from" value="1"/>
95 <else>
96 <echo level="info">Yes, resuming from ${resume.from}</echo>
97 </else>
98 </if>
99 <echo level="info"/>
100
101 <!-- check resume mode-->
102 <echo level="info">Determining resume mode...</echo>
103 <if>
104 <bool>
105 <not><isset property="resume.mode"/></not>
106 </bool>
107 <echo level="info">Mode not set, defaulting to 'fallthrough'</echo>
108 <property name="resume.mode" value="fallthrough"/>
109 <else>
110 <echo level="info">Mode set to ${resume.mode}</echo>
111 <if>
112 <bool>
113 <and>
114 <not><equals arg1="${resume.mode}" arg2="descend"/></not>
115 <not><equals arg1="${resume.mode}" arg2="fallthrough"/></not>
116 </and>
117 </bool>
118 <echo level="error">You have not specified a valid resume mode.</echo>
119 <echo level="error">Valid modes are 'fallthrough' and 'descend'.</echo>
120 <fail>You have not specified a valid resume mode.</fail>
121 </if>
122 </else>
123 </if>
124 <echo level="info"/>
125
126 <!-- check username and password -->
127 <echo level="info">Checking if username and password set...</echo>
128 <if>
129 <bool>
130 <not><isset property="username"/></not>
131 </bool>
132 <echo level="info">Not set</echo>
133 <fail>You have not specified a username for ssh</fail>
134 </if>
135 <echo level="info"/>
136
137 <!-- execute target code or just traverse tree -->
138 <echo level="info">Determining execute mode...</echo>
139 <if>
140 <bool>
141 <not><isset property="execute"/></not>
142 </bool>
143 <echo level="info">Execute not set, defaulting to 'true'</echo>
144 <property name="execute" value="true"/>
145 <else>
146 <echo level="info">Execute set to ${execute}</echo>
147 <if>
148 <bool>
149 <and>
150 <not><equals arg1="${execute}" arg2="true"/></not>
151 <not><equals arg1="${execute}" arg2="false"/></not>
152 </and>
153 </bool>
154 <echo level="error">You have not specified a valid value for execute.</echo>
155 <echo level="error">Valid values are 'true' and 'false'.</echo>
156 <fail>You have not specified a valid value for execute.</fail>
157 </if>
158 </else>
159 </if>
160
161 <echo level="info"/>
162
163
164 <!-- the trunk or a branch -->
165 <echo level="info">Determining the branch path...</echo>
166 <if>
167 <bool><not><isset property="branch.path"/></not></bool>
168 <if>
169 <bool>
170 <equals arg1="trunk" arg2="${version}"/>
171 </bool>
172 <property name="branch.path" value="trunk"/>
173 <else>
174 <property name="branch.path" value="branches/${version}"/>
175 </else>
176 </if>
177 </if>
178 <echo level="info">Branch Path: ${branch.path}</echo>
179 <echo level="info"/>
180
181 <!-- check branches exist -->
182 <property name="svn.gsdl" value="${svn.root}/gsdl/${branch.path}"/>
183 <property name="svn.gli" value="${svn.root}/gli/${branch.path}"/>
184 <property name="svn.indexers" value="${svn.root}/indexers/${branch.path}"/>
185 <property name="svn.documentation" value="${svn.root}/documentation/${branch.path}"/>
186
187 <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/>
188
189 <!-- gsdl branch -->
190 <echo level="info">Checking that ${svn.gsdl} exists...</echo>
191 <!-- try to put the html index of the location into the temp file -->
192 <setloglevel level="error"/>
193 <try>
194 <get src="${svn.gsdl}" dest="${temp.file}"/>
195 <catch>
196 <echo level="error">No, does not exist</echo>
197 <property name="svn.gsdl.unavailable" value="true"/>
198 </catch>
199 </try>
200 <setloglevel level="info"/>
201 <if>
202 <bool><not><istrue value="${svn.gsdl.unavailable}"/></not></bool>
203 <echo level="info">Yes, it exists</echo>
204 </if>
205
206 <!-- gli branch -->
207 <echo level="info">Checking that ${svn.gli} exists...</echo>
208 <setloglevel level="error"/>
209 <try>
210 <get src="${svn.gli}" dest="${temp.file}"/>
211 <catch>
212 <echo level="error">No, does not exist</echo>
213 <property name="svn.gli.unavailable" value="true"/>
214 </catch>
215 </try>
216 <setloglevel level="info"/>
217 <if>
218 <bool><not><istrue value="${svn.gli.unavailable}"/></not></bool>
219 <echo level="info">Yes, it exists</echo>
220 </if>
221
222
223 <!-- indexers branch -->
224 <echo level="info">Checking that ${svn.indexers} exists...</echo>
225 <setloglevel level="error"/>
226 <try>
227 <get src="${svn.indexers}" dest="${temp.file}"/>
228 <catch>
229 <echo level="error">No, it does not exist</echo>
230 <property name="svn.indexers.unavailable" value="true"/>
231 </catch>
232 </try>
233 <setloglevel level="info"/>
234 <if>
235 <bool><not><istrue value="${svn.indexers.unavailable}"/></not></bool>
236 <echo level="info">Yes, it exists</echo>
237 </if>
238
239 <!-- documentation branch -->
240 <echo level="info">Checking that ${svn.documentation} exists...</echo>
241 <setloglevel level="error"/>
242 <try>
243 <get src="${svn.documentation}" dest="${temp.file}"/>
244 <catch>
245 <echo level="error">No, it does not exist</echo>
246 <property name="svn.documentation.unavailable" value="true"/>
247 </catch>
248 </try>
249 <setloglevel level="info"/>
250 <if>
251 <bool><not><istrue value="${svn.documentation.unavailable}"/></not></bool>
252 <echo level="info">Yes, it exists</echo>
253 </if>
254
255 <!-- clean up the temp file -->
256 <setloglevel level="error"/>
257 <delete file="${temp.file}"/>
258 <setloglevel level="info"/>
259
260
261 <!-- fail if some branches were missing -->
262 <if>
263 <bool>
264 <or>
265 <istrue value="${svn.gsdl.unavailable}"/>
266 <istrue value="${svn.gli.unavailable}"/>
267 <istrue value="${svn.indexers.unavailable}"/>
268 <istrue value="${svn.documentation.unavailable}"/>
269 </or>
270 </bool>
271 <fail>Some branches do not exist, or you are unable to access them from where you are. Please review the list above and create any branches that are missing, or run this script from somewhere with access to the repository.</fail>
272 <else>
273 <echo level="info">All exist</echo>
274 </else>
275 </if>
276 <echo level="info"/>
277
278 <!-- get current month and year-->
279 <exec executable="date" outputproperty="current.month">
280 <arg value="+%b"/>
281 </exec>
282 <exec executable="date" outputproperty="current.year">
283 <arg value="+%Y"/>
284 </exec>
285 <echo level="info">Current Month: ${current.month}</echo>
286 <echo level="info">Current Year: ${current.year}</echo>
287
288 </target>
289
290 <target name="help">
291
292 <echo level="info">Usage: ant -Dversion=VERSION_NUMBER -Drelease.dir=RELEASEDIR -Dusername=USERNAME -Dpassword=PASSWORD -Dmac.release.dir=OUTPUT_DIRECTORY [-Dresume.from=TARGET_ADDRESS] [-Dresume.mode=MODE] create-release</echo>
293 <echo level="info"/>
294
295 <echo level="info">This project creates releases of Greenstone2 from the subversion repository given a version number.</echo>
296 <echo level="info"/>
297
298 <echo level="info">Each target in this project's target tree has been given an address, like so:</echo>
299 <echo level="info"/>
300 <echo level="info">root</echo>
301 <echo level="info"> |-1</echo>
302 <echo level="info"> | |-1.1</echo>
303 <echo level="info"> | |-1.2</echo>
304 <echo level="info"> |</echo>
305 <echo level="info"> |-2</echo>
306 <echo level="info"> | |-2.1</echo>
307 <echo level="info"> | |-2.2</echo>
308 <echo level="info"> etc.</echo>
309
310 <echo level="info"/>
311
312
313 <echo level="info">PARAMETERS</echo>
314 <echo level="info">Parameters are specifiable on the command line or in build.properties</echo>
315 <echo level="info">Parameters which remain static throughout the release process should be stores in build.properties:</echo>
316 <echo level="info">version, version.minor, release.dir, mac.release.dir, windows.release.dir, username</echo>
317 <echo level="info">Other parameters will change each time you invoke the script, specify them on the command line:</echo>
318 <echo level="info">resume.from, resume.mode</echo>
319
320
321
322 <echo level="info"/>
323
324 <echo level="info">version=VERSION_NUMBER, where VERSION_NUMBER={x.xx|trunk}</echo>
325 <echo level="info"/>
326 <echo level="info">This project can either create a release from a greenstone3 branch, or from the development trunk.</echo>
327 <echo level="info">To create a branch release, specify the VERSION_NUMBER (e.g., 3.03), and ensure that the following</echo>
328 <echo level="info">branches exist in the repository:</echo>
329 <echo level="info"> greenstone3/branches/VERSION_NUMBER</echo>
330 <echo level="info"> gli/branches/VERSION_NUMBER</echo>
331 <echo level="info"> indexers/branches/VERSION_NUMBER</echo>
332 <echo level="info"> documentation/branches/VERSION_NUMBER</echo>
333 <echo level="info">To create a trunk release, specify 'trunk' as the version number.</echo>
334 <echo level="info">The project will use the trunk of greenstone3, gli, indexers and documentation for the release.</echo>
335 <echo level="info"/>
336 <echo level="info"/>
337
338 <echo level="info">release.dir=RELEASE_DIRECTORY</echo>
339 <echo level="info"/>
340 <echo level="info">Specifies the directory in the filesystem where the release files will be kept.</echo>
341 <echo level="info"/>
342 <echo level="info"/>
343
344 <echo level="info">resume.from=TARGET_ADDRESS, where TARGET_ADDRESS=x.y.z (e.g., 2.1.3)</echo>
345 <echo level="info"/>
346 <echo level="info">Allows you to specify a target address from which execution will resume.</echo>
347 <echo level="info">This is helpful for restarting the script after it has failed part-way through.</echo>
348 <echo level="info">By default, execution starts from the root target (create-release) and proceeds downwards.</echo>
349 <echo level="info">You can specify a different target to start from by setting the resume.from parameter.</echo>
350 <echo level="info"/>
351 <echo level="info"/>
352
353 <echo level="info">resume.mode=RESUME_MODE, where RESUME_MODE={fallthrough|descend}</echo>
354 <echo level="info"/>
355 <echo level="info">fallthrough (default): In fallthrough mode, execution proceeds downwards through the target tree</echo>
356 <echo level="info">1 -> 1.1 -> 1.2 -> 2 -> 2.1 -> 2.2 -> 3 -> 3.1 and so on.</echo>
357 <echo level="info">descend: In descend mode, execution descends a single branch of the target tree.</echo>
358 <echo level="info">For example, if resume.from was set to '2', execution would proceed thus:</echo>
359 <echo level="info">2 -> 2.1 -> 2.2 (exit)</echo>
360 <echo level="info">This is helpful when you want to debug a particular target, or fix some conditions to allow it to finish</echo>
361 <echo level="info">properly, and don't want to run the whole script from the start.</echo>
362 <echo level="info"/>
363 <echo level="info"/>
364
365 <echo level="info">release.dir, mac.release.dir, windows.release.dir</echo>
366 <echo level="info"/>
367 <echo level="info">The full path to the directories where release files will be stored on</echo>
368 <echo level="info">linux(your machine), mac(shuttle) and windows(kohekohe).</echo>
369 <echo level="info">E.g., -Drelease.dir=/research/oranfry/releases/3.03</echo>
370 <echo level="info">E.g., -Dmac.release.dir=/Users/oranfry/releases/3.03</echo>
371 <echo level="info">E.g., -Dwindows.release.dir=c:\\research\\oranfry\\releases\\3.03</echo>
372 <echo level="info"/>
373 <echo level="info"/>
374
375 <echo level="info">username</echo>
376 <echo level="info"/>
377 <echo level="info">Your username for ssh from your machine to shuttle and kohekohe.</echo>
378 <echo level="info">You will be prompted for your password a number of times while the script executes.</echo>
379 <echo level="info"/>
380 <echo level="info"/>
381
382
383 </target>
384
385
386
387
388 <!-- ADDRESSED TARGETS -->
389
390 <!-- ROOT TARGET -->
391 <target name="create-release" depends="init">
392 <echo>Creating Release '${version}'</echo>
393 <addressedcall target="prep"/>
394 <addressedcall target="compile-binaries"/>
395 <addressedcall target="create-distribution"/>
396 <addressedcall target="create-installer-project"/>
397 <addressedcall target="build-installers"/>
398 </target>
399
400
401
402
403
404 <!-- FIRST LEVEL TARGETS -->
405 <target name="prep">
406 <addressedcall target="create-dir-structure" />
407 </target>
408
409 <target name="compile-binaries">
410 <addressedcall target="linux" />
411 <addressedcall target="windows" />
412 <addressedcall target="mac" />
413 <addressedcall target="merge-all" />
414 </target>
415
416 <target name="create-distribution">
417 <if><bool><istrue value="${execute}" /></bool>
418
419 <!-- clean up -->
420 <delete dir="${release.dir}/dist" />
421 <mkdir dir="${release.dir}/dist" />
422
423 <!-- recreate -->
424 <exec dir="${release.dir}/dist" executable="/home/nzdl/for-distributions/bin/script/create_distributions.pl">
425 <env key="GSDLHOME" value="${release.dir}/gsdl"/>
426 <env key="GSDLCOLLECTDIR" value="${release.dir}/gsdl/collect"/>
427 <env key="GSDLOS" value="linux"/>
428
429 <arg value="-version_num"/>
430 <arg value="${version}"/>
431 <arg value="-branch_path"/>
432 <arg value="${branch.path}"/>
433 <arg value="-output_dir"/>
434 <arg value="${release.dir}/dist"/>
435 <arg value="-NoChangeLog"/>
436
437 </exec>
438 </if>
439 </target>
440
441 <target name="create-installer-project">
442 <if><bool><istrue value="${execute}"/></bool>
443
444 <!-- use OS's copy so that permissions are preserved -->
445 <delete dir="${release.dir}/installer/gsdl"/>
446 <exec executable="cp"><arg line="-r /home/nzdl/for-distributions/installers/gsdl ${release.dir}/installer"/></exec>
447
448 <!-- Edit the <installer-dir>/gsdl/Greenstone Digital Library Software.uip file and change any absolute paths as needed. Make sure you change all paths. -->
449 <copy overwrite="true" file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.template" tofile="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix" />
450 <rsr file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix" pattern="@release\.dir@" replacement="${release.dir}" />
451 <rsr file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix" pattern="@version\.minor@" replacement="${version.minor}" />
452 <if>
453 <bool><equals arg1="${version}" arg2="trunk"/></bool>
454 <rsr file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix" pattern="@version@" replacement="trunk" />
455 <else>
456 <rsr file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix" pattern="@version@" replacement="v${version}" />
457 </else>
458 </if>
459
460
461 <!--
462 * Set GSDL_DISTRIBUTION_SOURCE to .../dist/gsdl-x.xx-cdrom (dist is the directory you created earlier)
463 * Set GSDL_WEB_DISTRIBUTION_EXTRAS to .../dist/gsdl-x.xx-unix
464 * Set INSTALLERS_DIR to the installer directory from above
465 -->
466
467 <rsr file="/home/nzdl/installshieldX/alias.properties" pattern="(GSDL_DISTRIBUTION_SOURCE)=.*" replacement="$1=${release.dir}/dist/gsdl-2.${version.minor}-cdrom" />
468 <rsr file="/home/nzdl/installshieldX/alias.properties" pattern="(GSDL_WEB_DISTRIBUTION_EXTRAS)=.*" replacement="$1=${release.dir}/dist/gsdl-2.${version.minor}-unix" />
469 <rsr file="/home/nzdl/installshieldX/alias.properties" pattern="(INSTALLERS_DIR)=.*" replacement="$1=${release.dir}/installer" />
470
471 <!-- create the windows version -->
472 <copy overwrite="true" file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix" tofile="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.windows" />
473 <rsr file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.windows" pattern="&quot;storedAs&quot;&gt;1&lt;" replacement="&quot;storedAs&quot;&gt;0&lt;" />
474
475 </if>
476 </target>
477
478 <target name="build-installers">
479 <addressedcall target="build-installer-linux" />
480 <addressedcall target="build-installer-mac" />
481 <addressedcall target="build-installer-windows" />
482 <addressedcall target="build-installer-source" />
483 <addressedcall target="get-gli-client" />
484
485 </target>
486
487
488
489
490
491
492
493 <!-- SECOND LEVEL TARGETS -->
494 <target name="create-dir-structure">
495 <if><bool><istrue value="${execute}"/></bool>
496 <mkdir dir="${release.dir}" />
497 <mkdir dir="${release.dir}/other-platforms" />
498 <mkdir dir="${release.dir}/installer" />
499 <mkdir dir="${release.dir}/release-${version}" />
500 </if>
501 </target>
502
503 <target name="linux">
504 <addressedcall target="linux-preparation"/>
505 <addressedcall target="linux-configuration"/>
506 <addressedcall target="linux-building"/>
507 </target>
508
509 <target name="mac">
510 <addressedcall target="mac-preparation"/>
511 <addressedcall target="mac-configuration"/>
512 <addressedcall target="mac-building"/>
513 <addressedcall target="mac-demo-collection"/>
514 </target>
515
516
517 <target name="windows">
518 <if><bool><istrue value="${execute}"/></bool>
519
520 <mkdir dir="${release.dir}/other-platforms/win-bin-windows"/>
521
522 <echo level="info">The windows compilation stage still has to be done manually.</echo>
523 <echo level="info">Please go to the kohekohe machine and follow the instructions found at:</echo>
524 <echo level="info">http://wesson.cs.waikato.ac.nz:7070/wiki/index.php/Creating_A_Release</echo>
525 <echo level="info">Do the 'Preparation' and 'Building' sections.</echo>
526 <echo level="info">(Ignore the last step, which tells you where to copy the resulting files.)</echo>
527 <echo level="info"/>
528
529 <echo level="info">Then copy (scp):</echo>
530 <echo level="info">Windows:gsdl/bin/windows/* to Linux:${release.dir}/other-platforms/win-bin-windows</echo>
531 <echo level="info"/>
532 <input addproperty="windows.compilation.done" validargs="done">Type 'done' when you have finished.</input>
533 </if>
534 </target>
535
536 <target name="merge-all">
537 <if><bool><istrue value="${execute}" /></bool>
538 <!-- mac -->
539 <delete dir="${release.dir}/gsdl/bin/darwin"/>
540 <exec executable="cp"><arg line="-r ${release.dir}/other-platforms/mac-bin-darwin ${release.dir}/gsdl/bin/darwin"/></exec>
541
542 <!-- windows -->
543 <delete dir="${release.dir}/gsdl/bin/windows"/>
544 <exec executable="cp"><arg line="-r ${release.dir}/other-platforms/win-bin-windows ${release.dir}/gsdl/bin/windows"/></exec>
545 </if>
546 </target>
547
548 <target name="build-installer-linux">
549 <if><bool><istrue value="${execute}" /></bool>
550
551 <echo level="info">use the unix installer</echo>
552 <copy overwrite="true" file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix"
553 tofile="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip" />
554
555
556 <echo level="info">do a commandline build</echo>
557 <exec dir="${release.dir}/installer/gsdl" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
558 <arg value="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip" />
559 <arg value="-build" />
560 <arg value="Linux Web Distribution" />
561 </exec>
562
563 <echo level="info">finish off</echo>
564 <exec dir="${release.dir}/installer/gsdl" executable="${release.dir}/installer/gsdl/finish-linux.sh">
565 <arg value="linux-web"/>
566 </exec>
567
568 <delete dir="${release.dir}/installer/gsdl/linux-web/gsdl-${version}-unix"/>
569 <move file="${release.dir}/installer/gsdl/linux-web/disk1" tofile="${release.dir}/installer/gsdl/linux-web/gsdl-${version}-unix"/>
570
571 <echo level="info">tar it up</echo>
572 <exec executable="tar" dir="${release.dir}/installer/gsdl/linux-web"><arg line="-czf gsdl-${version}-unix.tar.gz gsdl-${version}-unix"/></exec>
573 <echo level="info">move to the release-${version} directory</echo>
574 <move file="${release.dir}/installer/gsdl/linux-web/gsdl-${version}-unix.tar.gz" tofile="${release.dir}/release-${version}/gsdl-${version}-unix.tar.gz"/>
575 </if>
576 </target>
577
578 <target name="build-installer-mac">
579 <if><bool><istrue value="${execute}" /></bool>
580
581 <echo level="info">use the unix installer</echo>
582 <copy overwrite="true" file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.unix"
583 tofile="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip" />
584
585 <echo level="info">do a commandline build</echo>
586 <exec dir="${release.dir}/installer/gsdl" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
587 <arg value="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip" />
588 <arg value="-build" />
589 <arg value="Mac OS X Web Distribution" />
590 </exec>
591
592 <echo level="info">finish off</echo>
593 <exec dir="${release.dir}/installer/gsdl" executable="${release.dir}/installer/gsdl/finish-macOSx.sh">
594 <arg value="macOSx-web"/>
595 </exec>
596
597 <delete dir="${release.dir}/installer/gsdl/macOSx-web/gsdl-${version}-macOSx"/>
598 <move file="${release.dir}/installer/gsdl/macOSx-web/disk1" tofile="${release.dir}/installer/gsdl/macOSx-web/gsdl-${version}-macOSx"/>
599
600 <echo level="info">tar it up</echo>
601 <exec executable="tar" dir="${release.dir}/installer/gsdl/macOSx-web"><arg line="-czf gsdl-${version}-macOSx.tar.gz gsdl-${version}-macOSx"/></exec>
602 <echo level="info">move to the release-${version} directory</echo>
603 <move file="${release.dir}/installer/gsdl/macOSx-web/gsdl-${version}-macOSx.tar.gz" tofile="${release.dir}/release-${version}/gsdl-${version}-macOSx.tar.gz"/>
604 </if>
605 </target>
606
607 <target name="build-installer-windows">
608 <if><bool><istrue value="${execute}" /></bool>
609
610 <echo level="info">use the windows installer</echo>
611 <copy overwrite="true" file="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip.windows"
612 tofile="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip" />
613
614 <echo level="info">do a commandline build</echo>
615 <exec dir="${release.dir}/installer/gsdl" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
616 <arg value="${release.dir}/installer/gsdl/Greenstone Digital Library Software.uip" />
617 <arg value="-build" />
618 <arg value="Windows Web Distribution" />
619 </exec>
620
621 <echo level="info">finish off</echo>
622 <move file="${release.dir}/installer/gsdl/windows-web/disk1/setupwin32.exe" tofile="${release.dir}/release-${version}/gsdl-${version}-win32.exe"/>
623
624 </if>
625 </target>
626
627 <target name="build-installer-source">
628 <if><bool><istrue value="${execute}" /></bool>
629
630 <echo level="info">tar to the release-${version} directory</echo>
631 <exec executable="tar" dir="${release.dir}/dist"><arg line="-czf gsdl-${version}-src.tar.gz gsdl-${version}-src"/></exec>
632 <echo level="info">move to the release-${version} directory</echo>
633 <move file="${release.dir}/dist/gsdl-${version}-src.tar.gz" tofile="${release.dir}/release-${version}/gsdl-${version}-src.tar.gz"/>
634
635 </if>
636 </target>
637
638 <target name="get-gli-client">
639 <if><bool><istrue value="${execute}" /></bool>
640
641 <echo level="info">copy to the release-${version} directory</echo>
642 <copy file="${release.dir}/dist/gli-client-${version}.zip" todir="${release.dir}/release-${version}"/>
643
644 </if>
645 </target>
646
647
648
649
650 <!-- THIRD LEVEL TARGETS -->
651 <target name="linux-preparation">
652 <addressedcall target="checkout-gsdl-indexers-gli" />
653 <addressedcall target="insert-windows-perl" />
654 <addressedcall target="prepare-to-build-demo-collection" />
655 <addressedcall target="build-demo-collection" />
656 <addressedcall target="insert-demo-collection" />
657 </target>
658
659 <target name="linux-configuration">
660 <addressedcall target="add-static-to-configure-in"/>
661 <addressedcall target="set-environment-in-packages-configure"/>
662 <addressedcall target="run-configure"/>
663 <addressedcall target="makefiles-add-static"/>
664 </target>
665
666 <target name="linux-building">
667 <addressedcall target="run-make"/>
668 <addressedcall target="fix-wget"/>
669 <addressedcall target="run-make-install"/>
670 <addressedcall target="copy-library-oai"/>
671 <addressedcall target="strip-execs"/>
672 </target>
673
674 <target name="mac-preparation">
675 <addressedcall target="mac-checkout-gsdl"/>
676 </target>
677
678 <target name="mac-configuration">
679 <addressedcall target="mac-run-configure"/>
680 <addressedcall target="mac-tweak-makefiles"/>
681 </target>
682
683 <target name="mac-building">
684 <addressedcall target="mac-make"/>
685 <addressedcall target="mac-make-install"/>
686 <addressedcall target="mac-copy-library-oai"/>
687 <addressedcall target="mac-strip-execs"/>
688 <addressedcall target="mac-send-files-to-linux-machine"/>
689 </target>
690
691 <target name="mac-demo-collection">
692 <addressedcall target="mac-prepare-to-build-demo-collection"/>
693 <addressedcall target="mac-build-demo-collection"/>
694 </target>
695
696
697 <!-- FOURTH LEVEL TARGETS -->
698 <target name="checkout-gsdl-indexers-gli">
699 <if><bool><istrue value="${execute}"/></bool>
700 <svn>
701 <checkout url="${svn.root}/gsdl/${branch.path}" destPath="${release.dir}/gsdl"/>
702 </svn>
703 <svn>
704 <checkout url="${svn.root}/indexers/${branch.path}" destPath="${release.dir}/gsdl/indexers"/>
705 </svn>
706 <svn>
707 <checkout url="${svn.root}/gli/${branch.path}" destPath="${release.dir}/gsdl/gli"/>
708 </svn>
709 </if>
710 </target>
711
712 <target name="insert-windows-perl">
713 <if><bool><istrue value="${execute}"/></bool>
714 <mkdir dir="${release.dir}/gsdl/bin/windows"/>
715 <delete dir="${release.dir}/gsdl/bin/windows/perl"/>
716 <exec executable="cp"><arg line="-r /home/nzdl/for-distributions/bin/windows/perl ${release.dir}/gsdl/bin/windows"/></exec>
717 </if>
718 </target>
719
720 <target name="prepare-to-build-demo-collection">
721 <if><bool><istrue value="${execute}"/></bool>
722 <svn>
723 <checkout url="${svn.root}/gsdl/${branch.path}" destPath="${release.dir}/demo-collection"/>
724 </svn>
725 <svn>
726 <checkout url="${svn.root}/indexers/${branch.path}" destPath="${release.dir}/demo-collection/indexers"/>
727 </svn>
728 <exec dir="${release.dir}/demo-collection" executable="${release.dir}/demo-collection/configure"/>
729 <exec dir="${release.dir}/demo-collection" executable="make"/>
730 <exec dir="${release.dir}/demo-collection" executable="make"><arg value="install"/></exec>
731 </if>
732 </target>
733
734 <target name="build-demo-collection">
735 <if><bool><istrue value="${execute}"/></bool>
736 <exec dir="${release.dir}/demo-collection" executable="${basedir}/bin/build-demo-collection.sh"/>
737 <delete dir="${release.dir}/demo-collection/collect/demo/index"/>
738 <move file="${release.dir}/demo-collection/collect/demo/building" tofile="${release.dir}/demo-collection/collect/demo/index"/>
739 </if>
740 </target>
741
742 <target name="insert-demo-collection">
743 <if><bool><istrue value="${execute}"/></bool>
744 <delete dir="${release.dir}/gsdl/collect/demo" />
745 <exec executable="cp"><arg line="-r ${release.dir}/demo-collection/collect/demo ${release.dir}/gsdl/collect"/></exec>
746 </if>
747 </target>
748
749 <target name="add-static-to-configure-in">
750 <if><bool><istrue value="${execute}"/></bool>
751 <rsr file="${release.dir}/gsdl/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
752 <exec dir="${release.dir}/gsdl" executable="autoconf" output="${release.dir}/gsdl/configure"><arg value="configure.in"/></exec>
753 </if>
754 </target>
755
756 <target name="set-environment-in-packages-configure">
757 <if><bool><istrue value="${execute}"/></bool>
758 <rsr file="${release.dir}/gsdl/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
759 </if>
760 </target>
761
762 <target name="run-configure">
763 <if><bool><istrue value="${execute}"/></bool>
764 <exec dir="${release.dir}/gsdl" executable="${release.dir}/gsdl/configure"/>
765 </if>
766 </target>
767
768 <target name="makefiles-add-static">
769 <if><bool><istrue value="${execute}"/></bool>
770 <rsr file="${release.dir}/gsdl/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
771 <rsr file="${release.dir}/gsdl/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
772 <rsr file="${release.dir}/gsdl/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
773 <rsr file="${release.dir}/gsdl/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml.{2}EXEEXT.{1}" replacement="-o rtftohtml\$(EXEEXT) -static" />
774 </if>
775 </target>
776
777 <target name="run-make">
778 <if><bool><istrue value="${execute}"/></bool>
779 <exec dir="${release.dir}/gsdl" executable="make"/>
780 </if>
781 </target>
782
783 <target name="fix-wget">
784 <if><bool><istrue value="${execute}"/></bool>
785 <delete file="${release.dir}/gsdl/packages/wget/wget-1.9/src/wget"/>
786 <exec dir="${release.dir}/gsdl/packages/wget/wget-1.9/src" executable="gcc"><arg line="-O2 -Wall -Wno-implicit -o wget cmpt.o connect.o convert.o cookies.o ftp.o ftp-basic.o ftp-ls.o ftp-opie.o hash.o headers.o host.o html-parse.o html-url.o http.o init.o log.o main.o gen-md5.o netrc.o progress.o rbuf.o recur.o res.o retr.o safe-ctype.o snprintf.o gen_sslfunc.o url.o utils.o version.o -lssl -lcrypto -ldl -static"/></exec>
787 </if>
788 </target>
789
790
791 <target name="run-make-install">
792 <if><bool><istrue value="${execute}"/></bool>
793 <exec dir="${release.dir}/gsdl" executable="make"><arg value="install"/></exec>
794 </if>
795 </target>
796
797 <target name="copy-library-oai">
798 <if><bool><istrue value="${execute}"/></bool>
799 <exec executable="cp"><arg line="${release.dir}/gsdl/cgi-bin/library ${release.dir}/gsdl/bin/linux/library"/></exec>
800 <exec executable="cp"><arg line="${release.dir}/gsdl/cgi-bin/oaiserver ${release.dir}/gsdl/bin/linux/oaiserver"/></exec>
801 </if>
802 </target>
803
804 <target name="strip-execs">
805 <if><bool><istrue value="${execute}"/></bool>
806 <exec dir="${release.dir}/gsdl/bin/linux" executable="find">
807 <arg line="! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
808 </exec>
809 </if>
810 </target>
811
812
813
814 <target name="mac-checkout-gsdl">
815 <if><bool><istrue value="${execute}"/></bool>
816 <echo level="info">create release directory, if absent</echo>
817 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle if [ ! -e ${mac.release.dir} ]; then mkdir ${mac.release.dir}; fi" /></exec>
818
819 <echo level="info">checkout gsdl</echo>
820 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}; PATH=$PATH:/usr/local/bin svn co ${svn.root}/gsdl/${branch.path} gsdl" /></exec>
821 <echo level="info">checkout indexers</echo>
822 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/gsdl; PATH=$PATH:/usr/local/bin svn co ${svn.root}/indexers/${branch.path} indexers" /></exec>
823
824 </if>
825 </target>
826
827 <target name="mac-run-configure">
828 <if><bool><istrue value="${execute}"/></bool>
829 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/gsdl; PATH=$PATH:/usr/local/bin JAVA_HOME=/Library/Java/Home ./configure --with-gdbm=/Users/kjdon/gdbm-1.8.3" /></exec>
830 </if>
831 </target>
832
833
834 <target name="mac-tweak-makefiles">
835 <if><bool><istrue value="${execute}"/></bool>
836
837 <!-- src/recpt/Makefile -->
838 <exec executable="/usr/bin/ssh">
839 <arg value="${username}:${password}@shuttle"/>
840 <arg value="/Users/oranfry/bin/fvsr.sh"/>
841 <arg value="${mac.release.dir}/gsdl/src/recpt/Makefile"/>
842 <arg value="GDBM_LIBS"/>
843 <arg value="'-L/Users/kjdon/gdbm-1.8.3/lib -lgdbm'"/>
844 <arg value="'/Users/kjdon/gdbm-1.8.3/lib/libgdbm.a'"/>
845 </exec>
846
847 <!-- src/oaiservr/Makefile -->
848 <exec executable="/usr/bin/ssh">
849 <arg value="${username}:${password}@shuttle"/>
850 <arg value="/Users/oranfry/bin/fvsr.sh"/>
851 <arg value="${mac.release.dir}/gsdl/src/oaiservr/Makefile"/>
852 <arg value="GDBM_LIBS"/>
853 <arg value="'-L/Users/kjdon/gdbm-1.8.3/lib -lgdbm'"/>
854 <arg value="'/Users/kjdon/gdbm-1.8.3/lib/libgdbm.a'"/>
855 </exec>
856
857 <!-- src/db2txt/Makefile -->
858 <exec executable="/usr/bin/ssh">
859 <arg value="${username}:${password}@shuttle"/>
860 <arg value="/Users/oranfry/bin/fvsr.sh"/>
861 <arg value="${mac.release.dir}/gsdl/src/db2txt/Makefile"/>
862 <arg value="LIBS"/>
863 <arg value="'-L/Users/kjdon/gdbm-1.8.3/lib -lgdbm'"/>
864 <arg value="'/Users/kjdon/gdbm-1.8.3/lib/libgdbm.a'"/>
865 </exec>
866
867 <!-- src/txt2db/Makefile -->
868 <exec executable="/usr/bin/ssh">
869 <arg value="${username}:${password}@shuttle"/>
870 <arg value="/Users/oranfry/bin/fvsr.sh"/>
871 <arg value="${mac.release.dir}/gsdl/src/txt2db/Makefile"/>
872 <arg value="LIBS"/>
873 <arg value="'-L/Users/kjdon/gdbm-1.8.3/lib -lgdbm'"/>
874 <arg value="'/Users/kjdon/gdbm-1.8.3/lib/libgdbm.a'"/>
875 </exec>
876
877 <!-- src/recpt/Makefile -->
878 <exec executable="/usr/bin/ssh">
879 <arg value="${username}:${password}@shuttle"/>
880 <arg value="/Users/oranfry/bin/fvsr.sh"/>
881 <arg value="${mac.release.dir}/gsdl/src/recpt/Makefile"/>
882 <arg value="LC_LIBS"/>
883 <arg value="'-L../../packages/expat/lib -lexpat'"/>
884 <arg value="'../../packages/expat/lib/libexpat.a'"/>
885 </exec>
886
887 <!-- src/oaiservr/Makefile -->
888 <exec executable="/usr/bin/ssh">
889 <arg value="${username}:${password}@shuttle"/>
890 <arg value="/Users/oranfry/bin/fvsr.sh"/>
891 <arg value="${mac.release.dir}/gsdl/src/oaiservr/Makefile"/>
892 <arg value="LIBS"/>
893 <arg value="'-L../../packages/expat/lib -lexpat'"/>
894 <arg value="'../../packages/expat/lib/libexpat.a'"/>
895 </exec>
896
897 </if>
898 </target>
899
900 <target name="mac-make">
901 <if><bool><istrue value="${execute}"/></bool>
902 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/gsdl; PATH=$PATH:/usr/local/bin JAVA_HOME=/Library/Java/Home make" /></exec>
903 </if>
904 </target>
905
906 <target name="mac-make-install">
907 <if><bool><istrue value="${execute}"/></bool>
908 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/gsdl; PATH=$PATH:/usr/local/bin JAVA_HOME=/Library/Java/Home make install" /></exec>
909 </if>
910 </target>
911
912 <target name="mac-copy-library-oai">
913 <if><bool><istrue value="${execute}"/></bool>
914 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cp ${mac.release.dir}/gsdl/cgi-bin/library ${mac.release.dir}/gsdl/bin/darwin/library" /></exec>
915 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cp ${mac.release.dir}/gsdl/cgi-bin/oaiserver ${mac.release.dir}/gsdl/bin/darwin/oaiserver" /></exec>
916 </if>
917 </target>
918
919 <target name="mac-strip-execs">
920 <if><bool><istrue value="${execute}"/></bool>
921 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/gsdl; strip bin/darwin/*" /></exec>
922 </if>
923 </target>
924
925 <target name="mac-send-files-to-linux-machine">
926 <if><bool><istrue value="${execute}"/></bool>
927 <delete dir="${release.dir}/other-platforms/mac-bin-darwin"/>
928 <exec executable="/usr/bin/scp"><arg line="-r ${username}@shuttle:${mac.release.dir}/gsdl/bin/darwin ${release.dir}/other-platforms/mac-bin-darwin" /></exec>
929 </if>
930 </target>
931
932
933 <target name="mac-prepare-to-build-demo-collection">
934 <if><bool><istrue value="${execute}"/></bool>
935 <echo level="info">delete the old demo-collection greenstone</echo>
936 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle rm -rf ${mac.release.dir}/demo-collection" /></exec>
937
938 <echo level="info">re-create it</echo>
939 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cp -r ${mac.release.dir}/gsdl ${mac.release.dir}/demo-collection" /></exec>
940 </if>
941 </target>
942
943 <target name="mac-build-demo-collection">
944 <if><bool><istrue value="${execute}"/></bool>
945 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle export PATH=$PATH:/usr/local/bin export JAVA_HOME=/Library/Java/Home; cd ${mac.release.dir}/demo-collection; . setup.bash; import.pl --removeold demo; buildcol.pl --removeold demo" /></exec>
946 <exec executable="/usr/bin/scp"><arg line="${username}@shuttle:${mac.release.dir}/demo-collection/collect/demo/building/text/demo.bdb ${release.dir}/gsdl/collect/demo/index/text" /></exec>
947 </if>
948 </target>
949
950
951
952
953
954
955 <!-- OTHER ROOT TARGETS -->
956 <target name="initial-setup-init">
957
958 <echo level="info">CHECKING PRE-CONDITIONS</echo>
959 <echo level="info"/>
960
961 <!-- version number -->
962 <echo level="info">Checking if version number is set...</echo>
963 <if>
964 <bool>
965 <or>
966 <not><isset property="version"/></not>
967 <not><isset property="version.minor"/></not>
968 </or>
969 </bool>
970 <echo level="error">No, not set</echo>
971 <echo level="error">Please specify a version number</echo>
972 <echo level="error">E.g., ant -Dversion=3.03 -Dversion.minor=03 create-release</echo>
973 <echo level="error">or, ant -Dversion=trunk -Dversion.minor=03 create-release</echo>
974 <fail>Version number not set</fail>
975 </if>
976 <echo level="info">Version number: ${version}</echo>
977 <property name="app.version" value="${version}"/>
978 <echo level="info"/>
979
980 <!-- where to put the release -->
981 <echo level="info">Determining where to put the release...</echo>
982 <if>
983 <bool>
984 <or>
985 <not><isset property="release.dir"/></not>
986 <not><isset property="mac.release.dir"/></not>
987 <not><isset property="windows.release.dir"/></not>
988 </or>
989
990 </bool>
991 <echo level="error">No release directory specified.</echo>
992 <echo level="error">Please specify release directory on the command line.</echo>
993 <echo level="error">E.g., ant -Drelease.dir=/research/me/releases/3.03 -Dmac.release.dir=/Users/me/releases/3.03 -Dwindows.release.dir=c:\research\me\releases\3.03 create-release</echo>
994 <fail>Release directorys not set</fail>
995 </if>
996 <echo level="info">Release directory: ${release.dir}</echo>
997 <echo level="info">Mac release directory: ${mac.release.dir}</echo>
998 <echo level="info">Windows release directory: ${windows.release.dir}</echo>
999 <echo level="info"/>
1000
1001 <!-- check start from -->
1002 <echo level="info">Checking if we are resuming from a given target...</echo>
1003 <if>
1004 <bool>
1005 <not><isset property="resume.from"/></not>
1006 </bool>
1007 <echo level="info">No, start from the beginning</echo>
1008 <property name="resume.from" value="1"/>
1009 <else>
1010 <echo level="info">Yes, resuming from ${resume.from}</echo>
1011 </else>
1012 </if>
1013 <echo level="info"/>
1014
1015 <!-- check resume mode-->
1016 <echo level="info">Determining resume mode...</echo>
1017 <if>
1018 <bool>
1019 <not><isset property="resume.mode"/></not>
1020 </bool>
1021 <echo level="info">Mode not set, defaulting to 'fallthrough'</echo>
1022 <property name="resume.mode" value="fallthrough"/>
1023 <else>
1024 <echo level="info">Mode set to ${resume.mode}</echo>
1025 <if>
1026 <bool>
1027 <and>
1028 <not><equals arg1="${resume.mode}" arg2="descend"/></not>
1029 <not><equals arg1="${resume.mode}" arg2="fallthrough"/></not>
1030 </and>
1031 </bool>
1032 <echo level="error">You have not specified a valid resume mode.</echo>
1033 <echo level="error">Valid modes are 'fallthrough' and 'descend'.</echo>
1034 <fail>You have not specified a valid resume mode.</fail>
1035 </if>
1036 </else>
1037 </if>
1038 <echo level="info"/>
1039
1040
1041 <!-- execute target code or just traverse tree -->
1042 <echo level="info">Determining execute mode...</echo>
1043 <if>
1044 <bool>
1045 <not><isset property="execute"/></not>
1046 </bool>
1047 <echo level="info">Execute not set, defaulting to 'true'</echo>
1048 <property name="execute" value="true"/>
1049 <else>
1050 <echo level="info">Execute set to ${execute}</echo>
1051 <if>
1052 <bool>
1053 <and>
1054 <not><equals arg1="${execute}" arg2="true"/></not>
1055 <not><equals arg1="${execute}" arg2="false"/></not>
1056 </and>
1057 </bool>
1058 <echo level="error">You have not specified a valid value for execute.</echo>
1059 <echo level="error">Valid values are 'true' and 'false'.</echo>
1060 <fail>You have not specified a valid value for execute.</fail>
1061 </if>
1062 </else>
1063 </if>
1064
1065 <echo level="info"/>
1066
1067
1068 <!-- the trunk or a branch -->
1069 <echo level="info">Determining the branch path...</echo>
1070 <if>
1071 <bool>
1072 <equals arg1="trunk" arg2="${version}"/>
1073 </bool>
1074 <property name="branch.path" value="trunk"/>
1075
1076 <else>
1077 <property name="branch.path" value="branches/${version}"/>
1078 </else>
1079 </if>
1080 <echo level="info">Branch Path: ${branch.path}</echo>
1081 <echo level="info"/>
1082
1083 <!-- get current month and year-->
1084 <exec executable="date" outputproperty="current.month">
1085 <arg value="+%b"/>
1086 </exec>
1087 <exec executable="date" outputproperty="current.year">
1088 <arg value="+%Y"/>
1089 </exec>
1090 <echo level="info">Current Month: ${current.month}</echo>
1091 <echo level="info">Current Year: ${current.year}</echo>
1092
1093 </target>
1094
1095
1096 <!-- INITIAL-SETUP TARGET -->
1097 <target name="initial-setup" depends="initial-setup-init">
1098 <if><bool><not><equals arg1="${version}" arg2="trunk"/></not></bool>
1099 <addressedcall target="create-branches"/>
1100 <addressedcall target="set-all-version-numbers"/>
1101
1102 <else>
1103 <echo level="info">No need to do initial setup on the trunk</echo>
1104 <echo level="info">Initial setup is only done when creating a release from branches</echo>
1105 </else>
1106 </if>
1107 </target>
1108
1109 <!-- first level targets -->
1110 <target name="create-branches">
1111 <if><bool><istrue value="${execute}"/></bool>
1112
1113 <if>
1114 <bool>
1115 <and>
1116 <isset property="branch.path" />
1117 <not><equals arg1="${branch.path}" arg2=""/></not>
1118 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
1119 </and>
1120 </bool>
1121 <svn>
1122 <copy srcUrl="${svn.root}/gli/trunk" destUrl="${svn.root}/gli/${branch.path}" message="creating a branch for the ${version} release" />
1123 <copy srcUrl="${svn.root}/documentation/trunk" destUrl="${svn.root}/documentation/${branch.path}" message="creating a branch for the ${version} release" />
1124 <copy srcUrl="${svn.root}/indexers/trunk" destUrl="${svn.root}/indexers/${branch.path}" message="creating a branch for the ${version} release" />
1125 <copy srcUrl="${svn.root}/gsdl/trunk" destUrl="${svn.root}/gsdl/${branch.path}" message="creating a branch for the ${version} release" />
1126 </svn>
1127 <else><fail>please set the branch.path, e.g., -Dbranch.path=branches/2.75</fail></else>
1128 </if>
1129
1130 </if>
1131 </target>
1132
1133 <target name="set-all-version-numbers">
1134 <addressedcall target="checkout-gsdl-for-version-numbers"/>
1135 <addressedcall target="change-version-numbers"/>
1136 <addressedcall target="commit-version-numbers"/>
1137 </target>
1138
1139
1140
1141
1142 <!-- second level targets -->
1143 <target name="checkout-gsdl-for-version-numbers">
1144 <if><bool><istrue value="${execute}"/></bool>
1145 <svn>
1146 <checkout url="${svn.root}/gsdl/${branch.path}" destPath="${release.dir}/gsdl-for-version-numbers"/>
1147 </svn>
1148 <svn>
1149 <checkout url="${svn.root}/indexers/${branch.path}" destPath="${release.dir}/gsdl-for-version-numbers/indexers"/>
1150 </svn>
1151 <svn>
1152 <checkout url="${svn.root}/gli/${branch.path}" destPath="${release.dir}/gsdl-for-version-numbers/gli"/>
1153 </svn>
1154 </if>
1155 </target>
1156
1157
1158 <target name="change-version-numbers">
1159 <if><bool><istrue value="${execute}"/></bool>
1160
1161 <echo level="info">Set version number in lib/gsdlconf.h</echo>
1162 <rsr file="${release.dir}/gsdl-for-version-numbers/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.\...&quot;" replacement="$1 &quot;${version}&quot;" />
1163
1164 <echo level="info">Set version number in Install.sh</echo>
1165 <rsr file="${release.dir}/gsdl-for-version-numbers/Install.sh" pattern="(echo &quot;Version: ).*(&quot; .*)" replacement="$1${version}$2" />
1166
1167 <!-- AboutDialog.Date -->
1168 <echo level="info">AboutDialog.Date properties</echo>
1169 <!-- ar -->
1170 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.ar"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ar.properties"/></exec>
1171 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ar.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.ar} ${current.year})" />
1172 <echo level="info">ar: (${month.ar} ${current.year})</echo>
1173 <!-- ca -->
1174 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.ca"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ca.properties"/></exec>
1175 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ca.properties" pattern="AboutDialog.Date:\(.+ de \d{4}\)" replacement="AboutDialog.Date:(${month.ca} de ${current.year})" />
1176 <echo level="info">ca: (${month.ca} de ${current.year})</echo>
1177 <!-- el -->
1178 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.el"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_el.properties"/></exec>
1179 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_el.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.el} ${current.year})" />
1180 <echo level="info">el: (${month.el} ${current.year})</echo>
1181 <!-- es -->
1182 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.es"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_es.properties"/></exec>
1183 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_es.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.es} ${current.year})" />
1184 <echo level="info">es: (${month.es} ${current.year})</echo>
1185 <!-- fr -->
1186 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.fr"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_fr.properties"/></exec>
1187 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_fr.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.fr} ${current.year})" />
1188 <echo level="info">fr: (${month.fr} ${current.year})</echo>
1189 <!-- lv -->
1190 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.lv"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_lv.properties"/></exec>
1191 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_lv.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.lv} ${current.year})" />
1192 <echo level="info">lv: (${month.lv} ${current.year})</echo>
1193 <!-- mr -->
1194 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.mr"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_mr.properties"/></exec>
1195 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_mr.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.mr} ${current.year})" />
1196 <echo level="info">mr: (${month.mr} ${current.year})</echo>
1197 <!-- default -->
1198 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.default"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary.properties"/></exec>
1199 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.default} ${current.year})" />
1200 <echo level="info">default: (${month.default} ${current.year})</echo>
1201 <!-- ro -->
1202 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.ro"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ro.properties"/></exec>
1203 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ro.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.ro} ${current.year})" />
1204 <echo level="info">ro: (${month.ro} ${current.year})</echo>
1205 <!-- ru -->
1206 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.ru"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ru.properties"/></exec>
1207 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_ru.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.ru} ${current.year})" />
1208 <echo level="info">ru: (${month.ru} ${current.year})</echo>
1209 <!-- vi -->
1210 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.vi"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_vi.properties"/></exec>
1211 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_vi.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.vi} ${current.year})" />
1212 <echo level="info">vi: (${month.vi} ${current.year})</echo>
1213 <!-- zh -->
1214 <exec executable="${basedir}/bin/gsp.sh" outputproperty="month.zh"><arg value="Dates.${current.month}"/><arg value="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_zh.properties"/></exec>
1215 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/dictionary_zh.properties" pattern="AboutDialog.Date:\(.+ \d{4}\)" replacement="AboutDialog.Date:(${month.zh} ${current.year})" />
1216 <echo level="info">zh: (${month.zh} ${current.year})</echo>
1217
1218 <!-- readmes at /home/nzdl/gsdl-docs - do manually -->
1219 <!-- es -->
1220 <!--<echo level="info">Updating spanish README at /home/nzdl/gsdl-docs/READMEes.txt</echo>
1221 <rsr file="/home/nzdl/gsdl-docs/READMEes.txt" pattern="(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}" />
1222 <rsr file="/home/nzdl/gsdl-docs/READMEes.txt" pattern="(Versi.?n\s*)(.*)" replacement="$1${version}" />-->
1223 <!-- fr -->
1224 <!--<echo level="info">Updating french README at /home/nzdl/gsdl-docs/READMEfr.txt</echo>
1225 <rsr file="/home/nzdl/gsdl-docs/READMEfr.txt" pattern="(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}" />
1226 <rsr file="/home/nzdl/gsdl-docs/READMEfr.txt" pattern="(Version\s*)(.*)" replacement="$1${version}" />-->
1227 <!-- en -->
1228 <!--<echo level="info">Updating english README at /home/nzdl/gsdl-docs/READMEen.txt</echo>
1229 <rsr file="/home/nzdl/gsdl-docs/READMEen.txt" pattern="(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
1230 <rsr file="/home/nzdl/gsdl-docs/READMEen.txt" pattern="(Version\s*)(.*)" replacement="$1${version}" />-->
1231
1232 <!-- ru -->
1233 <!--<echo level="info">Updating russian README at /home/nzdl/gsdl-docs/READMEru.txt-koi8-r</echo>
1234 <rsr file="/home/nzdl/gsdl-docs/READMEru.txt-koi8-r" pattern="(ÀÁÔÁ\s*)(.*)" replacement="$1${month.ru} ${current.year}" />
1235 <rsr file="/home/nzdl/gsdl-docs/READMEru.txt-koi8-r" pattern="(ց
1236ÒÓÉÑ\s*)(.*)" replacement="$1${version}" />-->
1237
1238 <!-- change the version number in gli gatherer-->
1239 <echo level="info">Changing version number in gli Gatherer</echo>
1240 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/src/org/greenstone/gatherer/Gatherer.java" pattern="^(.*)String\s*PROGRAM_VERSION\s*=\s*&quot;(.*)&quot;" replacement="$1String PROGRAM_VERSION = &quot;${version}&quot;"/>
1241
1242 <!-- in classes/xml/config.xml -->
1243 <echo level="info">Changing configuration version in gli/classes/xml/config.xml</echo>
1244 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/xml/config.xml" pattern="^(\s*&lt;Configuration.* version=&quot;)[^&quot;]*(&quot;.*&gt;)" replacement="$1${version}$2"/>
1245
1246 <!-- in classes/xml/configRemote.xml -->
1247 <echo level="info">Changing configuration version in gli/classes/xml/configRemote.xml</echo>
1248 <rsr file="${release.dir}/gsdl-for-version-numbers/gli/classes/xml/configRemote.xml" pattern="^(\s*&lt;Configuration.* version=&quot;)[^&quot;]*(&quot;.*&gt;)" replacement="$1${version}$2"/>
1249
1250
1251 <!-- in /home/nzdl/gsdl-docs/Support.htm -->
1252 <echo level="info">Changing version in /home/nzdl/gsdl-docs/Support.htm</echo>
1253 <rsr file="/home/nzdl/gsdl-docs/Support.htm" pattern="^(\s*Greenstone Digital Library version: ).*(&lt;br&gt;.*)" replacement="$1${version}$2"/>
1254 <rsr file="/home/nzdl/gsdl-docs/Support.htm" pattern="^(\s*&lt;input.* name=&quot;gsdl version&quot;.* value=&quot;).*(&quot;.*&gt;)" replacement="$1${version}$2"/>
1255
1256 <echo level="info"/>
1257 <echo level="info"/>
1258
1259 <echo level="info">Please update the READMEs at /home/nzdl/gsdl-docs manually</echo>
1260 <echo level="info">This can't be done automatically because the character encoding will get messed up</echo>
1261 <echo>Use these month strings:</echo>
1262 <echo>En: ${month.default} ${current.year}</echo>
1263 <echo>Fr: ${month.fr} ${current.year}</echo>
1264 <echo>Es: ${month.es} ${current.year}</echo>
1265 <echo>Ru: ${month.ru} ${current.year}</echo>
1266 <echo level="info"/>
1267 <echo level="info">You could also check all version number edits have been performed properly</echo>
1268 <echo level="info"/>
1269 <input addproperty="windows.compilation.done" validargs="done">Type 'done' when you have finished.</input>
1270
1271 </if>
1272 </target>
1273
1274 <target name="commit-version-numbers">
1275 <if><bool><istrue value="${execute}"/></bool>
1276
1277 <svn>
1278 <commit dir="${release.dir}/gsdl-for-version-numbers" message="checking-in version number changes"/>
1279 <commit dir="${release.dir}/gsdl-for-version-numbers/gli" message="checking-in version number changes"/>
1280 </svn>
1281
1282 </if>
1283 </target>
1284
1285
1286</project>
Note: See TracBrowser for help on using the repository browser.