/
build.xml
executable file
·330 lines (290 loc) · 13.6 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Id$
Copyright (C) GNU/GPL AVOIR 2007
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-->
<project name="chisimba_framework" basedir="." default="build">
<!-- the properties below can be customised to suit your own environment by providing a
build.properties file and overriding them -->
<!-- local location that will contain the archives generated by this build -->
<property name="build.dir" value="build"/>
<!-- version string that will get appended to archive file names -->
<property name="version" value="nightly"/>
<!-- base archive name (i.e. without file suffix and version string) -->
<property name="base.archive.file.name" value="chisimba_framework_${version}"/>
<!-- base api doc archive name (i.e. without file suffix and version string) -->
<property name="base.apidoc.file.name" value="chisimba_apidocs_${version}"/>
<!-- base pdf doc file name -->
<property name="base.pdfdoc.file.name" value="chisimba_docs_pdf_${version}"/>
<!-- base pdf odt file name -->
<property name="base.odtdoc.file.name" value="chisimba_docs_odt_${version}"/>
<!-- base doc doc file name -->
<property name="base.docdoc.file.name" value="chisimba_docs_doc_${version}"/>
<!-- local folder where the built archives will be copied to during deployment -->
<property name="local.deploy.dir" value="/var/www/chisimba_nightly"/>
<!-- the properties below here shouldn't typically be overridden or changed -->
<!-- name of tar file generated by build -->
<property name="tarfile" value="${build.dir}/${base.archive.file.name}.tgz"/>
<!-- name of zip file generated by build -->
<property name="zipfile" value="${build.dir}/${base.archive.file.name}.zip"/>
<!-- API doc file name -->
<property name="apidoczipfile" value="${build.dir}/${base.apidoc.file.name}.zip"/>
<property name="apidoctarfile" value="${build.dir}/${base.apidoc.file.name}.tgz"/>
<!-- PDF doc file name -->
<!--property name="pdfdoctarfile" value="${build.dir}/${base.pdfdoc.file.name}.tgz"/>
<property name="pdfdoczipfile" value="${build.dir}/${base.pdfdoc.file.name}.zip"/ -->
<!-- Word doc file name -->
<!-- property name="docdoctarfile" value="${build.dir}/${base.docdoc.file.name}.tgz"/>
<property name="docdoczipfile" value="${build.dir}/${base.docdoc.file.name}.zip"/ -->
<!-- OO.o doc file name -->
<!-- property name="odtdoctarfile" value="${build.dir}/${base.odtdoc.file.name}.tgz"/>
<property name="odtdoczipfile" value="${build.dir}/${base.odtdoc.file.name}.zip"/ -->
<!-- Lets set up the svn export and directory for the build -->
<property name="exportdir" value="${build.dir}"/>
<property name="svnpath" value="/usr/bin/svn"/>
<property name="username" value="anon"/>
<property name="password" value="anon"/>
<property name="repo" value="https://cvs2.uwc.ac.za/chisimba/framework/trunk/"/>
<tstamp>
<format property="build.time" pattern="%Y-%m-%d %H:%I" />
</tstamp>
<taskdef name="twitterupdate" classname="phing.tasks.my.TwitterUpdateTask" />
<!-- Twitter status update target -->
<target name="tweet">
<twitterupdate
username="chisimba_svn" password="avoir2008"
message="${twitter.status}" />
</target>
<!-- Lets set up the svn export and directory for the documentation build -->
<!-- property name="docexportdir" value="${build.dir}/docs/" />
<property name="docsvnpath" value="/usr/bin/svn" />
<property name="docusername" value="anon" />
<property name="docpassword" value="anon" />
<property name="docrepo" value="https://cvs2.uwc.ac.za/chisimba_documentation/" / -->
<!-- set of files that should and shouldn't end up in archive files generated by build -->
<fileset dir="${build.dir}/app/" id="archive.files">
<include name="**/**"/>
<exclude name="build/**"/>
<exclude name="build.xml"/>
<exclude name="countlines.pl"/>
<exclude name="cvs2cl"/>
<exclude name="cvschangelogbuilder.pl"/>
<exclude name="package-config.php"/>
<exclude name="pearpacker.php"/>
<exclude name="update.sh"/>
<exclude name=".svn"/>
<exclude name="app/tests/**"/>
</fileset>
<!-- PDF docs fileset directory -->
<!-- fileset dir="${build.dir}/docs/" id="pdfdocs">
<include name="**/*.pdf" />
</fileset -->
<target name="clean" description="Removes any files generated by this build">
<delete dir="${build.dir}" includeemptydirs="true" verbose="true"/>
<phingcall target="tweet">
<property name="twitter.status" value="Buildbot has cleaned up at ${build.time}" />
</phingcall>
</target>
<target name="init" description="Performs any initialisation steps required by this build">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/docs"/>
<mkdir dir="final"/>
<phingcall target="tweet">
<property name="twitter.status" value="#Chisimba build initialised at ${build.time}" />
</phingcall>
</target>
<target name="svnexport">
<svnexport svnpath="${svnpath}" username="${username}" password="${password}" nocache="true" force="true" repositoryurl="${repo}" todir="${exportdir}"/>
</target>
<!-- doc svn export command -->
<!-- target name="docsvnexport">
<svnexport
svnpath="${docsvnpath}"
username="${docusername}"
password="${docpassword}"
nocache="true"
force="true"
repositoryurl="${docrepo}"
todir="${docexportdir}"/>
</target -->
<!-- Start the actual build(s) -->
<target name="build" description="Generates .tgz and .zip file containing framework" depends="init, lint, apidocs, build-tgz, build-zip">
</target>
<target name="buildminimal" description="Generates .tgz and .zip file containing framework" depends="init, lint, build-tgz, build-zip">
</target>
<!-- Perform lintian task on the code - HALT on Failure! -->
<target name="lint" description="Performs a lintian check (syntax check) on all the code going into the archive(s)" depends="init, svnexport">
<phplint haltonfailure="true">
<fileset dir="${build.dir}/app/">
<include name="**/*.php"/>
<!-- exclude the pear stuff -->
<exclude name="lib/pear/**"/>
<!-- exclude the installer -->
<exclude name="installer/**"/>
<!-- exclude the skins -->
<exclude name="skins/**"/>
<!-- exclude the tests -->
<exclude name="tests/**"/>
<!-- exclude the packages -->
<exclude name="packages/**"/>
<!-- exclude the configs -->
<exclude name="config/**"/>
<!-- exclude the error log -->
<exclude name="error_log/**"/>
<!-- exclude the user_images -->
<exclude name="user_images/**"/>
<!-- exclude the usrfiles -->
<exclude name="usrfiles/**"/>
<!-- exclude the cron dir -->
<exclude name="cron/**"/>
</fileset>
</phplint>
</target>
<!-- Generate the API dox -->
<target name="apidocs" description="Generates the PHPDocumetor API docs for the framework" depends="init, svnexport, lint">
<phpdoc title="Chisimba API Documentation" destdir="apidocs" sourcecode="true" output="HTML:Smarty:PHP" defaultpackagename="chisimba" defaultcategoryname="chisimba">
<fileset dir="${build.dir}/app/" id="apidox">
<include name="**/*.php"/>
<!-- exclude the pear stuff -->
<exclude name="lib/pear/**"/>
<!-- exclude the installer -->
<exclude name="installer/**"/>
<!-- exclude the skins -->
<exclude name="skins/**"/>
<!-- exclude the tests -->
<exclude name="tests/**"/>
<!-- exclude the packages -->
<exclude name="packages/**"/>
<!-- exclude the configs -->
<exclude name="config/**"/>
<!-- exclude the error log -->
<exclude name="error_log/**"/>
<!-- exclude the user_images -->
<exclude name="user_images/**"/>
<!-- exclude the usrfiles -->
<exclude name="usrfiles/**"/>
<!-- exclude the cron dir -->
<exclude name="cron/**"/>
</fileset>
<projdocfileset dir=".">
<include name="README"/>
<include name="INSTALL"/>
<include name="CHANGELOG"/>
</projdocfileset>
</phpdoc>
<phingcall target="tweet">
<property name="twitter.status" value="Building #Chisimba docs at ${build.time}" />
</phingcall>
</target>
<!--
<target name="sortdocs" description="Sorts the docs and generates different formats through OO.o" depends="docsvnexport"-->
<!-- Sort docs target - python OO.o UNO bridge script to do conversions -->
<!--exec command="sh conv.sh" dir="${docexportdir}" passthru="TRUE" / --> <!-- ${docexportdir}/conv.sh" dir="${docexportdir}" passthru="TRUE" / -->
<!-- end build docs via OO.o -->
<!-- /target>
-->
<target name="build-tgz" description="Generates .tgz file containing framework" depends="init, svnexport, lint">
<tar destfile="${tarfile}" compression="gzip">
<fileset dir="${build.dir}/app/"/>
</tar>
<phingcall target="tweet">
<property name="twitter.status" value="#Chisimba nightly tarball built at ${build.time}" />
</phingcall>
</target>
<target name="build-zip" description="Generates .zip file containing framework" depends="init, svnexport, lint">
<zip destfile="${zipfile}">
<fileset dir="${build.dir}/app/"/>
</zip>
<phingcall target="tweet">
<property name="twitter.status" value="#Chisimba nightly zip archive built at ${build.time}" />
</phingcall>
</target>
<target name="apidoc-zip" description="Generates .zip file containing the API docs" depends="init, apidocs">
<zip destfile="${apidoczipfile}">
<fileset dir="apidocs/"/>
</zip>
</target>
<target name="apidoc-tgz" description="Generates .tgz file containing the API docs" depends="init, apidocs">
<tar destfile="${apidoctarfile}" compression="gzip">
<fileset dir="apidocs/"/>
</tar>
</target>
<!-- Build PDF of the docs -
<target name="doc-pdftgz" description="Generates .tgz file containing the docs as PDF's" depends="init, docsvnexport">
<tar destfile="${pdfdoctarfile}" compression="gzip">
<fileset dir="${build.dir}/docs/build/">
<include name="**/*.pdf" />
</fileset>
</tar>
</target>
<target name="doc-pdfzip" description="Generates .zip file containing the docs as PDF's" depends="init, docsvnexport">
<zip destfile="${pdfdoczipfile}">
<fileset dir="${build.dir}/docs/build/">
<include name="**/*.pdf" />
</fileset>
</zip>
</target>
-->
<!-- Build OpenOffice odt's --><!--
<target name="doc-odttgz" description="Generates .tgz file containing the docs as OO.o files" depends="init, docsvnexport">
<tar destfile="${odtdoctarfile}" compression="gzip">
<fileset dir="${build.dir}/docs/build/">
<include name="**/*.odt" />
</fileset>
</tar>
</target>
<target name="doc-odtzip" description="Generates .zip file containing the docs as OO.o files" depends="init, docsvnexport">
<zip destfile="${odtdoczipfile}">
<fileset dir="${build.dir}/docs/build/">
<include name="**/*.odt" />
</fileset>
</zip>
</target>
-->
<!-- Build MS Word format docs --><!--
<target name="doc-doctgz" description="Generates .tgz file containing the docs as MS Word docs" depends="init, docsvnexport">
<tar destfile="${docdoctarfile}" compression="gzip">
<fileset dir="${build.dir}/docs/build/">
<include name="**/*.doc" />
</fileset>
</tar>
</target>
<target name="doc-doczip" description="Generates .zip file containing the docs as MS Word docs" depends="init, docsvnexport">
<zip destfile="${docdoczipfile}">
<fileset dir="${build.dir}/docs/build/">
<include name="**/*.doc" />
</fileset>
</zip>
</target> -->
<!-- end doc builds -->
<!-- Deploy targets - local first, then remotes -->
<!-- Local build target -->
<target name="deploy-local" description="Copies archives to local folder" depends="init, build">
<copy file="${build.dir}/${tarfile}" todir="./final" overwrite="true"/>
<copy file="${build.dir}/${zipfile}" todir="./final" overwrite="true"/>
<!--copy file="${apidoczipfile}" todir="./final" overwrite="true"/>
<copy file="${apidoctarfile}" todir="./final" overwrite="true"/>
<copy file="${docdoctarfile}" todir="./final" overwrite="true"/>
<copy file="${docdoczipfile}" todir="./final" overwrite="true"/>
<copy file="${odtdoctarfile}" todir="./final" overwrite="true"/>
<copy file="${odtdoczipfile}" todir="./final" overwrite="true"/>
<copy file="${pdfdoctarfile}" todir="./final" overwrite="true"/>
<copy file="${pdfdoczipfile}" todir="./final" overwrite="true"/ -->
<!-- Clean up -->
<delete dir="./build" includeemptydirs="true" verbose="true" failonerror="true"/>
<phingcall target="tweet">
<property name="twitter.status" value="#Chisimba build completed at ${build.time}" />
</phingcall>
</target>
</project>