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

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

some updates to make the release kit produce nicer installers

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