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

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

changes to the wrapper and installer logic, and a few changes to init and compile stuff

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