source: main/trunk/release-kits/shared/core/ant-scripts/init.xml@ 21630

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

tidy up for greenstone3, and made wrap shared

File size: 14.9 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk-init">
3
4 <!-- CHECK PRE-CONDITIONS -->
5 <target name="init">
6
7 <!-- load in static properties from build.properties -->
8 <property file="${rk.name}-build.properties" />
9
10 <!-- CONSTANTS (overridable in build.properties) -->
11
12 <!-- svn root -->
13 <property name="svn.root" value="http://svn.greenstone.org" />
14
15 <!-- default revision and branch path -->
16 <property name="branch.path" value="trunk" />
17 <property name="branch.revision" value="HEAD" />
18
19 <!-- the minimum version of java which the installer should be run with (this gets used in search4j) -->
20 <property name="java.min.version" value="1.4.0_00"/>
21
22 <!-- create a localised basedir property -->
23 <path id="basedir.path"><pathelement location="${basedir}"/></path>
24 <property name="basedir.local" refid="basedir.path"/>
25
26 <!-- size of resource chunks (windows wrapper) -->
27 <property name="resources.chunksize" value="8388608"/>
28
29 <!-- the extra space for the dmg image in KB (mac wrapper) -->
30 <property name="dmg.overhead" value="2048"/>
31
32 <!-- current date and time -->
33 <tstamp>
34 <format property="current.month" pattern="MMM"/>
35 <format property="current.year" pattern="yyyy"/>
36 <format property="date" pattern="yyyy.MM.dd"/>
37 </tstamp>
38
39 <!-- BUNDLED JAVA INFO -->
40 <!-- the bundled javas are kept in shared/linux/wrapper and shared/windows/wrapper in the repository -->
41 <!-- change this info when the bundled version changes -->
42 <property name="java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
43
44 <!-- linux -->
45 <property name="linux-java.installer" value="jre_bin"/>
46 <property name="bundled.version.linux-java" value="1.6.0_05"/> <!-- set this to the version number of java in the above archive -->
47 <property name="component.bytesize.linux-java" value="101245987"/> <!-- set this to the size of the extract archive -->
48
49 <!-- windows -->
50 <property name="windows-java.installer" value="jre.exe"/>
51 <property name="bundled.version.windows-java" value="1.6.0_07"/> <!-- set this to the version number of java in the above archive -->
52 <property name="component.bytesize.windows-java" value="75000000"/> <!-- set this to the size of the extract archive -->
53
54 <!-- version numbers of other bundled things -->
55 <property name="bundled.version.imagemagick" value="6.4.3"/>
56 <property name="bundled.version.ghostscript" value="8.63"/>
57 <property name="bundled.version.tomcat" value="6.0.20"/>
58
59 <!-- CLASSPATH -->
60 <path id="project.classpath">
61
62 <!-- our classes -->
63 <fileset dir="${rk.home}/shared/core">
64 <include name="ant-tasks/antelope/AntelopeTasks_3.4.2.jar"/>
65 <include name="ant-tasks/orangevolt/roxes-win32forjava-1.1.1.jar"/>
66 <include name="ant-tasks/orangevolt/orangevolt-ant-tasks-1.3.8.jar"/>
67 <include name="ant-tasks/greenstone/anttasks.jar"/>
68 <include name="ant-tasks/7z-ant/7z.jar"/>
69 <include name="lib/crypt.jar"/>
70 <include name="lib/serializer.jar"/>
71 <include name="lib/xalan.jar"/>
72 <include name="lib/xercesImpl.jar"/>
73 <include name="lib/xml-apis.jar"/>
74 <include name="ant-installer/lib/ant-installer-ext.jar"/>
75 <include name="ant-installer/lib/ant-installer.jar"/>
76 </fileset>
77
78 </path>
79
80 <!-- SELF DEFINED TASKS AND TYPES -->
81 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
82 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
83 <taskdef name="math" classname="ise.antelope.tasks.MathTask" classpathref="project.classpath"/>
84 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
85 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
86 <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>
87 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
88 <typedef name="dcff" classname="org.greenstone.anttasks.DeleteChunkFromFile" classpathref="project.classpath"/>
89 <typedef name="rsplit" classname="org.greenstone.anttasks.SplitResource" classpathref="project.classpath"/>
90 <typedef name="get-property-value" classname="org.greenstone.anttasks.GetPropertyValue" classpathref="project.classpath"/>
91
92 <!-- DATES IN DIFFERENT LANGUAGES -->
93 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="ar.Dates.${current.month}" outputProperty="month.ar"/>
94 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="ca.Dates.${current.month}" outputProperty="month.ca"/>
95 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="el.Dates.${current.month}" outputProperty="month.el"/>
96 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="es.Dates.${current.month}" outputProperty="month.es"/>
97 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="fr.Dates.${current.month}" outputProperty="month.fr"/>
98 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="lv.Dates.${current.month}" outputProperty="month.lv"/>
99 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="mr.Dates.${current.month}" outputProperty="month.mr"/>
100 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="ro.Dates.${current.month}" outputProperty="month.ro"/>
101 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="ru.Dates.${current.month}" outputProperty="month.ru"/>
102 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="vi.Dates.${current.month}" outputProperty="month.vi"/>
103 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="zh.Dates.${current.month}" outputProperty="month.zh"/>
104 <get-property-value propertiesFile="${rk.home}/shared/core/lib/dates.properties" propertyName="default.Dates.${current.month}" outputProperty="month.default"/>
105
106
107 <!-- version number -->
108 <if><bool><not><isset property="version"/></not></bool>
109 <fail>Version number not set. Check that the file '${rk.name}-build.properties' exists and defines property 'version'.</fail>
110 </if>
111 <property name="app.version" value="${version}"/>
112
113 <!-- work out rk.os -->
114 <if>
115 <bool>
116 <or>
117 <equals arg1="${rk.os}" arg2="linux"/>
118 <equals arg1="${rk.os}" arg2="mac"/>
119 <equals arg1="${rk.os}" arg2="windows"/>
120 </or>
121 </bool>
122 <echo>Using user-specified value for rk.os: '${rk.os}'</echo>
123
124 <else><if>
125 <bool><equals arg1="${os.name}" arg2="Linux"/></bool>
126 <property name="rk.os" value="linux"/>
127
128 <else><if>
129 <bool><equals arg1="${os.name}" arg2="Mac OS X"/></bool>
130 <property name="rk.os" value="mac"/>
131
132 <else><if>
133 <bool>
134 <or>
135 <equals arg1="${os.name}" arg2="Windows 95"/>
136 <equals arg1="${os.name}" arg2="Windows 98"/>
137 <equals arg1="${os.name}" arg2="Windows 2000"/>
138 <equals arg1="${os.name}" arg2="Windows XP"/>
139 <equals arg1="${os.name}" arg2="Windows NT"/>
140 <equals arg1="${os.name}" arg2="Windows ME"/>
141 <equals arg1="${os.name}" arg2="Windows Vista"/>
142 </or>
143 </bool>
144 <property name="rk.os" value="windows"/>
145
146 <else>
147 <fail>Can't work out what to set rk.os to. Please report this to [email protected] . In the mean time, manually set rk.os to 'windows', 'mac', or 'linux' by reinvoking the release kit with, for example, '-Drk.os=windows'</fail>
148
149 </else></if></else></if></else></if></else></if>
150
151 <!-- set os.suffix and os.shell -->
152 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
153 <property name="os.suffix" value="MacOS-intel"/>
154 <property name="os.shell" value="darwin"/>
155 </if>
156 <property name="os.suffix" value="${rk.os}"/>
157 <property name="os.shell" value="${rk.os}"/>
158
159 <!-- set os.script.format -->
160 <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
161 <property name="os.script.format" value="sh"/>
162 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
163 <property name="os.script.format" value="bat"/>
164 </if></else></if>
165
166 <!-- show important properties -->
167 <echo level="info">Version (version): ${version}</echo>
168 <echo level="info">Major Version (version.major): ${version.major}</echo>
169 <echo level="info">Branch Path (branch.path): ${branch.path}</echo>
170 <echo level="info">Date (date): ${date}</echo>
171 <echo level="info">Current Month (current.month): ${current.month}</echo>
172 <echo level="info">Current Year (current.year): ${current.year}</echo>
173 <echo level="info">Operating System (rk.os): ${rk.os}</echo>
174 <echo level="info">Operating System Suffix (os.suffix): ${os.suffix}</echo>
175 <!--
176 <echo level="info">Current Date</echo>
177 <echo level="info">ar: ${month.ar} ${current.year}</echo>
178 <echo level="info">ca: ${month.el} ${current.year}</echo>
179 <echo level="info">el: ${month.el} ${current.year}</echo>
180 <echo level="info">es: ${month.es} ${current.year}</echo>
181 <echo level="info">fr: ${month.fr} ${current.year}</echo>
182 <echo level="info">lv: ${month.lv} ${current.year}</echo>
183 <echo level="info">mr: ${month.mr} ${current.year}</echo>
184 <echo level="info">ro: ${month.ro} ${current.year}</echo>
185 <echo level="info">ru: ${month.ru} ${current.year}</echo>
186 <echo level="info">vi: ${month.vi} ${current.year}</echo>
187 <echo level="info">zh: ${month.zh} ${current.year}</echo>
188 <echo level="info">default: (${month.default} ${current.year})</echo>
189 -->
190 </target>
191
192 <!-- show the core properties of all release-kits -->
193 <target name="core-properties">
194 <echo>Required Properties:</echo>
195 <echo>version the version string for the release</echo>
196 <echo/>
197 <echo>Optional Properties:</echo>
198 <echo>branch.path the branch of Greenstone to make a release of. Eg: tags/2.81. Default: trunk.</echo>
199 <echo>branch.revision the revision of Greenstone to make a release of. Eg: 18273. Default: HEAD.</echo>
200 <echo/>
201 </target>
202
203 <!-- a target to strip any directory of .svn folders -->
204 <target name="strip-svn-dirs">
205 <delete includeemptydirs="true">
206 <fileset dir="${dir}" defaultexcludes="false">
207 <include name="**/.svn/**" />
208 <include name="**/.svn/" />
209 <include name=".svn/**" />
210 <include name=".svn/" />
211 </fileset>
212 </delete>
213 </target>
214
215 <!-- target to insert the uninstaller into 'compiled' and compile it -->
216 <target name="insert-and-compile-uninstaller">
217
218 <!-- create working build directory -->
219 <mkdir dir="compiled/uninstaller/build/resources" />
220
221 <!-- copile to build -->
222 <javac
223 srcdir="${rk.home}/shared/core/uninstaller"
224 destdir="compiled/uninstaller/build" />
225
226 <!-- copy language bundle into place -->
227 <native2ascii
228 implementation="sun"
229 src="${rk.home}/shared/core/language-strings"
230 dest="compiled/uninstaller/build/resources"/>
231
232 <!-- jar it all up -->
233 <jar
234 destfile="compiled/uninst.jar"
235 manifest="${rk.home}/shared/core/uninstaller/manifest.mf"
236 basedir="compiled/uninstaller/build" />
237
238 <!-- clean up build directory -->
239 <delete dir="compiled/uninstaller"/>
240
241 <!-- put the associated script in place -->
242 <copy file="${rk.home}/shared/core/uninstaller/Uninstall.${os.script.format}" todir="compiled"/>
243
244 </target>
245
246 <!-- target to set all the version numbers in a greenstone2 or gs2build directory -->
247 <target name="gsdl-set-version-numbers">
248
249 <if><bool><available file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h"/></bool>
250 <rsr file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
251 </if>
252
253 <if><bool><available file="${gsdl.basedir}/etc/VERSION"/></bool>
254 <rsr file="${gsdl.basedir}/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
255 </if>
256
257 <if><bool><available file="${gsdl.basedir}/lib/java/server.properties"/></bool>
258 <rsr file="${gsdl.basedir}/lib/java/server.properties" pattern="^(Server2Control.Version[:=]).*" replacement="$1${version}" />
259 </if>
260
261 <if><bool><available file="${gsdl.basedir}/lib/java/log4j.properties.in"/></bool>
262 <rsr file="${gsdl.basedir}/lib/java/log4j.properties.in" pattern="^(log4j.category.org.greenstone.server[:=].*)INFO(.*)" replacement="$1WARN$2" />
263 </if>
264
265 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${gsdl.basedir}"/></antcall>
266
267 </target>
268
269 <!-- target to set dates in readme files -->
270 <target name="gsdl-set-dates-in-readmes">
271
272 <!-- en -->
273 <if><bool><available file="${gsdl.basedir}/READMEen.txt"/></bool>
274 <rsr file="${gsdl.basedir}/READMEen.txt">
275 <job pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
276 <job pattern="^(Version\s*)(.*)" replacement="$1${version}" />
277 </rsr>
278 </if>
279
280 <!-- ar -->
281 <if><bool><available file="${gsdl.basedir}/READMEar.txt"/></bool>
282 <rsr file="${gsdl.basedir}/READMEar.txt">
283 <job pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}"/>
284 <job pattern="(النسخه : \s*)(.*)" replacement="$1${version}"/>
285 </rsr>
286 </if>
287
288 <!-- es -->
289 <if><bool><available file="${gsdl.basedir}/READMEes.txt"/></bool>
290 <rsr file="${gsdl.basedir}/READMEes.txt">
291 <job pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}"/>
292 <job pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}"/>
293 </rsr>
294 </if>
295
296 <!-- fr -->
297 <if><bool><available file="${gsdl.basedir}/READMEfr.txt"/></bool>
298 <rsr file="${gsdl.basedir}/READMEfr.txt">
299 <job pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}"/>
300 <job pattern="^(Version\s*)(.*)" replacement="$1${version}"/>
301 </rsr>
302 </if>
303
304 <!-- ru -->
305 <if><bool><available file="${gsdl.basedir}/READMEru.txt"/></bool>
306 <rsr file="${gsdl.basedir}/READMEru.txt">
307 <job pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}"/>
308 <job pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}"/>
309 </rsr>
310 </if>
311
312 </target>
313
314 <!-- target to archive and compress a given component -->
315 <target name="create-component">
316 <mkdir dir="components"/>
317 <zip destfile="components/${component}.comp" compress="false">
318 <zipfileset dir="compiled">
319 <patternset refid="greenstone${version.major}.${component}.component"/>
320 </zipfileset>
321 </zip>
322 <!-- windows -->
323 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
324 <exec executable="${rk.home}/shared/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 ${component}.lzma ${component}.comp"/></exec>
325
326 <!-- linux, mac -->
327 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
328 <sevenzip task="encode" input="components/${component}.comp" output="components/${component}.lzma" dictionnary="26"/>
329
330 <!-- else warn -->
331 <else>
332 <fail>this target does not support this os (was a new release-kit os added?)</fail>
333
334 </else></if></else></if>
335 </target>
336
337</project>
Note: See TracBrowser for help on using the repository browser.