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

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

we are no longer changing version numbers in any subtargets of the create-release target

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