-
Notifications
You must be signed in to change notification settings - Fork 1
/
want.xml
340 lines (283 loc) · 10.8 KB
/
want.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
331
332
333
334
335
336
337
338
339
340
<!--
***********************************************************************
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is DUnit.
*
* The Initial Developers of the Original is Juancarlo Añez
* and Juancarlo A±ez.
* Portions created The Initial Developers are Copyright (C) 1999-2003.
* Portions created by The DUnit Group are Copyright (C) 2000-2003.
* All rights reserved.
*
* Contributor(s):
* Juancarlo Añez <juanca@suigeneris.org>
* The DUnit group at SourceForge <http://dunit.sourceforge.net>
*
***********************************************************************
$Id: want.xml,v 1.41 2008/04/18 01:10:23 judc Exp $
========================================================================
This build file specifies how to build DUnit using the Want build tool.
See:
http://www.suigeneris.org/want
for details.
========================================================================
-->
<project name="DUnit Extreme Testing Framework for Delphi"
default="test"
basedir=".">
<property name="dunit.release" value="%{DUNIT_RELEASE}" />
<property name="app.name" value="dunit" />
<property name="old.version" value="?{release.ini:releases:current}" />
<regexp property="old.build" text="${old.version}" pattern="^.*\.([0-9]+)$" subst ="\1" />
<property name="build" value="={1 + ${old.build}}" if="dunit.release" />
<property name="build" value="${old.build}" unless="dunit.release" />
<regexp property="version" text="${old.version}" pattern="\.[0-9]*$" subst=".${build}" />
<regexp property="comma.version" pattern="\." subst="," text="${version}" />
<tstamp>
<format property="when" pattern="yyyy,mm,dd,HH,nn,ss" />
<format property="date.tag" pattern="yyyy-mm-dd" />
</tstamp>
<regexp property="cvs.tag" text="build_${version}" pattern="\." subst="_" />
<property name="src.dir" value="${basedir}/src" />
<property name="doc.dir" value="${basedir}/doc" />
<property name="test.dir" value="${basedir}/tests"/>
<property name="etc.dir" value="${basedir}/etc"/>
<property name="samp.dir" value="${basedir}/examples"/>
<property name="scratch.dir" value="${basedir}/scratch"/>
<property name="bin.dir" value="${basedir}/bin"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="framework.dir" value="${basedir}/framework"/>
<property name="contrib.dir" value="${basedir}/contrib"/>
<property name="zipfile" value="${dist.dir}/${app.name}-${version}.zip" />
<!--
To compile DUnit with JCL set this property to the JCL path, or use
-Djcl.lib=c:/jcl/path
on the WAnt commandline.
<property name="jcl.lib" value="" />
-->
<patternset id="source.code" >
<include name="**/*.pas" />
<include name="**/*.inc" />
<include name="**/*.dfm" />
<include name="**/*.nfm" />
<include name="**/*.xfm" />
<include name="**/*.dpr" />
<include name="**/*.dpk" />
<include name="**/*.bdsproj" />
<include name="**/*.bdsgroup" />
<include name="**/*.bpg" />
<include name="**/*.drc" />
<include name="**/*.rc" />
<include name="**/*.res" />
<include name="**/*.xml" />
<exclude name="**/*~" />
<exclude name="${basedir}/private/**/*" />
<exclude name="${basedir}/tools/**/*" />
<exclude name="${basedir}/helpsrc/**/*" />
<exclude name="${basedir}/scratch/**/*" />
<exclude name="${basedir}/dist/**/*" />
<exclude name="${basedir}/admin/**/*" />
<exclude name="${basedir}/backups/**/*" />
<exclude name="${basedir}/bin/**/*" />
</patternset>
<patternset id="docs" >
<include name="**/*.html" />
<include name="**/*.htm" />
<include name="**/*.css" />
<include name="**/*.xml" />
<include name="**/*.dtd" />
<include name="**/*.xsl" />
<include name="**/*.xsd" />
<include name="**/*.txt" />
<include name="**/*.png" />
<include name="**/*.jpg" />
<include name="**/*.jpeg" />
<include name="**/*.gif" />
<exclude name="**/*~" />
<exclude name="${basedir}/private/**/*" />
<exclude name="${basedir}/tools/**/*" />
<exclude name="${basedir}/helpsrc/**/*" />
<exclude name="${basedir}/dist/**/*" />
<exclude name="${basedir}/admin/**/*" />
<exclude name="${basedir}/bin/**/*" />
</patternset>
<patternset id="source.and.docs" >
<patternset refid="source.code" />
<patternset refid="docs" />
</patternset>
<target name="prepare" description="build directory structure" >
<mkdir dir="${scratch.dir}" />
<mkdir dir="${bin.dir}" />
<mkdir dir="${framework.dir}" />
</target>
<target name="clean">
<delete dir="${scratch.dir}" />
<delete dir="${bin.dir}" />
<delete dir="${framework.dir}" />
</target>
<property name="test.app" value="DUnitTestLib" />
<target name="versioninfo" depends="prepare">
<regexp property="comma.version"
pattern="\.0*([1-9]*[0-9])" subst=",\1"
text="${version}" />
<echo input="${etc.dir}/versioninfo.template.rc"
file="${src.dir}/versioninfo.rc"
/>
<echo input="${etc.dir}/versioninfo.template.inc"
file="${src.dir}/versioninfo.inc"
/>
</target>
<target name="compile" depends="prepare,versioninfo" >
<brcc file="${src.dir}/versioninfo.rc"
output="${src.dir}/versioninfo.res"
/>
<echo message="building dunit with JCL" if="jcl.lib" />
<dcc basedir="${src.dir}" source="dunit.dpr" >
<dcuoutput path="${scratch.dir}" />
<exeoutput path="${bin.dir}" />
<optimize value="true" />
<build value="true" />
<define name="USE_JEDI_JCL" if="jcl.lib" />
<define name="DUNIT_DLL" />
<unitpath>
<include name="${src.dir}" />
<include name="${jcl.lib}" />
</unitpath>
<resourcepath path="${src.dir}" />
</dcc>
</target>
<target name="test_dunit" depends="compile" >
<dcc basedir="${test.dir}" source="${test.app}.dpr" >
<dcuoutput path="${scratch.dir}" />
<exeoutput path="${bin.dir}" />
<debug value="true" />
<build value="true" />
<define name="DUNIT_DLL" />
<unitpath path="${src.dir}" />
<resourcepath>
<include name="${src.dir}" />
<include name="${scratch.dir}" />
</resourcepath>
</dcc>
<dunit testlib="${bin.dir}/${test.app}" />
<!-- test again with standalone dunit.exe -->
<exec executable="${bin.dir}/dunit.exe" >
<arg value="-c" />
<arg path="${bin.dir}/${test.app}" />
</exec>
</target>
<target name="test_dunit_clx" depends="compile" >
<dcc basedir="${test.dir}" source="UnitTests.dpr" >
<dcuoutput path="${scratch.dir}" />
<exeoutput path="${bin.dir}" />
<debug value="true" />
<build value="true" />
<console value="true" />
<define name="DUNIT_CLX" />
<unitpath path="${src.dir}" />
<resourcepath>
<include name="${src.dir}" />
<include name="${scratch.dir}" />
</resourcepath>
</dcc>
<exec executable="${bin.dir}/UnitTests.exe" >
<arg value="-text-mode" />
</exec>
</target>
<target name="examples"
depends="xpgen,
xmlrep,
registration,
registry,
tlist,
structure,
cmdline,
testexception
"
>
<!-- list all example dirs here -->
</target>
<target name="test" depends="test_dunit,examples" />
<target name="dist" depends="clean,prepare,test,tag,package" >
<ini file="release.ini" if="dunit.release" >
<write section="releases" key="current" value="${version}" />
<write section="releases" key="last_date" value="${date.tag}" />
</ini>
</target>
<target name="tag">
<cvs command='commit -m "release ${version}" release.ini'/>
<cvs command="rtag -F ${cvs.tag} dunit" />
</target>
<target name="package" depends="prepare,compile" >
<echo message="CVS tag='${cvs.tag}'" />
<delete file="${zipfile}" />
<mkdir dir="${dist.dir}" />
<zip zipfile="${zipfile}" >
<fileset dir="." >
<patternset refid="source.and.docs" />
<exclude name="${basedir}/private/**" />
<exclude name="${basedir}/tools/**" />
</fileset>
</zip>
</target>
<target name="publish" depends="package" >
<exec executable="ncftpput">
<arg value="upload.sourceforge.net" />
<arg value="incoming" />
<arg path="${zipfile}" />
</exec>
</target>
<target name="tarball" >
<exec executable="wget">
<arg value="--quiet" />
<arg value="--output-document=@{${app.name}-cvs-${date.tag}.tar.bz2" />
<arg value="http://cvs.sourceforge.net/cvstarballs/${app.name}-cvsroot.tar.bz2" />
</exec>
</target>
<!-- EXAMPLES
Each has its own want.xml or build.xml file.
-->
<target name="xpgen" depends="prepare" >
<want dir="${contrib.dir}/xpgen" description="test compiler" />
</target>
<target name="xmlrep" depends="prepare" >
<want dir="${contrib.dir}/XMLReporting" description="test compiler" />
</target>
<target name="registration" depends="prepare" >
<want dir="${samp.dir}/registration" />
</target>
<target name="registry" depends="prepare" >
<want dir="${samp.dir}/registry" />
</target>
<target name="tlist" depends="prepare" >
<want dir="${samp.dir}/TListTest" />
</target>
<target name="structure" depends="prepare" >
<want dir="${samp.dir}/structure" />
</target>
<target name="cmdline" depends="prepare" >
<want dir="${samp.dir}/cmdline" />
</target>
<target name="testexception" depends="prepare" >
<want dir="${samp.dir}/testexception" />
</target>
<!-- ...add a target for each example... -->
<target name="changelog" >
<shell executable="perl tools/cvs2cl.pl" >
<arg value="--file ChangeLog" />
<arg value="--tags" />
<arg value="--utc" />
<arg value="--window 604800" />
<arg value="--prune" />
</shell>
</target>
</project>