source: release-kits/wirk3/ant-scripts/init.xml@ 15691

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

changes to the ant scripts to accompany the changes in the wrapper and jar installer

File size: 6.2 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="wirk3-init">
12
13 <!-- classpath -->
14 <path id="project.classpath">
15 <fileset dir="${wirk3.home}/ant-scripts/tasks">
16 <include name="**/*.jar"/>
17 </fileset>
18 <fileset dir="${wirk3.home}/lib">
19 <include name="*.jar"/>
20 </fileset>
21 <pathelement path="${wirk3.home}/ant-scripts/tasks/orans"/>
22 <!-- antinstaller -->
23 <pathelement path="${wirk3.home}/bin/ant-installer/lib/ant-installer-ext.jar"/>
24 <pathelement path="${wirk3.home}/bin/ant-installer/lib/ant-installer.jar"/>
25 </path>
26
27 <!-- create a localised basedir property -->
28 <path id="basedir.path">
29 <pathelement location="${basedir}"/>
30 </path>
31 <property name="basedir.local" refid="basedir.path"/>
32
33 <!-- svn root -->
34 <property name="svn.root" value="http://svn.greenstone.org"/>
35
36 <!-- self defined tasks and types-->
37 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
38 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
39 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
40 <taskdef name="setloglevel" classname="SetLogLevel" classpathref="project.classpath"/>
41 <typedef name="addressedcall" classname="TreeCallTarget" classpathref="project.classpath"/>
42 <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
43 <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>
44
45 <!-- load in static properties from build.properties -->
46 <property file="build.properties" />
47
48 <!-- the version numbers of bundled things -->
49 <property name="bundled.version.java" value="1.6.0_05"/>
50 <property name="bundled.version.tomcat" value="5.5.25"/>
51 <property name="bundled.version.ant" value="1.6.5"/>
52
53 <!-- somewhere to store temporary text -->
54 <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/>
55
56 <!-- stuff to do before all tasks -->
57 <target name="init">
58
59 <echo level="info">CHECKING PRE-CONDITIONS</echo>
60 <echo level="info"/>
61
62 <!-- version number -->
63 <echo level="info">Version number...</echo>
64 <if>
65 <bool>
66 <not><isset property="version"/></not>
67 </bool>
68
69 <!-- version not set in build.properties, try get from repository -->
70 <setloglevel level="error"/>
71 <try>
72 <get src="${svn.root}/greenstone3/${branch.path}/version.properties" dest="${temp.file}"/>
73 <catch>
74 <echo level="error">Not set in build.properties or repository version.properties</echo>
75 <fail>Version number not set</fail>
76 </catch>
77 </try>
78 <setloglevel level="info"/>
79
80 <property file="${temp.file}"/>
81
82 <if>
83 <bool>
84 <not><isset property="version"/></not>
85 </bool>
86 <echo level="error">version.properties exists, but doesn't set version string</echo>
87 <fail>Version number not set</fail>
88 </if>
89
90 <echo level="info">Taken from repository version.properties</echo>
91
92 <else>
93 <echo level="info">Taken from build.properties</echo>
94 </else>
95
96 </if>
97
98 <echo level="info">Version number: ${version}</echo>
99 <property name="app.version" value="${version}"/>
100 <echo level="info"/>
101
102
103 <!-- check resume from -->
104 <echo level="info">Checking if we are resuming from a given target...</echo>
105 <if>
106 <bool><not><isset property="resume.from"/></not></bool>
107 <echo level="info">No, start from the beginning</echo>
108 <else>
109 <echo level="info">Yes, resuming from ${resume.from}</echo>
110 </else>
111 </if>
112 <echo level="info"/>
113
114 <!-- check resume to -->
115 <echo level="info">Checking if we are resuming up to a given target...</echo>
116 <if>
117 <bool><not><isset property="resume.to"/></not></bool>
118 <echo level="info">No, stop at the end</echo>
119 <else>
120 <echo level="info">Yes, resuming from ${resume.to}</echo>
121 </else>
122 </if>
123 <echo level="info"/>
124
125
126 <!-- check resume mode-->
127 <echo level="info">Determining resume mode...</echo>
128 <if>
129 <bool>
130 <not><isset property="resume.mode"/></not>
131 </bool>
132 <echo level="info">Mode not set, just fall through</echo>
133 <else>
134 <echo level="info">Mode set to ${resume.mode}</echo>
135 <if>
136 <bool>
137 <not><equals arg1="${resume.mode}" arg2="descend"/></not>
138 </bool>
139 <echo level="error">You have not specified a valid resume mode.</echo>
140 <echo level="error">Valid modes are 'descend' and null.</echo>
141 <fail>You have not specified a valid resume mode.</fail>
142 </if>
143 </else>
144 </if>
145 <echo level="info"/>
146
147 <!-- execute target code or just traverse tree -->
148 <echo level="info">Determining execute mode...</echo>
149 <if>
150 <bool>
151 <not><isset property="execute"/></not>
152 </bool>
153 <echo level="info">Execute not set, defaulting to 'true'</echo>
154 <property name="execute" value="true"/>
155 <else>
156 <echo level="info">Execute set to ${execute}</echo>
157 <if>
158 <bool>
159 <and>
160 <not><equals arg1="${execute}" arg2="true"/></not>
161 <not><equals arg1="${execute}" arg2="false"/></not>
162 </and>
163 </bool>
164 <echo level="error">You have not specified a valid value for execute.</echo>
165 <echo level="error">Valid values are 'true' and 'false'.</echo>
166 <fail>You have not specified a valid value for execute.</fail>
167 </if>
168 </else>
169 </if>
170
171 <echo level="info"/>
172
173
174 <!-- check branch.path -->
175 <echo level="info">Determining the branch path...</echo>
176 <if>
177 <bool><not><isset property="branch.path"/></not></bool>
178 <fail>You have not specified a branch path where code will come from in the repository</fail>
179 </if>
180
181 <echo level="info">Branch Path: ${branch.path}</echo>
182 <echo level="info"/>
183
184 <!-- check branch.revision -->
185 <echo level="info">Determining the branch revision...</echo>
186 <if>
187 <bool><not><isset property="branch.revision"/></not></bool>
188 <property name="branch.revision" value="HEAD"/>
189 <!--<echo level="info">No branch revision specified, defaulting to HEAD</echo>-->
190 </if>
191
192 <echo level="info">Branch Revision: ${branch.revision}</echo>
193 <echo level="info"/>
194
195 </target>
196
197</project>
Note: See TracBrowser for help on using the repository browser.