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

Last change on this file since 17842 was 17842, checked in by oranfry, 12 years ago

do replacements in new chinese language strings

File size: 21.1 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk-init">
3
4 <!-- load in static properties from build.properties -->
5 <property file="build.properties" />
6
7 <!-- CONSTANTS (overridable in build.properties) -->
8
9 <!-- svn root -->
10 <property name="svn.root" value="http://svn.greenstone.org" />
11
12 <!-- default revision and branch path -->
13 <property name="branch.path" value="trunk" />
14 <property name="branch.revision" value="HEAD" />
15
16 <!-- the minimum version of java which the installer should be run with (this gets used in search4j) -->
17 <property name="java.min.version" value="1.4.0_00"/>
18
19 <!-- create a localised basedir property -->
20 <path id="basedir.path"><pathelement location="${basedir}"/></path>
21 <property name="basedir.local" refid="basedir.path"/>
22
23 <!-- current date and time -->
24 <tstamp>
25 <format property="current.month" pattern="MMM"/>
26 <format property="current.year" pattern="yyyy"/>
27 </tstamp>
28
29 <!-- BUNDLED JAVA INFO -->
30 <!-- the bundled javas are kept in shared/linux/wrapper and shared/windows/wrapper in the repository -->
31 <!-- change this info when the bundled version changes -->
32 <!-- linux -->
33 <property name="linux-java.installer" value="jre_bin"/>
34 <property name="bundled.version.linux-java" value="1.6.0_05"/> <!-- set this to the version number of java in the above archive -->
35 <property name="linux-java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
36 <property name="component.bytesize.linux-java" value="101245987"/> <!-- set this to the size of the extract archive -->
37
38 <!-- windows -->
39 <property name="windows-java.installer" value="jre.exe"/>
40 <property name="bundled.version.windows-java" value="1.6.0_07"/> <!-- set this to the version number of java in the above archive -->
41 <property name="windows-java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
42 <property name="component.bytesize.windows-java" value="75000000"/> <!-- set this to the size of the extract archive -->
43
44 <!-- version numbers of other bundled things -->
45 <property name="bundled.version.imagemagick" value="6.4.3"/>
46 <property name="bundled.version.ghostscript" value="8.63"/>
47 <property name="bundled.version.tomcat" value="5.5.25"/>
48 <property name="bundled.version.ant" value="1.6.5"/>
49
50 <!-- CLASSPATH -->
51 <path id="project.classpath">
52
53 <!-- our classes -->
54 <fileset dir="${rk.home}/ant-scripts/tasks">
55 <include name="**/*.jar"/>
56 </fileset>
57
58 <!-- jars in lib directory -->
59 <fileset dir="${rk.home}/lib">
60 <include name="*.jar"/>
61 </fileset>
62
63 <!-- a few ant-installer jars -->
64 <fileset dir="${rk.home}/packages/ant-installer/lib">
65 <include name="ant-installer-ext.jar"/>
66 <include name="ant-installer.jar"/>
67 </fileset>
68
69 </path>
70
71 <!-- SELF DEFINED TASKS AND TYPES -->
72 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
73 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
74 <taskdef name="math" classname="ise.antelope.tasks.MathTask" classpathref="project.classpath"/>
75 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
76 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
77 <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>
78 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
79 <typedef name="dcff" classname="org.greenstone.anttasks.DeleteChunkFromFile" classpathref="project.classpath"/>
80 <typedef name="rsplit" classname="org.greenstone.anttasks.SplitResource" classpathref="project.classpath"/>
81 <typedef name="get-property-value" classname="org.greenstone.anttasks.GetPropertyValue" classpathref="project.classpath"/>
82
83 <!-- DATES IN DIFFERENT LANGUAGES -->
84 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="ar.Dates.${current.month}" outputProperty="month.ar"/>
85 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="ca.Dates.${current.month}" outputProperty="month.ca"/>
86 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="el.Dates.${current.month}" outputProperty="month.el"/>
87 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="es.Dates.${current.month}" outputProperty="month.es"/>
88 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="fr.Dates.${current.month}" outputProperty="month.fr"/>
89 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="lv.Dates.${current.month}" outputProperty="month.lv"/>
90 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="mr.Dates.${current.month}" outputProperty="month.mr"/>
91 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="ro.Dates.${current.month}" outputProperty="month.ro"/>
92 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="ru.Dates.${current.month}" outputProperty="month.ru"/>
93 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="vi.Dates.${current.month}" outputProperty="month.vi"/>
94 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="zh.Dates.${current.month}" outputProperty="month.zh"/>
95 <get-property-value propertiesFile="${rk.home}/lib/dates.properties" propertyName="default.Dates.${current.month}" outputProperty="month.default"/>
96 <!--
97 <echo level="info">Current Date</echo>
98 <echo level="info">ar: ${month.ar} ${current.year}</echo>
99 <echo level="info">ca: ${month.el} ${current.year}</echo>
100 <echo level="info">el: ${month.el} ${current.year}</echo>
101 <echo level="info">es: ${month.es} ${current.year}</echo>
102 <echo level="info">fr: ${month.fr} ${current.year}</echo>
103 <echo level="info">lv: ${month.lv} ${current.year}</echo>
104 <echo level="info">mr: ${month.mr} ${current.year}</echo>
105 <echo level="info">ro: ${month.ro} ${current.year}</echo>
106 <echo level="info">ru: ${month.ru} ${current.year}</echo>
107 <echo level="info">vi: ${month.vi} ${current.year}</echo>
108 <echo level="info">zh: ${month.zh} ${current.year}</echo>
109 <echo level="info">default: (${month.default} ${current.year})</echo>
110 -->
111
112 <!-- CHECKS PRE-CONDITIONS -->
113 <target name="init">
114
115 <!-- version number -->
116 <if>
117 <bool>
118 <not><isset property="version"/></not>
119 </bool>
120 <fail>Version number not set</fail>
121 </if>
122 <property name="app.version" value="${version}"/>
123
124 <!-- execute target code or just show the tree -->
125 <if>
126 <bool>
127 <not><isset property="execute"/></not>
128 </bool>
129 <property name="execute" value="true"/>
130 <else>
131 <if>
132 <bool>
133 <and>
134 <not><equals arg1="${execute}" arg2="true"/></not>
135 <not><equals arg1="${execute}" arg2="false"/></not>
136 </and>
137 </bool>
138 <echo level="error">You have not specified a valid value for execute.</echo>
139 <echo level="error">Valid values are 'true' and 'false'.</echo>
140 <fail>You have not specified a valid value for execute.</fail>
141 </if>
142 </else>
143 </if>
144
145 <!-- show important properties -->
146 <echo level="info">Version (version): ${version}</echo>
147 <echo level="info">Branch Path (branch.path): ${branch.path}</echo>
148 <echo level="info">Current Month (current.month): ${current.month}</echo>
149 <echo level="info">Current Year (current.year): ${current.year}</echo>
150
151 </target>
152
153 <target name="strip-svn-dirs">
154 <delete includeemptydirs="true">
155 <fileset dir="${dir}" defaultexcludes="false">
156 <include name="**/.svn/**" />
157 <include name="**/.svn/" />
158 <include name=".svn/**" />
159 <include name=".svn/" />
160 </fileset>
161 </delete>
162 </target>
163
164 <target name="compile-binary-installer">
165
166 <copy file="${basedir}/installer/antinstall-config.xml" tofile="${basedir}/installer/antinstall-config-binary.xml"/>
167 <dcff file="${basedir}/installer/antinstall-config-binary.xml" startTag=".*&lt;!-- start source release --&gt;.*" endTag=".*&lt;!-- end source release --&gt;.*" />
168 <installer file="${basedir}/installer/Greenstone-${version}-${os.suffix}.jar"
169 compress="true"
170 extractType="NonExtractor"
171 installConfig="${basedir}/installer/antinstall-config-binary.xml"
172 buildFile="${basedir}/installer/build.xml"
173 antInstallLib="${rk.home}/packages/ant-installer/lib"
174 antLib="${rk.home}/packages/ant/lib"
175 validateConfig="true"
176 icons="bluecurve">
177
178 <zipfileset dir="${basedir}/installer/classes" includes="**/*" />
179 <zipfileset dir="${basedir}/components" includes="*.lzma" excludes="source-release.lzma" />
180
181 </installer>
182
183 </target>
184
185 <target name="compile-minimal-installer">
186
187 <copy file="${basedir}/installer/antinstall-config.xml" tofile="${basedir}/installer/antinstall-config-minimal.xml"/>
188 <dcff file="${basedir}/installer/antinstall-config-minimal.xml" startTag=".*&lt;!-- start source release --&gt;.*" endTag=".*&lt;!-- end source release --&gt;.*" />
189 <dcff file="${basedir}/installer/antinstall-config-minimal.xml" startTag=".*&lt;!-- start bundled components --&gt;.*" endTag=".*&lt;!-- end bundled components --&gt;.*" />
190 <installer file="${basedir}/installer/Greenstone-${version}-${os.suffix}-minimal.jar"
191 compress="true"
192 extractType="NonExtractor"
193 installConfig="${basedir}/installer/antinstall-config-minimal.xml"
194 buildFile="${basedir}/installer/build.xml"
195 antInstallLib="${rk.home}/packages/ant-installer/lib"
196 antLib="${rk.home}/packages/ant/lib"
197 validateConfig="true"
198 icons="bluecurve">
199
200 <zipfileset dir="${basedir}/installer/classes" includes="**/*" />
201 <zipfileset dir="${basedir}/components" includes="core.lzma" />
202 </installer>
203
204 </target>
205
206 <target name="compile-source-installer">
207
208 <copy file="${basedir}/installer/antinstall-config.xml" tofile="${basedir}/installer/antinstall-config-source.xml"/>
209 <dcff file="${basedir}/installer/antinstall-config-source.xml" startTag=".*&lt;!-- start binary release --&gt;.*" endTag=".*&lt;!-- end binary release --&gt;.*" />
210 <installer file="${basedir}/installer/Greenstone-${version}-${os.suffix}-source.jar"
211 compress="true"
212 extractType="NonExtractor"
213 installConfig="${basedir}/installer/antinstall-config-source.xml"
214 buildFile="${basedir}/installer/build.xml"
215 antInstallLib="${rk.home}/packages/ant-installer/lib"
216 antLib="${rk.home}/packages/ant/lib"
217 validateConfig="true"
218 icons="bluecurve">
219
220 <zipfileset dir="${basedir}/installer/classes" includes="**/*" />
221 <zipfileset dir="${basedir}/components" includes="source-release.lzma" />
222 </installer>
223
224 </target>
225
226 <target name="copy-web-to-source">
227 <copy todir="distributions/source"><fileset dir="distributions/web"/></copy>
228 </target>
229
230 <target name="copy-main-installer-files">
231
232 <mkdir dir="${basedir}/installer/classes"/>
233
234 <!-- the installer descriptors -->
235 <copy todir="${basedir}/installer" file="${rk.home}/installer/antinstall-config.xml" overwrite="true" />
236 <copy todir="${basedir}/installer" file="${rk.home}/installer/build.xml" overwrite="true" />
237
238 <!-- the language bundle -->
239 <native2ascii
240 implementation="sun"
241 encoding="UTF-8"
242 src="${rk.home}/language-strings"
243 dest="${basedir}/installer/classes/resources"/>
244
245 <!-- os- and major version-specific files -->
246 <copy todir="${basedir}/installer/classes" overwrite="true">
247 <fileset dir="${rk.home}/linux/installer-classes" erroronmissingdir="false"/>
248 <fileset dir="${rk.home}/windows/installer-classes" erroronmissingdir="false"/>
249 <fileset dir="${rk.home}/greenstone3/installer-classes" erroronmissingdir="false"/>
250 <fileset dir="${rk.home}/greenstone2/installer-classes" erroronmissingdir="false"/>
251 </copy>
252
253 </target>
254
255 <target name="make-installer-files-concrete">
256
257 <!-- calculate the size of components -->
258 <echo>Calculating the size of some components</echo>
259
260 <!-- core -->
261 <length property="component.bytesize.core-without-jre" mode="all"><fileset file="${basedir}/components/core.comp"/></length>
262 <if><bool><equals arg1="${java.os}" arg2="windows"/></bool>
263 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.windows-java}" datatype="int"/>
264 <else><if><bool><equals arg1="${java.os}" arg2="linux"/></bool>
265 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.linux-java}" datatype="int"/>
266 <else>
267 <property name="component.bytesize.core" value="${component.bytesize.core-without-jre}"/>
268 </else></if></else></if>
269 <math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
270 <property name="component.size.core" value="${component.megabytesize.core} MB"/>
271
272 <!-- sourcecode core -->
273 <length property="component.bytesize.sourcecode-core" mode="all"><fileset file="${basedir}/components/sourcecode-core.comp"/></length>
274 <math result="component.megabytesize.sourcecode-core" operand1="${component.bytesize.sourcecode-core}" operation="/" operand2="1048576" datatype="int"/>
275 <property name="component.size.sourcecode-core" value="${component.megabytesize.sourcecode-core} MB"/>
276
277 <!-- sourcecode -->
278 <length property="component.bytesize.sourcecode" mode="all"><fileset file="${basedir}/components/sourcecode.comp"/></length>
279 <math result="component.megabytesize.sourcecode" operand1="${component.bytesize.sourcecode}" operation="/" operand2="1048576" datatype="int"/>
280 <property name="component.size.sourcecode" value="${component.megabytesize.sourcecode} MB"/>
281
282 <!-- imagemagick -->
283 <length property="component.bytesize.imagemagick" mode="all"><fileset file="${basedir}/components/imagemagick.comp"/></length>
284 <math result="component.megabytesize.imagemagick" operand1="${component.bytesize.imagemagick}" operation="/" operand2="1048576" datatype="int"/>
285 <property name="component.size.imagemagick" value="${component.megabytesize.imagemagick} MB"/>
286
287 <!-- ghostscript -->
288 <length property="component.bytesize.ghostscript" mode="all"><fileset file="${basedir}/components/ghostscript.comp"/></length>
289 <math result="component.megabytesize.ghostscript" operand1="${component.bytesize.ghostscript}" operation="/" operand2="1048576" datatype="int"/>
290 <property name="component.size.ghostscript" value="${component.megabytesize.ghostscript} MB"/>
291
292 <!-- tomcat -->
293 <length property="component.bytesize.tomcat" mode="all"><fileset file="${basedir}/components/tomcat.comp"/></length>
294 <math result="component.megabytesize.tomcat" operand1="${component.bytesize.tomcat}" operation="/" operand2="1048576" datatype="int"/>
295 <property name="component.size.tomcat" value="${component.megabytesize.tomcat} MB"/>
296
297 <!-- ant -->
298 <length property="component.bytesize.ant" mode="all"><fileset file="${basedir}/components/ant.comp"/></length>
299 <math result="component.megabytesize.ant" operand1="${component.bytesize.ant}" operation="/" operand2="1048576" datatype="int"/>
300 <property name="component.size.ant" value="${component.megabytesize.ant} MB"/>
301
302 <!-- put the concrete values of things in the config -->
303 <rsr file="${basedir}/installer/antinstall-config.xml">
304 <job pattern="@version@" replacement="${version}"/>
305 <job pattern="@component.size.core@" replacement="${component.size.core}"/>
306 <job pattern="@component.size.sourcecode-core@" replacement="${component.size.sourcecode-core}"/>
307 <job pattern="@component.size.sourcecode@" replacement="${component.size.sourcecode}"/>
308 <job pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
309 <job pattern="@component.size.ant@" replacement="${component.size.ant}"/>
310 <job pattern="@component.size.imagemagick@" replacement="${component.size.imagemagick}"/>
311 <job pattern="@component.size.ghostscript@" replacement="${component.size.ghostscript}"/>
312 </rsr>
313
314 <rsr file="${basedir}/installer/build.xml">
315 <job pattern="@version@" replacement="${version}"/>
316 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
317 <job pattern="@windows-java.extracted@" replacement="${windows-java.extracted}"/>
318 <job pattern="@linux-java.extracted@" replacement="${linux-java.extracted}"/>
319 </rsr>
320
321 <!-- put the concrete values of things in the text -->
322
323 <!-- default -->
324 <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties">
325 <job pattern="@version@" replacement="${version}"/>
326 <job pattern="@version.major@" replacement="${version.major}"/>
327 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
328 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
329 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
330 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
331 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
332 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
333 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
334 </rsr>
335
336 <!-- es -->
337 <rsr file="${basedir}/installer/classes/resources/LanguagePack_es.properties">
338 <job pattern="@version@" replacement="${version}"/>
339 <job pattern="@version.major@" replacement="${version.major}"/>
340 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
341 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
342 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
343 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
344 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
345 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
346 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
347 </rsr>
348
349 <!-- es_EU -->
350 <rsr file="${basedir}/installer/classes/resources/LanguagePack_es_EU.properties">
351 <job pattern="@version@" replacement="${version}"/>
352 <job pattern="@version.major@" replacement="${version.major}"/>
353 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
354 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
355 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
356 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
357 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
358 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
359 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
360 </rsr>
361
362 <!-- de -->
363 <rsr file="${basedir}/installer/classes/resources/LanguagePack_de.properties">
364 <job pattern="@version@" replacement="${version}"/>
365 <job pattern="@version.major@" replacement="${version.major}"/>
366 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
367 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
368 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
369 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
370 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
371 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
372 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
373 </rsr>
374
375 <!-- fr -->
376 <rsr file="${basedir}/installer/classes/resources/LanguagePack_fr.properties">
377 <job pattern="@version@" replacement="${version}"/>
378 <job pattern="@version.major@" replacement="${version.major}"/>
379 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
380 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
381 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
382 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
383 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
384 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
385 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
386 </rsr>
387
388 <!-- zh -->
389 <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh.properties">
390 <job pattern="@version@" replacement="${version}"/>
391 <job pattern="@version.major@" replacement="${version.major}"/>
392 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
393 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
394 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
395 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
396 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
397 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
398 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
399 </rsr>
400
401
402 </target>
403
404</project>
Note: See TracBrowser for help on using the repository browser.