source: release-kits/shared/core/ant-scripts/init.xml@ 20112

Last change on this file since 20112 was 20112, checked in by oranfry, 15 years ago

more generalisation, and wrok on mark3

File size: 16.8 KB
RevLine 
[16173]1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk-init">
3
4 <!-- load in static properties from build.properties -->
[17898]5 <property file="${rk.name}-build.properties" />
[16173]6
[16199]7 <!-- CONSTANTS (overridable in build.properties) -->
8
[16173]9 <!-- svn root -->
[16199]10 <property name="svn.root" value="http://svn.greenstone.org" />
[16173]11
[16199]12 <!-- default revision and branch path -->
13 <property name="branch.path" value="trunk" />
14 <property name="branch.revision" value="HEAD" />
15
[16174]16 <!-- the minimum version of java which the installer should be run with (this gets used in search4j) -->
[16173]17 <property name="java.min.version" value="1.4.0_00"/>
18
[16199]19 <!-- create a localised basedir property -->
20 <path id="basedir.path"><pathelement location="${basedir}"/></path>
21 <property name="basedir.local" refid="basedir.path"/>
22
[16681]23 <!-- current date and time -->
24 <tstamp>
25 <format property="current.month" pattern="MMM"/>
26 <format property="current.year" pattern="yyyy"/>
[19152]27 <format property="date" pattern="yyyy.MM.dd"/>
[16681]28 </tstamp>
[17344]29
[16174]30 <!-- BUNDLED JAVA INFO -->
[16199]31 <!-- the bundled javas are kept in shared/linux/wrapper and shared/windows/wrapper in the repository -->
[16174]32 <!-- change this info when the bundled version changes -->
[16199]33 <!-- linux -->
[17465]34 <property name="linux-java.installer" value="jre_bin"/>
[17297]35 <property name="bundled.version.linux-java" value="1.6.0_05"/> <!-- set this to the version number of java in the above archive -->
[17465]36 <property name="linux-java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
[17518]37 <property name="component.bytesize.linux-java" value="101245987"/> <!-- set this to the size of the extract archive -->
38
[16199]39 <!-- windows -->
[17276]40 <property name="windows-java.installer" value="jre.exe"/>
[17297]41 <property name="bundled.version.windows-java" value="1.6.0_07"/> <!-- set this to the version number of java in the above archive -->
[17272]42 <property name="windows-java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
[17518]43 <property name="component.bytesize.windows-java" value="75000000"/> <!-- set this to the size of the extract archive -->
[17467]44
45 <!-- version numbers of other bundled things -->
46 <property name="bundled.version.imagemagick" value="6.4.3"/>
47 <property name="bundled.version.ghostscript" value="8.63"/>
[20107]48 <property name="bundled.version.tomcat" value="6.0.20"/>
[16173]49
50 <!-- CLASSPATH -->
51 <path id="project.classpath">
52
53 <!-- our classes -->
[19006]54 <fileset dir="${rk.home}/core">
55 <include name="ant-tasks/antelope/AntelopeTasks_3.4.2.jar"/>
56 <include name="ant-tasks/orangevolt/roxes-win32forjava-1.1.1.jar"/>
57 <include name="ant-tasks/orangevolt/orangevolt-ant-tasks-1.3.8.jar"/>
58 <include name="ant-tasks/svnant/lib/ganymed.jar"/>
59 <include name="ant-tasks/svnant/lib/svnClientAdapter.jar"/>
60 <include name="ant-tasks/svnant/lib/svnant.jar"/>
61 <include name="ant-tasks/svnant/lib/svnjavahl.jar"/>
62 <include name="ant-tasks/svnant/lib/svnkit.jar"/>
63 <include name="ant-tasks/greenstone/anttasks.jar"/>
64 <include name="ant-tasks/7z-ant/7z.jar"/>
[17898]65 <include name="lib/crypt.jar"/>
66 <include name="lib/serializer.jar"/>
67 <include name="lib/xalan.jar"/>
68 <include name="lib/xercesImpl.jar"/>
69 <include name="lib/xml-apis.jar"/>
[19006]70 <include name="ant-installer/lib/ant-installer-ext.jar"/>
71 <include name="ant-installer/lib/ant-installer.jar"/>
[16173]72 </fileset>
73
74 </path>
75
76 <!-- SELF DEFINED TASKS AND TYPES -->
77 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
78 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
[17098]79 <taskdef name="math" classname="ise.antelope.tasks.MathTask" classpathref="project.classpath"/>
[16173]80 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
[17391]81 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
[16173]82 <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>
[17098]83 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
[17278]84 <typedef name="dcff" classname="org.greenstone.anttasks.DeleteChunkFromFile" classpathref="project.classpath"/>
[17098]85 <typedef name="rsplit" classname="org.greenstone.anttasks.SplitResource" classpathref="project.classpath"/>
86 <typedef name="get-property-value" classname="org.greenstone.anttasks.GetPropertyValue" classpathref="project.classpath"/>
[17344]87
[16242]88 <!-- DATES IN DIFFERENT LANGUAGES -->
[19006]89 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ar.Dates.${current.month}" outputProperty="month.ar"/>
90 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ca.Dates.${current.month}" outputProperty="month.ca"/>
91 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="el.Dates.${current.month}" outputProperty="month.el"/>
92 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="es.Dates.${current.month}" outputProperty="month.es"/>
93 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="fr.Dates.${current.month}" outputProperty="month.fr"/>
94 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="lv.Dates.${current.month}" outputProperty="month.lv"/>
95 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="mr.Dates.${current.month}" outputProperty="month.mr"/>
96 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ro.Dates.${current.month}" outputProperty="month.ro"/>
97 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ru.Dates.${current.month}" outputProperty="month.ru"/>
98 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="vi.Dates.${current.month}" outputProperty="month.vi"/>
99 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="zh.Dates.${current.month}" outputProperty="month.zh"/>
100 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="default.Dates.${current.month}" outputProperty="month.default"/>
101
[16242]102 <!--
103 <echo level="info">Current Date</echo>
104 <echo level="info">ar: ${month.ar} ${current.year}</echo>
105 <echo level="info">ca: ${month.el} ${current.year}</echo>
106 <echo level="info">el: ${month.el} ${current.year}</echo>
107 <echo level="info">es: ${month.es} ${current.year}</echo>
108 <echo level="info">fr: ${month.fr} ${current.year}</echo>
109 <echo level="info">lv: ${month.lv} ${current.year}</echo>
110 <echo level="info">mr: ${month.mr} ${current.year}</echo>
111 <echo level="info">ro: ${month.ro} ${current.year}</echo>
112 <echo level="info">ru: ${month.ru} ${current.year}</echo>
113 <echo level="info">vi: ${month.vi} ${current.year}</echo>
114 <echo level="info">zh: ${month.zh} ${current.year}</echo>
115 <echo level="info">default: (${month.default} ${current.year})</echo>
116 -->
[16173]117
118 <!-- CHECKS PRE-CONDITIONS -->
119 <target name="init">
120
121 <!-- version number -->
122 <if>
123 <bool>
124 <not><isset property="version"/></not>
125 </bool>
[17898]126 <fail>Version number not set.
127Check that the file '${rk.name}-build.properties' exists and defines property 'version'.</fail>
[16173]128 </if>
129 <property name="app.version" value="${version}"/>
130
[16681]131 <!-- show important properties -->
132 <echo level="info">Version (version): ${version}</echo>
133 <echo level="info">Branch Path (branch.path): ${branch.path}</echo>
[19152]134 <echo level="info">Date (date): ${date}</echo>
[16681]135 <echo level="info">Current Month (current.month): ${current.month}</echo>
136 <echo level="info">Current Year (current.year): ${current.year}</echo>
[16173]137
138 </target>
139
[17346]140 <target name="strip-svn-dirs">
141 <delete includeemptydirs="true">
142 <fileset dir="${dir}" defaultexcludes="false">
143 <include name="**/.svn/**" />
144 <include name="**/.svn/" />
145 <include name=".svn/**" />
146 <include name=".svn/" />
147 </fileset>
148 </delete>
149 </target>
150
[17589]151 <target name="compile-binary-installer">
152
[19935]153 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-binary.xml" overwrite="true"/>
[19627]154 <dcff file="installer/antinstall-config-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
[19510]155
[19935]156 <copy file="installer/build.xml" tofile="installer/build-binary.xml" overwrite="true"/>
[19627]157 <dcff file="installer/build-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
[19510]158
[19627]159 <installer file="installer/Greenstone-${version}-${os.suffix}.jar"
[17589]160 compress="true"
161 extractType="NonExtractor"
[19627]162 installConfig="installer/antinstall-config-binary.xml"
163 buildFile="installer/build-binary.xml"
[19006]164 antInstallLib="${rk.home}/core/ant-installer/lib"
165 antLib="${rk.home}/core/ant/lib"
[17589]166 validateConfig="true"
167 icons="bluecurve">
168
[19627]169 <zipfileset dir="installer/classes" includes="**/*" />
[19935]170 <zipfileset dir="components" includes="*.lzma"/>
[17589]171
172 </installer>
173
174 </target>
175
[19510]176 <target name="compile-cdrom-installer">
177
[19627]178 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-cdrom.xml"/>
179 <dcff file="installer/antinstall-config-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
[19510]180
[19644]181 <copy file="installer/build.xml" tofile="installer/build-cdrom.xml"/>
[19627]182 <dcff file="installer/build-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
[19510]183
[19627]184 <installer file="installer/cdrom.jar"
[19510]185 compress="true"
186 extractType="NonExtractor"
[19627]187 installConfig="installer/antinstall-config-cdrom.xml"
188 buildFile="installer/build-cdrom.xml"
[19510]189 antInstallLib="${rk.home}/core/ant-installer/lib"
190 antLib="${rk.home}/core/ant/lib"
191 validateConfig="true"
192 icons="bluecurve">
[19627]193 <zipfileset dir="installer/classes" includes="**/*" />
[19510]194 </installer>
195
196 </target>
197
[17704]198 <target name="copy-main-installer-files">
199
200 <mkdir dir="${basedir}/installer/classes"/>
201
202 <!-- the language bundle -->
[17775]203 <native2ascii
204 implementation="sun"
[17781]205 encoding="UTF-8"
[19006]206 src="${rk.home}/core/language-strings"
[17775]207 dest="${basedir}/installer/classes/resources"/>
[17704]208
209 <!-- os- and major version-specific files -->
210 <copy todir="${basedir}/installer/classes" overwrite="true">
211 <fileset dir="${rk.home}/linux/installer-classes" erroronmissingdir="false"/>
212 <fileset dir="${rk.home}/windows/installer-classes" erroronmissingdir="false"/>
213 <fileset dir="${rk.home}/greenstone3/installer-classes" erroronmissingdir="false"/>
214 <fileset dir="${rk.home}/greenstone2/installer-classes" erroronmissingdir="false"/>
215 </copy>
216
217 </target>
218
219 <target name="make-installer-files-concrete">
220
221 <!-- calculate the size of components -->
222 <echo>Calculating the size of some components</echo>
223
224 <!-- core -->
225 <length property="component.bytesize.core-without-jre" mode="all"><fileset file="${basedir}/components/core.comp"/></length>
226 <if><bool><equals arg1="${java.os}" arg2="windows"/></bool>
227 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.windows-java}" datatype="int"/>
228 <else><if><bool><equals arg1="${java.os}" arg2="linux"/></bool>
229 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.linux-java}" datatype="int"/>
230 <else>
231 <property name="component.bytesize.core" value="${component.bytesize.core-without-jre}"/>
232 </else></if></else></if>
233 <math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
234 <property name="component.size.core" value="${component.megabytesize.core} MB"/>
235
236 <!-- imagemagick -->
237 <length property="component.bytesize.imagemagick" mode="all"><fileset file="${basedir}/components/imagemagick.comp"/></length>
238 <math result="component.megabytesize.imagemagick" operand1="${component.bytesize.imagemagick}" operation="/" operand2="1048576" datatype="int"/>
239 <property name="component.size.imagemagick" value="${component.megabytesize.imagemagick} MB"/>
240
241 <!-- ghostscript -->
242 <length property="component.bytesize.ghostscript" mode="all"><fileset file="${basedir}/components/ghostscript.comp"/></length>
243 <math result="component.megabytesize.ghostscript" operand1="${component.bytesize.ghostscript}" operation="/" operand2="1048576" datatype="int"/>
244 <property name="component.size.ghostscript" value="${component.megabytesize.ghostscript} MB"/>
245
246 <!-- tomcat -->
247 <length property="component.bytesize.tomcat" mode="all"><fileset file="${basedir}/components/tomcat.comp"/></length>
248 <math result="component.megabytesize.tomcat" operand1="${component.bytesize.tomcat}" operation="/" operand2="1048576" datatype="int"/>
249 <property name="component.size.tomcat" value="${component.megabytesize.tomcat} MB"/>
250
[19935]251 <!-- make the installer descriptors relevant to the current os -->
[20048]252 <dcff file="installer/antinstall-config.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
253 <dcff file="installer/build.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
[19935]254
[17704]255 <!-- put the concrete values of things in the config -->
[17932]256 <rsr>
257 <fileset dir="${basedir}/installer" includes="*.xml"/>
[17704]258 <job pattern="@version@" replacement="${version}"/>
259 <job pattern="@component.size.core@" replacement="${component.size.core}"/>
260 <job pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
261 <job pattern="@component.size.imagemagick@" replacement="${component.size.imagemagick}"/>
262 <job pattern="@component.size.ghostscript@" replacement="${component.size.ghostscript}"/>
263 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
264 <job pattern="@windows-java.extracted@" replacement="${windows-java.extracted}"/>
265 <job pattern="@linux-java.extracted@" replacement="${linux-java.extracted}"/>
266 </rsr>
267
268 <!-- put the concrete values of things in the text -->
[17932]269 <rsr>
270 <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
[17704]271 <job pattern="@version@" replacement="${version}"/>
272 <job pattern="@version.major@" replacement="${version.major}"/>
273 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
274 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
275 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
276 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
277 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
278 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
279 </rsr>
280
281 </target>
282
[17898]283 <!-- shared target to compile the uninstaller -->
284 <target name="compile-uninstaller">
285 <echo>Compiling Uninstaller</echo>
286
287 <!-- create working build directory -->
288 <mkdir dir="${basedir}/compiled/uninstaller/build/resources" />
289
290 <!-- copile to build -->
291 <javac
[19006]292 srcdir="${rk.home}/core/uninstaller"
[17898]293 destdir="${basedir}/compiled/uninstaller/build" />
294
295 <!-- copy language bundle into place -->
296 <native2ascii
297 implementation="sun"
[19006]298 src="${rk.home}/core/language-strings"
[17898]299 dest="${basedir}/compiled/uninstaller/build/resources"/>
300
301 <!-- jar it all up -->
302 <jar
[18929]303 destfile="${basedir}/compiled/uninst.jar"
[19006]304 manifest="${rk.home}/core/uninstaller/manifest.mf"
[17898]305 basedir="${basedir}/compiled/uninstaller/build" />
306
307 </target>
308
[18929]309 <!-- copy the uninstaller script from the rk to web distribution -->
[17898]310 <target name="insert-uninstaller">
[20112]311
312 <!-- linux and mac -->
313 <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
314 <copy file="${rk.home}/core/uninstaller/Uninstall.sh" todir="distributions/web"/>
315
316 <!-- windows -->
317 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
318 <copy file="${rk.home}/core/uninstaller/Uninstall.sh" todir="distributions/web"/>
319
320 <!-- else fail -->
321 <else>
322 <fail>this target does not support the current os</fail>
323
324 </else></if></else></if>
[17898]325 </target>
326
[17977]327 <!-- unzip windows perl into bin/windows of the given gsdl or gs2build -->
328 <target name="insert-windows-perl">
[19901]329 <mkdir dir="${todir}"/>
330 <delete dir="${todir}/perl"/>
331 <unzip src="${rk.home}/windows/perl.zip" dest="${todir}"/>
[17977]332 </target>
333
[20060]334 <target name="copy-compiled-to-dist">
[19472]335
[19935]336 <!-- windows -->
337 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
[20060]338 <delete dir="distributions/web"/>
339 <mkdir dir="distributions"/>
340 <copy todir="distributions/web">
341 <fileset dir="compiled" includes="**/*"/>
[19935]342 </copy>
[19472]343
[20060]344 <!-- linux, mac -->
[19935]345 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
346 <delete dir="distributions/web"/>
347 <mkdir dir="distributions"/>
348 <exec executable="cp"><arg line="-r compiled distributions/web"/></exec>
[19472]349
[19935]350 <!-- else fail -->
351 <else>
352 <fail>this target does not support the current os</fail>
[19472]353
[19935]354 </else></if></else></if>
[19472]355
356 </target>
357
358
[16173]359</project>
Note: See TracBrowser for help on using the repository browser.