source: release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml@ 19935

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

it's all good stuff

File size: 8.7 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!--
3 ..........................................................
4 August 2008
5 Targets for Greenstone2 release kits
6 Oran Fry
7 ..........................................................
8-->
9
10<project name="rk2-targets">
11
12 <property name="version.major" value="2"/>
13
14 <target name="gs2-init">
15 <property name="server.exe.location" value="http://www.greenstone.org/caveat-emptor/server-${version}-candidate-${date}.exe" />
16 <echo message="server.exe.location: ${server.exe.location}"/>
17 </target>
18
19 <target name="export-gsdl-gli">
20 <delete dir="${dest}"/>
21 <svn>
22 <export srcurl="${svn.root}/gsdl/${branch.path}" destPath="${dest}"/>
23 <export srcurl="${svn.root}/gli/${branch.path}" destPath="${dest}/gli"/>
24 </svn>
25 </target>
26
27 <target name="drop-in-docs">
28 <echo level="info">Dropping gsdl docs into distribution</echo>
29 <copy todir="${gsdl.basedir}" overwrite="true">
30 <fileset dir="${rk.home}/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>
31 </copy>
32 </target>
33
34 <target name="gsdl-set-version-numbers">
35
36 <echo level="info">Setting version in common-src/src/lib/gsdlconf.h</echo>
37 <rsr file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
38
39 <echo level="info">Setting version in etc/VERSION</echo>
40 <rsr file="${gsdl.basedir}/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
41
42 <echo level="info">Setting version in server.properties</echo>
43 <rsr file="${gsdl.basedir}/lib/java/server.properties" pattern="^(Server2Control.Version[:=]).*" replacement="$1${version}" />
44
45 <echo level="info">Sneakily changing some log4j stuff</echo>
46 <rsr file="${gsdl.basedir}/lib/java/log4j.properties.in" pattern="^(log4j.category.org.greenstone.server[:=].*)INFO(.*)" replacement="$1WARN$2" />
47
48 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${gsdl.basedir}"/></antcall>
49
50 </target>
51
52 <target name="gsdl-set-dates-in-readmes">
53 <echo level="info">Changing date and version in the docs</echo>
54
55 <!-- en -->
56 <if><bool><available file="${gsdl.basedir}/READMEen.txt"/></bool>
57 <rsr file="${gsdl.basedir}/READMEen.txt">
58 <job pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
59 <job pattern="^(Version\s*)(.*)" replacement="$1${version}" />
60 </rsr>
61 </if>
62
63 <!-- ar -->
64 <if><bool><available file="${gsdl.basedir}/READMEar.txt"/></bool>
65 <rsr file="${gsdl.basedir}/READMEar.txt">
66 <job pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}"/>
67 <job pattern="(النسخه : \s*)(.*)" replacement="$1${version}"/>
68 </rsr>
69 </if>
70
71 <!-- es -->
72 <if><bool><available file="${gsdl.basedir}/READMEes.txt"/></bool>
73 <rsr file="${gsdl.basedir}/READMEes.txt">
74 <job pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}"/>
75 <job pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}"/>
76 </rsr>
77 </if>
78
79 <!-- fr -->
80 <if><bool><available file="${gsdl.basedir}/READMEfr.txt"/></bool>
81 <rsr file="${gsdl.basedir}/READMEfr.txt">
82 <job pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}"/>
83 <job pattern="^(Version\s*)(.*)" replacement="$1${version}"/>
84 </rsr>
85 </if>
86
87 <!-- ru -->
88 <if><bool><available file="${gsdl.basedir}/READMEru.txt"/></bool>
89 <rsr file="${gsdl.basedir}/READMEru.txt">
90 <job pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}"/>
91 <job pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}"/>
92 </rsr>
93 </if>
94
95 </target>
96
97
98 <target name="insert-export-to-cd-package">
99 <mkdir dir="${gsdl.basedir}/bin/windows"/>
100 <get src="${server.exe.location}" dest="${gsdl.basedir}/bin/windows/server.exe"/>
101 <get src="http://svn.greenstone.org/other-projects/trunk/winbin/bin/Setup.exe" dest="${gsdl.basedir}/bin/windows/Setup.exe"/>
102 <get src="http://svn.greenstone.org/other-projects/trunk/winbin/bin/gssetup.exe" dest="${gsdl.basedir}/bin/windows/gssetup.exe"/>
103 </target>
104
105 <target name="create-binary-zip-linux">
106 <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
107
108 <delete dir="${binzip.dir}"/>
109 <exec dir="${basedir}" executable="cp"><arg line="-r distributions/web ${binzip.dir}"/></exec>
110
111 <!-- delete sourcecode -->
112 <delete dir="${binzip.dir}/common-src"/>
113 <delete dir="${binzip.dir}/build-src"/>
114 <delete dir="${binzip.dir}/runtime-src"/>
115
116 <!-- delete loose files -->
117 <delete>
118 <fileset
119 dir="${binzip.dir}"
120 includes="README*.txt,Uninstall.sh,uninst.jar,acconfig.h,aclocal.m4,config.guess,config.sub,configtest.pl,configure,configure.in,install-sh,Makefile.in,micotest.cpp,config.h.in"
121 excludes="READMEen.txt"/>
122 </delete>
123
124 </target>
125
126 <target name="create-binary-zip-windows">
127 <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
128 <copy todir="${binzip.dir}">
129 <fileset dir="distributions/web"/>
130 </copy>
131
132 <!-- delete sourcecode -->
133 <delete dir="${binzip.dir}/common-src"/>
134 <delete dir="${binzip.dir}/build-src"/>
135 <delete dir="${binzip.dir}/runtime-src"/>
136
137 <!-- delete loose files -->
138 <delete>
139 <fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/>
140 </delete>
141 </target>
142
143 <target name="create-needed-empty-files">
144 <mkdir dir="${gsdl.basedir}/tmp"/>
145 <chmod dir="${gsdl.basedir}/tmp" perm="a+rwx"/>
146 <echo file="${gsdl.basedir}/etc/usage.txt"></echo>
147 </target>
148
149 <target name="dist-clean-sourcecode">
150
151 <!-- delete the sourcecode -->
152 <delete>
153 <fileset dir="distributions/web" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/>
154 </delete>
155 <delete dir="distributions/web/common-src"/>
156 <delete dir="distributions/web/build-src"/>
157 <delete dir="distributions/web/runtime-src"/>
158 <delete>
159 <fileset dir="distributions/web" 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"/>
160 </delete>
161
162 <!--
163 <svn>
164 <export srcurl="${svn.root}/gsdl/${branch.path}/common-src" destPath="distributions/web/common-src"/>
165 <export srcurl="${svn.root}/gsdl/${branch.path}/build-src" destPath="distributions/web/build-src"/>
166 <export srcurl="${svn.root}/gsdl/${branch.path}/runtime-src" destPath="distributions/web/runtime-src"/>
167 </svn>
168 -->
169 </target>
170
171 <target name="dist-unzip-packages">
172 <untar src="${basedir}/distributions/web/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz" dest="${basedir}/distributions/web/common-src/packages/sqlite" compression="gzip"/>
173 <delete file="${basedir}/distributions/web/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
174 </target>
175
176 <target name="make-common-src">
177 <exec dir="${basedir}/compiled/common-src" executable="make" failonerror="true"/>
178 <exec dir="${basedir}/compiled/common-src" executable="make" failonerror="true"><arg value="install"/></exec>
179 </target>
180
181 <target name="checkout-gsdl-gli">
182 <echo>${svn.root}/gsdl/${branch.path}</echo>
183 <svn>
184 <checkout url="${svn.root}/gsdl/${branch.path}" destPath="${basedir}/compiled"/>
185 <checkout url="${svn.root}/gli/${branch.path}" destPath="${basedir}/compiled/gli"/>
186 </svn>
187 </target>
188
189 <target name="compile-gli">
190
191 <!-- default to sh -->
192 <property name="script.format" value="sh"/>
193
194 <echo>Compiling gli...</echo>
195 <exec dir="${glibasedir}" executable="${glibasedir}/makegli.${script.format}"/>
196
197 <echo>Creating jar...</echo>
198 <exec dir="${glibasedir}" executable="${glibasedir}/makejar.${script.format}"/>
199
200 <echo>Cleaning up intermediate files...</echo>
201 <delete dir="${glibasedir}/jar"/>
202 <delete dir="${glibasedir}/classes/org"/>
203
204 <if><bool><isset property="gsdlbasedir"/></bool>
205 <echo>Putting gli server jar in a better place</echo>
206 <exec executable="mv" failonerror="true">
207 <arg line="${glibasedir}/GLIServer.jar ${gsdlbasedir}/bin/java" />
208 </exec>
209 </if>
210
211 </target>
212
213 <target name="clean">
214 <antcall target="clean-compiled"/>
215 <antcall target="clean-distributions"/>
216 <antcall target="clean-components"/>
217 <antcall target="clean-installer"/>
218 <antcall target="clean-wrapped-installer"/>
219 <antcall target="clean-cdrom"/>
220 </target>
221
222 <target name="clean-compiled">
223 <delete dir="compiled"/>
224 </target>
225
226 <target name="clean-distribution">
227 <delete dir="distributions"/>
228 </target>
229
230 <target name="clean-components">
231 <delete dir="components"/>
232 </target>
233
234 <target name="clean-installer">
235 <delete dir="installer"/>
236 </target>
237
238 <target name="clean-wrapped-installer">
239 <delete dir="wrapped-installer"/>
240 </target>
241
242 <target name="clean-cdrom">
243 <delete dir="cdrom"/>
244 </target>
245
246</project>
247
Note: See TracBrowser for help on using the repository browser.