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 |
|
---|
34 | <!-- self defined tasks and types-->
|
---|
35 | <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
|
---|
36 | <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
|
---|
37 | <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
|
---|
38 | <taskdef name="setloglevel" classname="SetLogLevel" classpathref="project.classpath"/>
|
---|
39 | <typedef name="addressedcall" classname="TreeCallTarget" classpathref="project.classpath"/>
|
---|
40 | <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
|
---|
41 | <typedef name="rsplit" classname="SplitResource" classpathref="project.classpath"/>
|
---|
42 | <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>
|
---|
43 |
|
---|
44 | <!-- load in static properties from build.properties -->
|
---|
45 | <property file="build.properties" />
|
---|
46 |
|
---|
47 | <!-- CONSTANTS -->
|
---|
48 | <property name="resources.chunksize" value="8388608"/><!-- resources split into 8MiB chunks -->
|
---|
49 |
|
---|
50 | <!-- the version numbers of bundled things (entered manually to save us autodetecting; update as needed) -->
|
---|
51 | <property name="bundled.version.tomcat" value="5.5.25"/>
|
---|
52 | <property name="bundled.version.ant" value="1.6.5"/>
|
---|
53 |
|
---|
54 | <!-- stuff to do before all tasks -->
|
---|
55 | <target name="init">
|
---|
56 |
|
---|
57 | <echo level="info">CHECKING PRE-CONDITIONS</echo>
|
---|
58 | <echo level="info"/>
|
---|
59 |
|
---|
60 | <!-- version number -->
|
---|
61 | <echo level="info">Version number...</echo>
|
---|
62 | <if>
|
---|
63 | <bool>
|
---|
64 | <not><isset property="version"/></not>
|
---|
65 | </bool>
|
---|
66 |
|
---|
67 | <!-- version not set in build.properties, try get from repository -->
|
---|
68 | <setloglevel level="error"/>
|
---|
69 | <try>
|
---|
70 | <get src="${svn.root}/greenstone3/${branch.path}/version.properties" dest="${temp.file}"/>
|
---|
71 | <catch>
|
---|
72 | <echo level="error">Not set in build.properties or repository version.properties</echo>
|
---|
73 | <fail>Version number not set</fail>
|
---|
74 | </catch>
|
---|
75 | </try>
|
---|
76 | <setloglevel level="info"/>
|
---|
77 |
|
---|
78 | <property file="${temp.file}"/>
|
---|
79 |
|
---|
80 | <if>
|
---|
81 | <bool>
|
---|
82 | <not><isset property="version"/></not>
|
---|
83 | </bool>
|
---|
84 | <echo level="error">version.properties exists, but doesn't set version string</echo>
|
---|
85 | <fail>Version number not set</fail>
|
---|
86 | </if>
|
---|
87 |
|
---|
88 | <echo level="info">Taken from repository version.properties</echo>
|
---|
89 |
|
---|
90 | <else>
|
---|
91 | <echo level="info">Taken from build.properties</echo>
|
---|
92 | </else>
|
---|
93 |
|
---|
94 | </if>
|
---|
95 |
|
---|
96 | <echo level="info">Version number: ${version}</echo>
|
---|
97 | <property name="app.version" value="${version}"/>
|
---|
98 | <echo level="info"/>
|
---|
99 |
|
---|
100 |
|
---|
101 | <!-- check resume from -->
|
---|
102 | <echo level="info">Checking if we are resuming from a given target...</echo>
|
---|
103 | <if>
|
---|
104 | <bool><not><isset property="resume.from"/></not></bool>
|
---|
105 | <echo level="info">No, start from the beginning</echo>
|
---|
106 | <else>
|
---|
107 | <echo level="info">Yes, resuming from ${resume.from}</echo>
|
---|
108 | </else>
|
---|
109 | </if>
|
---|
110 | <echo level="info"/>
|
---|
111 |
|
---|
112 | <!-- check resume to -->
|
---|
113 | <echo level="info">Checking if we are resuming up to a given target...</echo>
|
---|
114 | <if>
|
---|
115 | <bool><not><isset property="resume.to"/></not></bool>
|
---|
116 | <echo level="info">No, stop at the end</echo>
|
---|
117 | <else>
|
---|
118 | <echo level="info">Yes, resuming from ${resume.to}</echo>
|
---|
119 | </else>
|
---|
120 | </if>
|
---|
121 | <echo level="info"/>
|
---|
122 |
|
---|
123 |
|
---|
124 | <!-- check resume mode-->
|
---|
125 | <echo level="info">Determining resume mode...</echo>
|
---|
126 | <if>
|
---|
127 | <bool>
|
---|
128 | <not><isset property="resume.mode"/></not>
|
---|
129 | </bool>
|
---|
130 | <echo level="info">Mode not set, just fall through</echo>
|
---|
131 | <else>
|
---|
132 | <echo level="info">Mode set to ${resume.mode}</echo>
|
---|
133 | <if>
|
---|
134 | <bool>
|
---|
135 | <not><equals arg1="${resume.mode}" arg2="descend"/></not>
|
---|
136 | </bool>
|
---|
137 | <echo level="error">You have not specified a valid resume mode.</echo>
|
---|
138 | <echo level="error">Valid modes are 'descend' and null.</echo>
|
---|
139 | <fail>You have not specified a valid resume mode.</fail>
|
---|
140 | </if>
|
---|
141 | </else>
|
---|
142 | </if>
|
---|
143 | <echo level="info"/>
|
---|
144 |
|
---|
145 | <!-- execute target code or just traverse tree -->
|
---|
146 | <echo level="info">Determining execute mode...</echo>
|
---|
147 | <if>
|
---|
148 | <bool>
|
---|
149 | <not><isset property="execute"/></not>
|
---|
150 | </bool>
|
---|
151 | <echo level="info">Execute not set, defaulting to 'true'</echo>
|
---|
152 | <property name="execute" value="true"/>
|
---|
153 | <else>
|
---|
154 | <echo level="info">Execute set to ${execute}</echo>
|
---|
155 | <if>
|
---|
156 | <bool>
|
---|
157 | <and>
|
---|
158 | <not><equals arg1="${execute}" arg2="true"/></not>
|
---|
159 | <not><equals arg1="${execute}" arg2="false"/></not>
|
---|
160 | </and>
|
---|
161 | </bool>
|
---|
162 | <echo level="error">You have not specified a valid value for execute.</echo>
|
---|
163 | <echo level="error">Valid values are 'true' and 'false'.</echo>
|
---|
164 | <fail>You have not specified a valid value for execute.</fail>
|
---|
165 | </if>
|
---|
166 | </else>
|
---|
167 | </if>
|
---|
168 |
|
---|
169 | <echo level="info"/>
|
---|
170 |
|
---|
171 |
|
---|
172 | <!-- check branch.path -->
|
---|
173 | <echo level="info">Determining the branch path...</echo>
|
---|
174 | <if>
|
---|
175 | <bool><not><isset property="branch.path"/></not></bool>
|
---|
176 | <fail>You have not specified a branch path where code will come from in the repository</fail>
|
---|
177 | </if>
|
---|
178 |
|
---|
179 | <echo level="info">Branch Path: ${branch.path}</echo>
|
---|
180 | <echo level="info"/>
|
---|
181 |
|
---|
182 | <!-- check branch.revision -->
|
---|
183 | <echo level="info">Determining the branch revision...</echo>
|
---|
184 | <if>
|
---|
185 | <bool><not><isset property="branch.revision"/></not></bool>
|
---|
186 | <property name="branch.revision" value="HEAD"/>
|
---|
187 | <!--<echo level="info">No branch revision specified, defaulting to HEAD</echo>-->
|
---|
188 | </if>
|
---|
189 |
|
---|
190 | <echo level="info">Branch Revision: ${branch.revision}</echo>
|
---|
191 | <echo level="info"/>
|
---|
192 |
|
---|
193 | </target>
|
---|
194 |
|
---|
195 | </project>
|
---|