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

Last change on this file since 15832 was 15832, checked in by oranfry, 14 years ago

a few touchups to lirk3

File size: 10.1 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 <!-- somewhere to store temporary text -->
46 <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/>
47
48 <!-- bundled java strings -->
49 <!-- java.installer: use a filename which has only letters numbers and underscores -->
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 <!--<property name="java.installer" value="jre_6u5_linux_i586"/>-->
57 <property name="java.installer" value="jre_6u5_tar_gz"/>
58 <property name="java.extracted" value="jre1.6.0_05"/>
59 <property name="java.min.version" value="1.4.0_00"/>
60
61
62 <!-- stuff to do before all tasks -->
63 <target name="init">
64
65 <!-- verify classpath -->
66 <!--
67 <property name="cpp" refid="project.classpath"/>
68 <echo message="classpath: ${cpp}"/>
69 -->
70
71 <echo level="info">CHECKING PRE-CONDITIONS</echo>
72 <echo level="info"/>
73
74 <!-- version number -->
75 <echo level="info">Version number...</echo>
76 <if>
77 <bool>
78 <not><isset property="version"/></not>
79 </bool>
80
81 <!-- version not set in build.properties, try get from repository -->
82 <setloglevel level="error"/>
83 <try>
84 <get src="${svn.root}/greenstone3/${branch.path}/version.properties" dest="${temp.file}"/>
85 <catch>
86 <echo level="error">Not set in build.properties or repository version.properties</echo>
87 <fail>Version number not set</fail>
88 </catch>
89 </try>
90 <setloglevel level="info"/>
91
92 <property file="${temp.file}"/>
93
94 <if>
95 <bool>
96 <not><isset property="version"/></not>
97 </bool>
98 <echo level="error">version.properties exists, but doesn't set version string</echo>
99 <fail>Version number not set</fail>
100 </if>
101
102 <echo level="info">Taken from repository version.properties</echo>
103
104 <else>
105 <echo level="info">Taken from build.properties</echo>
106 </else>
107
108 </if>
109
110 <echo level="info">Version number: ${version}</echo>
111 <property name="app.version" value="${version}"/>
112 <echo level="info"/>
113
114
115 <!-- check resume from -->
116 <echo level="info">Checking if we are resuming from a given target...</echo>
117 <if>
118 <bool><not><isset property="resume.from"/></not></bool>
119 <echo level="info">No, start from the beginning</echo>
120 <else>
121 <echo level="info">Yes, resuming from ${resume.from}</echo>
122 </else>
123 </if>
124 <echo level="info"/>
125
126 <!-- check resume to -->
127 <echo level="info">Checking if we are resuming up to a given target...</echo>
128 <if>
129 <bool><not><isset property="resume.to"/></not></bool>
130 <echo level="info">No, stop at the end</echo>
131 <else>
132 <echo level="info">Yes, resuming from ${resume.to}</echo>
133 </else>
134 </if>
135 <echo level="info"/>
136
137
138 <!-- check resume mode-->
139 <echo level="info">Determining resume mode...</echo>
140 <if>
141 <bool>
142 <not><isset property="resume.mode"/></not>
143 </bool>
144 <echo level="info">Mode not set, just fall through</echo>
145 <else>
146 <echo level="info">Mode set to ${resume.mode}</echo>
147 <if>
148 <bool>
149 <not><equals arg1="${resume.mode}" arg2="descend"/></not>
150 </bool>
151 <echo level="error">You have not specified a valid resume mode.</echo>
152 <echo level="error">Valid modes are 'descend' and null.</echo>
153 <fail>You have not specified a valid resume mode.</fail>
154 </if>
155 </else>
156 </if>
157 <echo level="info"/>
158
159 <!-- execute target code or just traverse tree -->
160 <echo level="info">Determining execute mode...</echo>
161 <if>
162 <bool>
163 <not><isset property="execute"/></not>
164 </bool>
165 <echo level="info">Execute not set, defaulting to 'true'</echo>
166 <property name="execute" value="true"/>
167 <else>
168 <echo level="info">Execute set to ${execute}</echo>
169 <if>
170 <bool>
171 <and>
172 <not><equals arg1="${execute}" arg2="true"/></not>
173 <not><equals arg1="${execute}" arg2="false"/></not>
174 </and>
175 </bool>
176 <echo level="error">You have not specified a valid value for execute.</echo>
177 <echo level="error">Valid values are 'true' and 'false'.</echo>
178 <fail>You have not specified a valid value for execute.</fail>
179 </if>
180 </else>
181 </if>
182
183 <echo level="info"/>
184
185
186 <!-- check branch.path -->
187 <echo level="info">Determining the branch path...</echo>
188 <if>
189 <bool><equals arg1="trunk" arg2="${version}"/></bool>
190 <property name="branch.path" value="trunk"/>
191 </if>
192
193 <if>
194 <bool><not><isset property="branch.path"/></not></bool>
195 <fail>You have not specified a branch path where code will come from in the repository</fail>
196 </if>
197
198 <echo level="info">Branch Path: ${branch.path}</echo>
199 <echo level="info"/>
200
201 <!-- check branches exist -->
202 <property name="svn.greenstone3" value="${svn.root}/greenstone3/${branch.path}"/>
203 <property name="svn.gsdl" value="${svn.root}/gsdl/${branch.path}"/>
204 <property name="svn.gli" value="${svn.root}/gli/${branch.path}"/>
205 <property name="svn.indexers" value="${svn.root}/indexers/${branch.path}"/>
206 <property name="svn.documentation" value="${svn.root}/documentation/${branch.path}"/>
207
208 <!-- greenstone3 branch -->
209 <echo level="info">Checking that ${svn.greenstone3} exists...</echo>
210
211 <!-- try to put the html index of the location into the temp file -->
212 <setloglevel level="error"/>
213 <try>
214 <get src="${svn.greenstone3}" dest="${temp.file}"/>
215 <catch>
216 <echo level="error">No, it does not exist</echo>
217 <property name="svn.greenstone3.unavailable" value="true"/>
218 </catch>
219 </try>
220 <setloglevel level="info"/>
221 <if>
222 <bool><not><istrue value="${svn.greenstone3.unavailable}"/></not></bool>
223 <echo level="info">Yes, it exists</echo>
224 </if>
225
226 <!-- gsdl branch -->
227 <echo level="info">Checking that ${svn.gsdl} exists...</echo>
228 <setloglevel level="error"/>
229 <try>
230 <get src="${svn.gsdl}" dest="${temp.file}"/>
231 <catch>
232 <echo level="error">No, it does not exist</echo>
233 <property name="svn.gsdl.unavailable" value="true"/>
234 </catch>
235 </try>
236 <setloglevel level="info"/>
237 <if>
238 <bool><not><istrue value="${svn.gsdl.unavailable}"/></not></bool>
239 <echo level="info">Yes, it exists</echo>
240 </if>
241
242
243 <!-- gli branch -->
244 <echo level="info">Checking that ${svn.gli} exists...</echo>
245 <!-- try to put the html index of the location into the temp file -->
246 <setloglevel level="error"/>
247 <try>
248 <get src="${svn.gli}" dest="${temp.file}"/>
249 <catch>
250 <echo level="error">No, does not exist</echo>
251 <property name="svn.gli.unavailable" value="true"/>
252 </catch>
253 </try>
254 <setloglevel level="info"/>
255 <if>
256 <bool><not><istrue value="${svn.gli.unavailable}"/></not></bool>
257 <echo level="info">Yes, it exists</echo>
258 </if>
259
260
261 <!-- indexers branch -->
262 <echo level="info">Checking that ${svn.indexers} exists...</echo>
263 <!-- try to put the html index of the location into the temp file -->
264 <setloglevel level="error"/>
265 <try>
266 <get src="${svn.indexers}" dest="${temp.file}"/>
267 <catch>
268 <echo level="error">No, it does not exist</echo>
269 <property name="svn.indexers.unavailable" value="true"/>
270 </catch>
271 </try>
272 <setloglevel level="info"/>
273 <if>
274 <bool><not><istrue value="${svn.indexers.unavailable}"/></not></bool>
275 <echo level="info">Yes, it exists</echo>
276 </if>
277
278 <!-- documentation branch -->
279 <echo level="info">Checking that ${svn.documentation} exists...</echo>
280 <!-- try to put the html index of the location into the temp file -->
281 <setloglevel level="error"/>
282 <try>
283 <get src="${svn.documentation}" dest="${temp.file}"/>
284 <catch>
285 <echo level="error">No, it does not exist</echo>
286 <property name="svn.documentation.unavailable" value="true"/>
287 </catch>
288 </try>
289 <setloglevel level="info"/>
290 <if>
291 <bool><not><istrue value="${svn.documentation.unavailable}"/></not></bool>
292 <echo level="info">Yes, it exists</echo>
293 </if>
294
295
296 <!-- clean up the temp file -->
297 <setloglevel level="error"/>
298 <delete file="${temp.file}"/>
299 <setloglevel level="info"/>
300
301
302 <!-- fail if some branches were missing -->
303 <if>
304 <bool>
305 <or>
306 <istrue value="${svn.greenstone3.unavailable}"/>
307 <istrue value="${svn.gsdl.unavailable}"/>
308 <istrue value="${svn.gli.unavailable}"/>
309 <istrue value="${svn.indexers.unavailable}"/>
310 <istrue value="${svn.documentation.unavailable}"/>
311 </or>
312 </bool>
313 <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>
314 <else>
315 <echo level="info">All exist</echo>
316 </else>
317 </if>
318
319 </target>
320
321</project>
Note: See TracBrowser for help on using the repository browser.