root/main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml @ 24761

Revision 24761, 22.3 KB (checked in by ak19, 8 years ago)

Need the org.apache.xerces files in gli/jar folder making the jar files, so that the GLI applet still works. Trying to not delete gli/jar after calling makejar, in case this helps.

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk2-compile">
3
4    <target name="compile" depends="init,gs2-init">
5    <!-- checkout greenstone2 (or gsdl if a pre-2.84 release is being created) and gli -->
6        <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
7            <exec executable="svn">
8                <arg value="checkout"/>
9                <arg value="${svn.root}/main/${branch.path}/greenstone2"/>
10                <arg value="${basedir}/compiled"/>
11            </exec>       
12            <else>
13                <exec executable="svn">
14                    <arg value="checkout"/>
15                    <arg value="${svn.root}/main/${branch.path}/gsdl"/>
16                    <arg value="${basedir}/compiled"/>
17                </exec>
18            </else>
19        </if>
20       
21        <exec executable="svn">
22            <arg value="checkout"/>
23            <arg value="${svn.root}/main/${branch.path}/gli"/>
24            <arg value="${basedir}/compiled/gli"/>
25        </exec>
26
27        <!-- drop in documentation -->
28        <copy todir="compiled" overwrite="true">
29            <fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>
30        </copy>
31
32        <!-- set version numbers -->
33        <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
34        <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/compiled/gli"/></antcall>
35
36        <!-- we do not want the *.app folders if we are not mac-->
37        <if><bool><not><equals arg1="${rk.os}" arg2="mac"/></not></bool>
38            <delete dir="${basedir}/compiled/client-gli.app"/>
39            <delete dir="${basedir}/compiled/gems.app"/>
40            <delete dir="${basedir}/compiled/gs2-server.app"/>
41            <delete dir="${basedir}/compiled/gli.app"/>
42        </if>
43
44        <!-- mac or linux: get the support library -->
45        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
46            <!-- svn export the gnome support library extension-->
47            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
48                <echo>EXPORTING GNOME LIB EXTENSION</echo>
49                <exec executable="svn">
50                    <arg value="export"/>
51                    <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${os.shell}${arch}${extension-x64}.tar.gz"/>
52                    <arg value="${basedir}/compiled/ext/gnome-lib-minimal-${os.shell}.tar.gz"/>
53                </exec>
54
55                <exec executable="tar" dir="${basedir}/compiled/ext">
56                    <arg value="xvzf"/>
57                    <arg value="gnome-lib-minimal-${os.shell}.tar.gz"/>
58                </exec>
59
60                <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
61                    <arg value="-c"/>
62                    <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
63                </exec>
64               
65                <echo>DONE EXTRACTING GNOME LIB EXTENSION</echo>
66            </if>
67        </if>
68
69        <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
70            <!-- LD_LIBRARY_PATH is DYLD_LIBRARY_PATH on mac-->
71            <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
72                <property name="libpathvar" value="DYLD_LIBRARY_PATH"/>
73            <else>
74                <property name="libpathvar" value="LD_LIBRARY_PATH"/>
75            </else>
76            </if>
77
78            <property name="gnome.lib.dir" value="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}"/>
79            <property name="path.arg" value="PATH=&quot;${gnome.lib.dir}/bin:${env.PATH}&quot;"/>
80            <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
81            <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
82            <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
83            <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome.lib.dir}/lib&quot;"/>
84            <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome.lib.dir}/lib/pkgconfig&quot;"/>
85            <property name="ldlpath.arg" value="${libpathvar}=&quot;${gnome.lib.dir}/lib&quot;"/>
86
87            <property name="allargs" value="${path.arg} ${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${pcpath.arg} ${ldlpath.arg}"/>
88        </if>   
89       
90        <!-- windows only -->
91        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
92
93            <!-- unzip packages -->
94            <unzip src="${basedir}/compiled/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/compiled/common-src/packages/windows/crypt"/>
95           
96            <!-- unzip expat if the version is less that 2.84 -->
97            <if><bool><equals arg1="${post.2.83.version}" arg2="false"/></bool>
98                <unzip src="${basedir}/compiled/common-src/packages/windows/expat/expat.zip" dest="${basedir}/compiled/common-src/packages/windows/expat"/>
99            </if>
100           
101            <unzip src="${basedir}/compiled/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/compiled/common-src/packages/windows/stlport"/>
102            <unzip src="${basedir}/compiled/common-src/indexers/packages/windows/iconv/iconv.zip" dest="${basedir}/compiled/common-src/indexers/packages/windows/iconv"/>
103            <untar src="${basedir}/compiled/common-src/packages/sqlite/sqlite-autoconf-3070602.tar.gz" dest="${basedir}/compiled/common-src/packages/sqlite" compression="gzip"/>
104
105            <!-- get winbin from tags if the version is greater than 2.83 otherwise get it from trunk -->
106            <if><bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool>
107                <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
108                   
109                    <exec executable="svn">
110                        <arg value="export"/>
111                        <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
112                        <arg value="${basedir}/compiled/bin/windows"/>
113                        <arg value="-r"/>
114                        <arg value="${branch.revision}"/>
115                    </exec>
116                   
117                    <else>
118                        <exec executable="svn">
119                            <arg value="export"/>
120                            <arg value="${svn.root}/main/trunk/binaries/windows/bin"/>
121                            <arg value="${basedir}/compiled/bin/windows"/>
122                            <arg value="-r"/>
123                            <arg value="${branch.revision}"/>
124                        </exec>
125                    </else>
126                </if>
127            </if>
128
129            <!-- insert windows perl -->
130            <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/bin/windows"/>
131           
132            <exec executable="${basedir}/compiled/bin/windows/gunzip.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
133                <arg value="-d"/>
134                <arg value="httpd-2.2.11-gs.tar.gz"/>
135            </exec>
136               
137            <exec executable="${basedir}/compiled/bin/windows/tar.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
138                <arg value="-xvf"/>
139                <arg value="httpd-2.2.11-gs.tar"/>
140            </exec>
141           
142            <!-- Insert a unique number after every occurrence of the word tempfile to prevent some strange race conditions present on Windows 7 (iuv = InsertUniqueValue) -->
143            <iuv>
144                <fileset dir="${basedir}/compiled/runtime-src/packages/apache-httpd/httpd-2.2.11" includes="**/*.mak"/>
145                <job pattern="tempfile"/>
146            </iuv>
147           
148            <!-- compile c code -->
149            <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>
150            <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>
151            <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>
152            <delete><fileset dir="${basedir}/compiled/apache-httpd" includes="**/*.pdb"/></delete>
153
154            <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/bin/Microsoft.VC80.CRT.manifest"/>
155            <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/lib/Microsoft.VC80.CRT.manifest"/>
156            <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/modules/Microsoft.VC80.CRT.manifest"/>
157            <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/bin/msvcr80.dll"/>
158            <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/lib/msvcr80.dll"/>
159            <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/modules/msvcr80.dll"/>
160           
161            <mkdir dir="products"/>
162            <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}${version-extra}.exe"/>
163            <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>
164
165
166        <!-- linux only -->
167        <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
168            <!-- add static to configure.in -->
169            <rsr file="${basedir}/compiled/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
170            <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure">
171                <arg value="configure.in"/>
172            </exec>
173
174            <!-- set environment in packages/configure -->
175            <rsr file="${basedir}/compiled/common-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
176            <rsr file="${basedir}/compiled/build-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
177
178            <!-- run configure -->
179            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
180                <arg line="--enable-apache-httpd"/>
181                <arg line="${allargs}"/>
182            </exec>
183
184            <!-- add -static to makefiles -->
185            <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
186            <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
187            <rsr file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static"/>
188
189        <!-- mac only -->
190        <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
191            <!-- run configure -->
192            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
193                <arg line="--enable-apache-httpd"/>
194                <arg line="${allargs}"/>
195            </exec>
196
197            <!-- tweak makefiles -->
198            <rsr file="${basedir}/compiled/runtime-src/src/recpt/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3"/>
199            <rsr file="${basedir}/compiled/runtime-src/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3"/>
200
201        </if></else></if></else></if>
202
203        <!-- mac and linux: compile -->
204        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
205            <!-- make -->
206            <exec dir="${basedir}/compiled" executable="make" failonerror="true">
207                <arg line="${ldlpath.arg}"/>
208            </exec>
209
210            <!-- make install -->
211            <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
212
213            <!-- make apache-for-dist -->
214            <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
215
216            <!-- strip executables -->
217            <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
218                <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
219            </exec>
220           
221            <copy todir="${basedir}/compiled/lib/${os.shell}">
222                <fileset dir="${basedir}/compiled/common-src/packages/sqlite/lib" includes="*.dylib"/>
223            </copy>
224        </if>
225
226        <!-- Delete all but the lib folder and the setup.bash script of the gnome support library -->
227        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
228            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}/bin"/>
229            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}/include"/>
230            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
231            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/devel.bash"/>
232            <delete file="${basedir}/compiled/ext/gnome-lib-minimal-${os.shell}.tar.gz"/>
233        </if>
234
235        <!-- insert the necessary additional xml parser versions-->
236        <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
237            <!-- Add the 5.6 version if necessary -->
238            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.6"/></not></bool>
239                <copy todir="${basedir}/compiled/perllib/cpan">
240                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.6,perl-5.6/**/*"/>
241                </copy>
242            </if>
243           
244            <!-- Add the 5.8 version if necessary -->
245            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8"/></not></bool>
246                <copy todir="${basedir}/compiled/perllib/cpan">
247                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8,perl-5.8/**/*"/>
248                </copy>
249            </if>
250           
251            <!-- Add the 5.8 mutlithreaded version if necessary -->
252            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8-mt"/></not></bool>
253                <copy todir="${basedir}/compiled/perllib/cpan">
254                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8-mt,perl-5.8-mt/**/*"/>
255                </copy>
256            </if>
257           
258            <!-- Add the 5.10 version if necessary -->
259            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.10"/></not></bool>
260                <copy todir="${basedir}/compiled/perllib/cpan">
261                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.10,perl-5.10/**/*"/>
262                </copy>
263            </if>
264        </if>
265
266        <!-- compile gli -->
267        <!-- (linux and mac) -->
268        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
269            <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makegli.sh"/></exec>
270            <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makejar.sh"/></exec>
271        <!-- windows -->
272        <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
273            <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makegli.bat"/></exec>
274            <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makejar.bat"/></exec>
275        </if></else></if>
276
277        <!-- need the org.apache.xerces files in gli/jar folder making the jar files,
278            so that the GLI applet still works. Trying to not delete gli/jar here in case this helps: -->
279        <!--<delete dir="compiled/gli/jar"/>-->
280        <delete dir="compiled/gli/classes/org"/>
281        <move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/>
282
283        <!-- compile uninstaller -->
284        <antcall target="insert-and-compile-uninstaller" />
285
286        <!-- delete the source code -->
287        <delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete>
288        <delete dir="compiled/common-src"/>
289        <delete dir="compiled/build-src"/>
290        <delete dir="compiled/runtime-src"/>
291        <delete><fileset dir="compiled" includes="Install.txt,acconfig.h,aclocal.m4,config.guess,config.sub,configtest.pl,configure,configure.in,install-sh,Makefile.in,micotest.cpp,config.h.in,win32.mak,win32cfg.h,lib/**/*.a"/></delete>
292
293        <!-- strip .svn working-copy dirs -->
294        <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
295
296        <!-- create needed empty files -->
297        <mkdir dir="compiled/tmp"/>
298        <chmod dir="compiled/tmp" perm="a+rwx"/>
299        <echo file="compiled/etc/usage.txt"></echo>
300
301        <!-- windows -->
302        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
303
304            <!-- make a copy of server.exe in the root -->
305            <copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/>
306
307            <!-- delete sourcecode -->
308            <delete dir="${binzip.dir}/common-src"/>
309            <delete dir="${binzip.dir}/build-src"/>
310            <delete dir="${binzip.dir}/runtime-src"/>
311           
312            <!-- create simple zipped binary distribution
313            <mkdir dir="distributions"/>
314            <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
315            <copy todir="${binzip.dir}"><fileset dir="compiled"/></copy>
316            <delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete>
317            -->
318
319            <!-- delete unneeded files -->
320            <delete dir="compiled/bin/linux" />
321            <delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc,makegs2.bat"/></delete>
322            <delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete>
323            <delete dir="compiled/autom4te.cache" />
324
325        <!-- linux -->
326        <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
327
328            <!-- grab imagemagick and wv (if less than 2.84) binaries -->
329            <delete dir="compiled/bin/linux/imagemagick"/>
330
331            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
332                    <if><bool><equals arg1="${x64}" arg2="true"/></bool>
333                    <exec executable="svn">
334                            <arg value="export"/>
335                            <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux-x64.tar.gz"/>
336                            <arg value="compiled/ext/imagemagick-linux-x64.tar.gz"/>
337                        </exec>
338
339                    <exec executable="tar" dir="compiled/ext">
340                            <arg value="xvzf"/>
341                        <arg value="imagemagick-linux-x64.tar.gz"/>
342                    </exec>
343                    <delete file="compiled/ext/imagemagick-linux-x64.tar.gz"/>
344                <else>
345                        <exec executable="svn">
346                            <arg value="export"/>
347                        <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
348                        <arg value="compiled/bin/linux/imagemagick"/>
349                    </exec>
350                </else>
351                </if>
352                <else>
353                    <delete dir="compiled/bin/linux/wv"/>   
354                    <exec executable="svn">
355                        <arg value="export"/>
356                        <arg value="${svn.root}/main/trunk/binaries/linux/imagemagick"/>
357                        <arg value="compiled/bin/linux/imagemagick"/>
358                    </exec>
359
360                    <exec executable="svn">
361                        <arg value="export"/>
362                        <arg value="${svn.root}/main/trunk/binaries/linux/wv"/>
363                        <arg value="compiled/bin/linux/wv"/>
364                    </exec>
365                </else>
366            </if>
367
368            <!-- delete unneeded files -->
369            <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
370            <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
371            <delete><fileset dir="compiled" includes="*.bat"/></delete>
372            <delete dir="compiled/common-src/packages/windows"/>
373            <delete dir="compiled/common-src/indexers/packages/windows"/>
374
375        <!-- mac -->
376        <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
377            <!-- grab imagemagick and ghostscript binaries -->
378            <delete dir="compiled/bin/darwin/imagemagick"/>
379            <delete dir="compiled/bin/darwin/ghostscript"/>
380
381            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
382
383                <exec executable="svn">
384                    <arg value="export"/>
385                    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
386                    <arg value="compiled/bin/darwin/imagemagick"/>
387                </exec>
388             
389                <exec executable="svn">
390                    <arg value="export"/>
391                    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
392                    <arg value="compiled/bin/darwin/ghostscript"/>
393                </exec>
394
395                <else>             
396                    <exec executable="svn">
397                        <arg value="export"/>
398                        <arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
399                        <arg value="compiled/bin/darwin/imagemagick"/>
400                    </exec>
401               
402                    <exec executable="svn">
403                        <arg value="export"/>
404                        <arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
405                        <arg value="compiled/bin/darwin/ghostscript"/>
406                    </exec>
407                </else>
408            </if>
409
410            <!-- delete unneeded files -->
411            <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,*.bat"/></delete>
412            <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
413            <delete dir="compiled/common-src/packages/windows"/>
414
415        </if></else></if></else></if>
416
417        <!-- build demo collection -->
418        <!-- the envs on these execs simulate the environment when you run setup.bat -->
419        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>   
420           
421            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
422                <arg line="-S"/>
423                <arg line="bin/script/import.pl demo"/>
424                <env key="GSDLHOME" path="${basedir}/compiled"/>
425                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
426                <env key="GSDLOS" value="windows"/>
427                <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
428            </exec>
429            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
430                <arg line="-S"/>
431                <arg line="bin/script/buildcol.pl demo"/>
432                <env key="GSDLHOME" path="${basedir}/compiled"/>
433                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
434                <env key="GSDLOS" value="windows"/>
435                <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
436            </exec>
437
438            <delete dir="${basedir}/compiled/collect/demo/index"/>
439            <move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/>
440           
441            <else>
442                <echo file="${basedir}/compiled/buildscript.sh">
443                    #!/bin/bash
444                    source setup.bash
445                    /usr/bin/perl -S ${basedir}/compiled/bin/script/full-rebuild.pl demo
446                </echo>
447                <chmod perm="755" file="${basedir}/compiled/buildscript.sh"/>
448                <exec dir="${basedir}/compiled" executable="/bin/bash">
449                    <arg line="buildscript.sh"/>
450                </exec>
451                <delete file="${basedir}/compiled/buildscript.sh"/>
452            </else>
453        </if>
454
455        <!-- delete unneeded files -->
456        <delete dir="compiled/uninstaller" />
457        <delete file="compiled/bin/java/SignedGatherer.jar" />
458
459        <!-- tidy up gli -->
460        <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
461
462        <!-- mac and linux: insert export to cdrom package -->
463        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
464            <mkdir dir="compiled/bin/windows"/>
465            <get src="${server.exe.location}" dest="compiled/bin/windows/server.exe"/>
466
467            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
468                <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
469                <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
470
471                <else>
472                    <get src="${svn.root}/main/trunk/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
473                    <get src="${svn.root}/main/trunk/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
474                </else>
475            </if>
476        </if>
477
478    </target>
479
480</project>
Note: See TracBrowser for help on using the browser.