source: release-kits/lirk3/ant-scripts/init.xml@ 16147

Last change on this file since 16147 was 15967, checked in by oranfry, 16 years ago

let gli.sh get into greenstone3 releases

File size: 10.3 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2
3<!--
4 ..........................................................
5 September 2007
6 Greenstone3 'release maker' script
7 Oran Fry
8 ..........................................................
9-->
10
11<project name="lirk3-init">
12
13 <!-- classpath -->
14 <path id="project.classpath">
15 <fileset dir="${lirk3.home}/ant-scripts/tasks">
16 <include name="**/*.jar"/>
17 </fileset>
18 <fileset dir="${lirk3.home}/lib">
19 <include name="*.jar"/>
20 </fileset>
21 <fileset dir="${lirk3.home}/bin/ant-installer/lib">
22 <include name="ant-installer-ext.jar"/>
23 <include name="ant-installer.jar"/>
24 </fileset>
25 <pathelement path="${lirk3.home}/ant-scripts/tasks/orans"/>
26
27 <pathelement path="${basedir}/installer/cp"/>
28 </path>
29
30 <!-- svn root -->
31 <property name="svn.root" value="http://svn.greenstone.org"/>
32
33 <!-- self defined tasks -->
34 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
35 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
36 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
37 <taskdef name="setloglevel" classname="SetLogLevel" classpathref="project.classpath"/>
38 <typedef name="addressedcall" classname="TreeCallTarget" classpathref="project.classpath"/>
39 <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
40 <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>
41
42 <!-- load in static properties from build.properties -->
43 <property file="build.properties" />
44
45 <!-- the minimum version of java which the installer should be run with (this gets passed to search4j) -->
46 <property name="java.min.version" value="1.4.0_00"/>
47
48 <!-- somewhere to store temporary text -->
49 <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/>
50
51 <!-- the version numbers of bundled things -->
52 <property name="bundled.version.java" value="1.6.0_05"/>
53 <property name="bundled.version.tomcat" value="5.5.25"/>
54 <property name="bundled.version.ant" value="1.6.5"/>
55
56 <!-- information about the bundled java (to be changed manually when the bundled version changes) -->
57 <property name="java.installer" value="jre_6u5_tar_gz"/> <!-- set this to the name of the archive in LIRK3_HOME/wrapper. can only contain A-Za-z_ -->
58 <property name="java.extracted" value="jre1.6.0_05"/> <!-- set this to the name of the top level directory in the above archive -->
59 <property name="component.size.java" value="97Mb"/>
60
61
62
63
64
65 <!-- stuff to do before all tasks -->
66 <target name="init">
67
68 <!-- verify classpath -->
69 <!--
70 <property name="cpp" refid="project.classpath"/>
71 <echo message="classpath: ${cpp}"/>
72 -->
73
74 <echo level="info">CHECKING PRE-CONDITIONS</echo>
75 <echo level="info"/>
76
77 <!-- version number -->
78 <echo level="info">Version number...</echo>
79 <if>
80 <bool>
81 <not><isset property="version"/></not>
82 </bool>
83
84 <!-- version not set in build.properties, try get from repository -->
85 <setloglevel level="error"/>
86 <try>
87 <get src="${svn.root}/greenstone3/${branch.path}/version.properties" dest="${temp.file}"/>
88 <catch>
89 <echo level="error">Not set in build.properties or repository version.properties</echo>
90 <fail>Version number not set</fail>
91 </catch>
92 </try>
93 <setloglevel level="info"/>
94
95 <property file="${temp.file}"/>
96
97 <if>
98 <bool>
99 <not><isset property="version"/></not>
100 </bool>
101 <echo level="error">version.properties exists, but doesn't set version string</echo>
102 <fail>Version number not set</fail>
103 </if>
104
105 <echo level="info">Taken from repository version.properties</echo>
106
107 <else>
108 <echo level="info">Taken from build.properties</echo>
109 </else>
110
111 </if>
112
113 <echo level="info">Version number: ${version}</echo>
114 <property name="app.version" value="${version}"/>
115 <echo level="info"/>
116
117
118 <!-- check resume from -->
119 <echo level="info">Checking if we are resuming from a given target...</echo>
120 <if>
121 <bool><not><isset property="resume.from"/></not></bool>
122 <echo level="info">No, start from the beginning</echo>
123 <else>
124 <echo level="info">Yes, resuming from ${resume.from}</echo>
125 </else>
126 </if>
127 <echo level="info"/>
128
129 <!-- check resume to -->
130 <echo level="info">Checking if we are resuming up to a given target...</echo>
131 <if>
132 <bool><not><isset property="resume.to"/></not></bool>
133 <echo level="info">No, stop at the end</echo>
134 <else>
135 <echo level="info">Yes, resuming from ${resume.to}</echo>
136 </else>
137 </if>
138 <echo level="info"/>
139
140
141 <!-- check resume mode-->
142 <echo level="info">Determining resume mode...</echo>
143 <if>
144 <bool>
145 <not><isset property="resume.mode"/></not>
146 </bool>
147 <echo level="info">Mode not set, just fall through</echo>
148 <else>
149 <echo level="info">Mode set to ${resume.mode}</echo>
150 <if>
151 <bool>
152 <not><equals arg1="${resume.mode}" arg2="descend"/></not>
153 </bool>
154 <echo level="error">You have not specified a valid resume mode.</echo>
155 <echo level="error">Valid modes are 'descend' and null.</echo>
156 <fail>You have not specified a valid resume mode.</fail>
157 </if>
158 </else>
159 </if>
160 <echo level="info"/>
161
162 <!-- execute target code or just traverse tree -->
163 <echo level="info">Determining execute mode...</echo>
164 <if>
165 <bool>
166 <not><isset property="execute"/></not>
167 </bool>
168 <echo level="info">Execute not set, defaulting to 'true'</echo>
169 <property name="execute" value="true"/>
170 <else>
171 <echo level="info">Execute set to ${execute}</echo>
172 <if>
173 <bool>
174 <and>
175 <not><equals arg1="${execute}" arg2="true"/></not>
176 <not><equals arg1="${execute}" arg2="false"/></not>
177 </and>
178 </bool>
179 <echo level="error">You have not specified a valid value for execute.</echo>
180 <echo level="error">Valid values are 'true' and 'false'.</echo>
181 <fail>You have not specified a valid value for execute.</fail>
182 </if>
183 </else>
184 </if>
185
186 <echo level="info"/>
187
188
189 <!-- check branch.path -->
190 <echo level="info">Determining the branch path...</echo>
191 <if>
192 <bool><equals arg1="trunk" arg2="${version}"/></bool>
193 <property name="branch.path" value="trunk"/>
194 </if>
195
196 <if>
197 <bool><not><isset property="branch.path"/></not></bool>
198 <fail>You have not specified a branch path where code will come from in the repository</fail>
199 </if>
200
201 <echo level="info">Branch Path: ${branch.path}</echo>
202 <echo level="info"/>
203
204 <!-- check branches exist -->
205 <property name="svn.greenstone3" value="${svn.root}/greenstone3/${branch.path}"/>
206 <property name="svn.gsdl" value="${svn.root}/gsdl/${branch.path}"/>
207 <property name="svn.gli" value="${svn.root}/gli/${branch.path}"/>
208 <property name="svn.indexers" value="${svn.root}/indexers/${branch.path}"/>
209 <property name="svn.documentation" value="${svn.root}/documentation/${branch.path}"/>
210
211 <!-- greenstone3 branch -->
212 <echo level="info">Checking that ${svn.greenstone3} exists...</echo>
213
214 <!-- try to put the html index of the location into the temp file -->
215 <setloglevel level="error"/>
216 <try>
217 <get src="${svn.greenstone3}" dest="${temp.file}"/>
218 <catch>
219 <echo level="error">No, it does not exist</echo>
220 <property name="svn.greenstone3.unavailable" value="true"/>
221 </catch>
222 </try>
223 <setloglevel level="info"/>
224 <if>
225 <bool><not><istrue value="${svn.greenstone3.unavailable}"/></not></bool>
226 <echo level="info">Yes, it exists</echo>
227 </if>
228
229 <!-- gsdl branch -->
230 <echo level="info">Checking that ${svn.gsdl} exists...</echo>
231 <setloglevel level="error"/>
232 <try>
233 <get src="${svn.gsdl}" dest="${temp.file}"/>
234 <catch>
235 <echo level="error">No, it does not exist</echo>
236 <property name="svn.gsdl.unavailable" value="true"/>
237 </catch>
238 </try>
239 <setloglevel level="info"/>
240 <if>
241 <bool><not><istrue value="${svn.gsdl.unavailable}"/></not></bool>
242 <echo level="info">Yes, it exists</echo>
243 </if>
244
245
246 <!-- gli branch -->
247 <echo level="info">Checking that ${svn.gli} exists...</echo>
248 <!-- try to put the html index of the location into the temp file -->
249 <setloglevel level="error"/>
250 <try>
251 <get src="${svn.gli}" dest="${temp.file}"/>
252 <catch>
253 <echo level="error">No, does not exist</echo>
254 <property name="svn.gli.unavailable" value="true"/>
255 </catch>
256 </try>
257 <setloglevel level="info"/>
258 <if>
259 <bool><not><istrue value="${svn.gli.unavailable}"/></not></bool>
260 <echo level="info">Yes, it exists</echo>
261 </if>
262
263
264 <!-- indexers branch -->
265 <echo level="info">Checking that ${svn.indexers} exists...</echo>
266 <!-- try to put the html index of the location into the temp file -->
267 <setloglevel level="error"/>
268 <try>
269 <get src="${svn.indexers}" dest="${temp.file}"/>
270 <catch>
271 <echo level="error">No, it does not exist</echo>
272 <property name="svn.indexers.unavailable" value="true"/>
273 </catch>
274 </try>
275 <setloglevel level="info"/>
276 <if>
277 <bool><not><istrue value="${svn.indexers.unavailable}"/></not></bool>
278 <echo level="info">Yes, it exists</echo>
279 </if>
280
281 <!-- documentation branch -->
282 <echo level="info">Checking that ${svn.documentation} exists...</echo>
283 <!-- try to put the html index of the location into the temp file -->
284 <setloglevel level="error"/>
285 <try>
286 <get src="${svn.documentation}" dest="${temp.file}"/>
287 <catch>
288 <echo level="error">No, it does not exist</echo>
289 <property name="svn.documentation.unavailable" value="true"/>
290 </catch>
291 </try>
292 <setloglevel level="info"/>
293 <if>
294 <bool><not><istrue value="${svn.documentation.unavailable}"/></not></bool>
295 <echo level="info">Yes, it exists</echo>
296 </if>
297
298
299 <!-- clean up the temp file -->
300 <setloglevel level="error"/>
301 <delete file="${temp.file}"/>
302 <setloglevel level="info"/>
303
304
305 <!-- fail if some branches were missing -->
306 <if>
307 <bool>
308 <or>
309 <istrue value="${svn.greenstone3.unavailable}"/>
310 <istrue value="${svn.gsdl.unavailable}"/>
311 <istrue value="${svn.gli.unavailable}"/>
312 <istrue value="${svn.indexers.unavailable}"/>
313 <istrue value="${svn.documentation.unavailable}"/>
314 </or>
315 </bool>
316 <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>
317 <else>
318 <echo level="info">All exist</echo>
319 </else>
320 </if>
321
322 </target>
323
324</project>
Note: See TracBrowser for help on using the repository browser.