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

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

changes to the GUI and wrapper

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