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

Last change on this file since 23612 was 23612, checked in by sjm84, 10 years ago

Various fixes and tidying up

File size: 6.2 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk3-compile">
3
4 <target name="compile">
5
6 <!-- checkout greenstone3 -->
7 <exec executable="svn">
8 <arg value="checkout"/>
9 <arg value="${svn.root}/main/${branch.path}/greenstone3"/>
10 <arg value="compiled"/>
11 <arg value="-r"/><arg value="${branch.revision}"/>
12 </exec>
13
14 <!-- make sure all c++ compilation is done statically on linux -->
15 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
16 <property name="forward.compile.static" value="true"/>
17 </if>
18
19 <!-- make sure the c++ compilation can see the support library in the extension folder -->
20 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
21 <property name="forward.use.support.lib" value="true"/>
22 </if>
23
24 <antcall target="persist-forwarded-properties">
25 <param name="greenstone3basedir" value="compiled"/>
26 </antcall>
27
28 <!-- run greenstone3's ant prepare -->
29 <ant dir="compiled" inheritAll="false">
30 <target name="prepare"/>
31 <propertyset refid="forward.properties"/>
32 <property name="properties.accepted" value="true"/>
33 </ant>
34
35 <!-- set all version numbers -->
36 <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
37 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli"/></antcall>
38 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="compiled/gs2build"/></antcall>
39
40 <!-- mac or linux: compile the support library -->
41 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
42 <!-- checkout the gnome support library extension-->
43 <if><bool><or>
44 <equals arg1="${branch.path}" arg2="trunk"/>
45 <equals arg1="${branch.path}" arg2="tags/stable"/>
46 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
47 </or></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}${extension-x64}.tar.gz"/>
52 <arg value="${basedir}/compiled/ext/gnome-lib-${os.shell}.tar.gz"/>
53 </exec>
54
55 <exec executable="tar" dir="${basedir}/compiled/ext">
56 <arg value="xvzf"/>
57 <arg value="gnome-lib-${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 devel.bash"/>
63 </exec>
64 <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
65 </if>
66 </if>
67
68 <!-- run greenstone3's ant install and ant dist-tidy -->
69 <ant dir="compiled" inheritAll="false">
70 <target name="install"/>
71 <target name="dist-tidy"/>
72 <propertyset refid="forward.properties"/>
73 <property name="properties.accepted" value="true"/>
74 </ant>
75
76 <!-- Delete the entire gnome support library on Linux -->
77 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
78 <delete dir="${basedir}/compiled/ext/gnome-lib"/>
79 </if>
80
81 <!-- Delete all but the lib folder of the gnome support library on Mac -->
82 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
83 <delete dir="${basedir}/compiled/ext/gnome-lib/cascade-make"/>
84 <delete dir="${basedir}/compiled/ext/gnome-lib/packages"/>
85 <delete dir="${basedir}/compiled/ext/gnome-lib/darwin/bin"/>
86 <delete dir="${basedir}/compiled/ext/gnome-lib/darwin/etc"/>
87 <delete dir="${basedir}/compiled/ext/gnome-lib/darwin/include"/>
88 <delete dir="${basedir}/compiled/ext/gnome-lib/darwin/share"/>
89 <delete file="${basedir}/compiled/ext/gnome-lib/setup.bat"/>
90 <delete file="${basedir}/compiled/ext/gnome-lib/CASCADE-MAKE.sh"/>
91 </if>
92
93 <!-- insert an xml parser -->
94 <copy todir="compiled/gs2build/perllib/cpan">
95 <fileset dir="${rk.home}/shared/linux" includes="XML-Parser/**/*"/>
96 </copy>
97
98 <!-- insert ant -->
99 <mkdir dir="compiled/packages"/>
100 <get src="http://www.greenstone.org/gs3files/apache-ant-1.8.0-bin.tar.gz" dest="compiled/packages/apache-ant-1.8.0-bin.tar.gz"/>
101 <untar src="compiled/packages/apache-ant-1.8.0-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
102 <move file="compiled/packages/apache-ant-1.8.0" tofile="compiled/packages/ant"/>
103 <delete file="compiled/packages/apache-ant-1.8.0-bin.tar.gz"/>
104
105
106 <!-- put the uninstaller in place -->
107 <antcall target="insert-and-compile-uninstaller"/>
108
109 <!-- (windows only) -->
110 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
111 <!-- insert perl -->
112 <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
113 </if>
114
115 <!-- minify tomcat -->
116 <delete dir="compiled/packages/tomcat/webapps/docs"/>
117 <delete dir="compiled/packages/tomcat/webapps/examples"/>
118
119 <!-- tidy up gli to make it smaller -->
120 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
121
122 <!-- strip out .svn dirs -->
123 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
124
125 <!-- (linux only) -->
126 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
127 <!-- grab imagemagick binaries -->
128 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
129 <exec executable="svn">
130 <arg value="export"/>
131 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
132 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
133 </exec>
134
135 <!-- grab wv binaries -->
136 <delete dir="compiled/gs2build/bin/linux/wv"/>
137 <exec executable="svn">
138 <arg value="export"/>
139 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
140 <arg value="compiled/gs2build/bin/linux/wv"/>
141 </exec>
142 <!-- (mac only) -->
143 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
144 <!-- grab imagemagick binaries -->
145 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
146 <exec executable="svn">
147 <arg value="export"/>
148 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
149 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
150 </exec>
151
152 <!-- grab ghostscript binaries -->
153 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
154 <exec executable="svn">
155 <arg value="export"/>
156 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
157 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
158 </exec>
159 </if></else></if>
160
161 </target>
162
163</project>
Note: See TracBrowser for help on using the repository browser.