root/release-kits/wirk3/ant-scripts/init.xml @ 15356

Revision 15356, 6.5 KB (checked in by oranfry, 12 years ago)

a few fixes to wirk3

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