source: main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml@ 37345

Last change on this file since 37345 was 37345, checked in by kjdon, 14 months ago

use --non-interactive and --trust-server-cert options to svn so that we don't need to manually accept the certificate every 3 months (and which causes the build to fail when it hasn't been done)

File size: 16.3 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk3-compile">
3
4
5 <target name="compile">
6
7 <!-- checkout greenstone3 -->
8 <exec executable="svn">
9 <arg line="${global-svn-args}"/>
10 <arg value="checkout"/>
11 <arg value="${svn.root}/main/${branch.path}/greenstone3"/>
12 <arg value="compiled"/>
13 <arg value="-r"/><arg value="${branch.revision}"/>
14 </exec>
15
16 <!-- Comment out any active checkout.gnomelib.ext=true line in build.properties.svn
17 So that the release-kits go back to behaving how they did when the line
18 used to be commented out by default in build properties.
19 For alternative ways to achieve this, see
20 https://jeeva-paramasamy.blogspot.com/2012/07/removeunset-property-in-property-file.html
21 Further options in the propertyfile task https://ant.apache.org/manual/Tasks/propertyfile.html
22 -->
23 <!--<if><bool><equals arg1="${checkout.gnomelib.ext}" arg2="true"/></bool>-->
24 <echo>Release-kit is running, which turns on use.gnomelib.ext, so commenting out checkout.gnomelib.ext=true to deactivate it.</echo>
25 <rsr file="${basedir}/compiled/build.properties.svn" pattern="checkout.gnomelib.ext=true" replacement="#checkout.gnomelib.ext=true"/>
26 <!--</if>-->
27
28 <if><bool><equals arg1="${with.jni}" arg2="false"/></bool>
29 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.jni=true" replacement="#with.jni=true"/>
30 </if>
31
32 <if><bool><equals arg1="${with.gli.and.gems}" arg2="false"/></bool>
33 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.gli.and.gems=true" replacement="#with.gli.and.gems=true"/>
34 </if>
35
36 <!-- make sure all c++ compilation is done statically on linux -->
37 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
38 <property name="forward.compile.static" value="true"/>
39 </if>
40
41 <!-- make sure the c++ compilation can see the support library in the extension folder -->
42 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
43 <property name="forward.use.gnomelib.ext" value="true"/>
44 </if>
45
46 <antcall target="persist-forwarded-properties">
47 <param name="greenstone3basedir" value="compiled"/>
48 </antcall>
49
50 <!-- run greenstone3's ant prepare -->
51 <ant dir="compiled" inheritAll="false">
52 <target name="prepare"/>
53 <propertyset refid="forward.properties"/>
54 <property name="properties.accepted" value="true"/>
55 <property name="global-svn-args" value="${global-svn-args}"/>
56 </ant>
57
58 <!-- set all version numbers -->
59 <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
60 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli"/></antcall>
61 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="compiled/gs2build"/></antcall>
62
63 <!-- mac or linux: compile the support library -->
64 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
65 <!-- checkout the gnome support library extension-->
66
67 <!-- For Lions, need a specific gnome-lib-minimal tar file. The file name contains darwin12 for Lion, it contains the os.shell name (darwin/linux) for other cases.
68 Mac OS X v10.7.4 onwards is Lion/Mountain Lion, different from Leopard/Snow Leopard. See http://en.wikipedia.org/wiki/Darwin_(operating_system) -->
69 <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}">
70 <and>
71 <contains string="${os.shell}" substring="darwin" casesensitive="false"/>
72 <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
73 </and>
74 </condition>
75
76 <if><bool><or>
77 <equals arg1="${post.2.83.version}" arg2="true"/>
78 </or></bool>
79 <echo>EXPORTING GNOME LIB EXTENSION</echo>
80 <exec executable="svn">
81 <arg line="${global-svn-args}"/>
82 <arg value="export"/>
83 <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
84 <arg value="${basedir}/compiled/ext/gnome-lib-${specific.os.type}.tar.gz"/>
85 </exec>
86
87 <exec executable="tar" dir="${basedir}/compiled/ext">
88 <arg value="xvzf"/>
89 <arg value="gnome-lib-${specific.os.type}.tar.gz"/>
90 </exec>
91
92 <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
93 <arg value="-c"/>
94 <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
95 </exec>
96 <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
97 </if>
98 </if>
99
100 <!-- <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-fPIC "/> -->
101
102 <!-- run greenstone3's ant install and ant dist-tidy -->
103 <ant dir="compiled" inheritAll="false">
104 <target name="install"/>
105 <target name="dist-tidy"/>
106 <propertyset refid="forward.properties"/>
107 <property name="properties.accepted" value="true"/>
108 <property name="properties.keep.src" value="${keep.src}"/>
109 <property name="global-svn-args" value="${global-svn-args}"/>
110 </ant>
111
112 <!-- Delete all collections apart from the Lucene demo collection -->
113 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
114 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
115 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
116 <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>
117
118 <!-- Delete the entire gnome support library on Linux -->
119 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
120 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
121 <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
122 </if>
123
124 <!-- Delete all but the lib folder of the gnome support library on Mac,
125 then move this smaller gnome-lib-minimal dir from the top-level ext folder
126 to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
127 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
128 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
129 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
130 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
131 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
132 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
133 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
134 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
135 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
136 <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
137 <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
138 </if>
139
140 <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
141 <delete dir="${basedir}/compiled/ext/solr/lib3" />
142 <delete dir="${basedir}/compiled/ext/solr/conf3" />
143 <delete dir="${basedir}/compiled/ext/solr/etc3" />
144
145
146 <if><bool><and>
147 <equals arg1="${rk.os}" arg2="linux"/>
148 <equals arg1="${extension-x64}" arg2="-x64"/>
149 </and></bool>
150 <property name="bitness" value="64"/>
151 <else>
152 <property name="bitness" value="32"/>
153 </else>
154 </if>
155
156 <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
157 For Linux 64 bit, use the 64 bit versions.
158 For other *nix cases, including Macs, we stick to the 32 bit
159 versions since there have been no problems yet, probably
160 because our Mac has 5.12 which is not included in
161 XML-Parser so that our mac then tries to find the xml
162 parser on the system.-->
163 <if><bool><not><equals arg1="${rk.os}" arg2="windows"/></not></bool>
164 <copy todir="compiled/gs2build/perllib/cpan">
165 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
166 </copy>
167 <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
168 </if>
169
170 <!-- insert ant -->
171 <property name="insert.ant.version" value="1.9.13"/> <!-- value="1.8.2" -->
172 <mkdir dir="compiled/packages"/>
173 <!--<get src="http://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>-->
174 <exec executable="wget" failonerror="true">
175 <arg value="-P"/>
176 <arg value="compiled/packages"/>
177 <arg value="--no-check-certificate"/>
178 <arg value="https://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz"/>
179 </exec>
180 <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
181 <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
182 <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
183
184 <!-- put the uninstaller in place -->
185 <antcall target="insert-and-compile-uninstaller"/>
186
187 <!-- (windows only) -->
188 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
189 <!-- insert perl -->
190 <!--<unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>-->
191 <exec executable="svn" dir="compiled/gs2build/bin/windows">
192 <arg line="${global-svn-args}"/>
193 <arg value="export"/>
194 <arg value="${svn.root}/main/trunk/release-kits/shared/windows/perl.zip"/>
195 </exec>
196 <unzip src="compiled/gs2build/bin/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
197 <delete failonerror="false" file="compiled/gs2build/bin/windows/perl.zip" />
198 </if>
199
200 <!-- minify tomcat -->
201 <delete dir="compiled/packages/tomcat/webapps/docs"/>
202 <delete dir="compiled/packages/tomcat/webapps/examples"/>
203
204 <!-- tidy up gli to make it smaller -->
205 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
206
207 <!-- strip out .svn dirs -->
208 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
209
210 <!-- get rid of bin/formatconverter on windows and get rid of bin/formatconverter.exe on linux/mac. Now we have specific OS dirs, so get rid of the irrelevant OS dirs instead -->
211 <if>
212 <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
213 <delete dir="compiled/bin/darwin"/>
214 <delete dir="compiled/bin/linux"/>
215 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
216 <delete dir="compiled/bin/windows"/>
217 <delete dir="compiled/bin/linux"/>
218 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
219 <delete dir="compiled/bin/windows"/>
220 <delete dir="compiled/bin/darwin"/>
221 </if></else>
222 </if></else>
223 </if>
224
225 <!-- (linux only) -->
226 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
227 <!-- grab imagemagick binaries -->
228 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
229
230 <exec executable="svn">
231 <arg line="${global-svn-args}"/>
232 <arg value="export"/>
233 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
234 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
235 </exec>
236
237 <exec executable="tar" dir="compiled/ext">
238 <arg value="xvzf"/>
239 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
240 </exec>
241 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
242 <move todir="compiled/gs2build/bin/linux/imagemagick">
243 <fileset dir="compiled/ext/imagemagick/linux"/>
244 </move>
245 <delete dir="compiled/ext/imagemagick"/>
246
247 <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
248 <exec executable="svn">
249 <arg line="${global-svn-args}"/>
250 <arg value="export"/>
251 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
252 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
253 </exec>-->
254
255 <!-- We don't want to bundle the old pre-compiled 32 bit wv folder anymore -->
256 <!-- grab wv binaries -->
257 <!--<delete dir="compiled/gs2build/bin/linux/wv"/>
258 <exec executable="svn">
259 <arg line="${global-svn-args}"/>
260 <arg value="export"/>
261 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
262 <arg value="compiled/gs2build/bin/linux/wv"/>
263 </exec>
264 -->
265 <!-- (mac only) -->
266 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
267 <!-- grab imagemagick binaries -->
268
269 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
270
271 <!--<exec executable="svn">
272 <arg line="${global-svn-args}"/>
273 <arg value="export"/>
274 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
275 <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
276 </exec>
277
278 <exec executable="tar" dir="compiled/ext">
279 <arg value="xvzf"/>
280 <arg value="imagemagick-darwin-10.5.tar.gz"/>
281 </exec>
282 <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
283 <move todir="compiled/gs2build/bin/darwin/imagemagick">
284 <fileset dir="compiled/ext/imagemagick/darwin"/>
285 </move>
286 <delete dir="compiled/ext/imagemagick"/>-->
287
288 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
289 <exec executable="svn">
290 <arg line="${global-svn-args}"/>
291 <arg value="export"/>
292 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
293 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
294 </exec>
295
296 <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
297 <!-- grab ghostscript binaries -->
298 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
299 <exec executable="svn">
300 <arg line="${global-svn-args}"/>
301 <arg value="export"/>
302 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
303 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
304 </exec>
305 </if>
306 </if></else></if>
307
308 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
309 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
310 <arg line="-S"/>
311 <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
312 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
313 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
314 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
315 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
316 <env key="GSDLOS" value="windows"/>
317 <env key="PERL_PERTURB_KEYS" value="0"/>
318 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
319 </exec>
320 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
321 <arg line="-S"/>
322 <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
323 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
324 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
325 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
326 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
327 <env key="GSDLOS" value="windows"/>
328 <env key="PERL_PERTURB_KEYS" value="0"/>
329 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
330 </exec>
331 <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
332 <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
333 <else>
334 <echo file="${basedir}/compiled/buildscript.sh">
335 #!/bin/bash
336 source gs3-setup.sh
337 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
338 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
339 rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
340 mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
341 </echo>
342 <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
343 <exec dir="${basedir}/compiled" executable="/bin/bash">
344 <arg line="buildscript.sh"/>
345 </exec>
346 <delete file="${basedir}/compiled/buildscript.sh"/>
347 </else>
348 </if>
349
350 </target>
351
352</project>
Note: See TracBrowser for help on using the repository browser.