forked from Riverside-Software/pct
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
452 lines (408 loc) · 18.3 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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<?xml version="1.0" encoding="utf-8"?>
<project name="PCT" default="dist" xmlns:if="ant:if" xmlns:unless="ant:unless">
<property environment="env" />
<!-- If DLC10, DLC10-64 and DLC11 are provided as properties, then skip loading properties from file -->
<condition property="skip.properties" value="true">
<and>
<isset property="DLC10" />
<isset property="DLC10-64" />
<isset property="DLC11" />
<isset property="DLC12" />
</and>
</condition>
<property name="pct.release" value="216.pre" />
<property name="pct.version.string" value="pct-${pct.release}-${env.BRANCH_NAME}-${GIT_COMMIT}" />
<!-- Some directories definitions -->
<property name="src.java" location="src/java" />
<property name="src.progress" location="src/progress" />
<property name="src.test" location="src/test" />
<property name="build" location="build" />
<property name="build-java" location="build/java" />
<property name="build-test" location="build/test" />
<property name="build-v10" location="build/build-v10" />
<property name="build-v10-64" location="build/build-v10-64" />
<property name="build-v11" location="build/build-v11" />
<property name="build-v12" location="build/build-v12" />
<property name="build-win-v11" location="build/windows-v11" />
<property name="build-win-v12" location="build/windows-v12" />
<property name="doc" location="doc" />
<property name="dist" location="dist" />
<!-- Properties that control Java build options -->
<property name="debug" value="true" />
<property name="deprecation" value="true" />
<property name="optimize" value="false" />
<property name="javac.source" value="1.7" />
<property name="javac.target" value="1.7" />
<!-- Different filesets depending on version -->
<fileset id="fs.v10" dir="${src.progress}">
<include name="pct/*.p" />
<include name="pct/v10/*.p" />
<include name="pct/v102b/*.p" />
</fileset>
<fileset id="fs.v11" dir="${src.progress}">
<include name="pct/*.p" />
<include name="pct/v11/*.p" />
<include name="rssw/**/*.cls" />
</fileset>
<fileset id="fs.v12" dir="${src.progress}">
<include name="pct/*.p" />
<exclude name="pct/pctOEUnitRunner.p" />
<include name="pct/v12/*.p" />
<include name="rssw/**/*.cls" />
</fileset>
<fileset id="fs.classDoc" dir="${src.progress}">
<include name="Consultingwerk/**/*.cls" />
<include name="Consultingwerk/**/*.p" />
</fileset>
<!-- Different propath depending on version -->
<path id="pp.v8">
<pathelement location="${src.progress}" />
</path>
<path id="pp.v9">
<pathelement location="${src.progress}" />
</path>
<path id="pp.v10">
<pathelement location="${src.progress}" />
<pathelement location="lib/OEUnit_dlc10.pl" />
</path>
<path id="pp.v10-64">
<pathelement location="${src.progress}" />
<pathelement location="lib/OEUnit_dlc10-64.pl" />
</path>
<path id="pp.v11">
<pathelement location="${src.progress}" />
<pathelement location="lib/OEUnit_dlc11.pl" />
</path>
<path id="pp.v12">
<pathelement location="${src.progress}" />
</path>
<!-- Classpath for PCT compilation -->
<path id="pct.compil">
<pathelement location="lib/ant.jar" />
<pathelement location="lib/jcommander-1.30.jar" />
<pathelement location="lib/gson-2.2.4.jar" />
<pathelement location="lib/ast.jar" />
<pathelement location="lib/ast-dependencies.jar" />
<!-- ABLDuck classes -->
<pathelement location="lib/commonmark-0.11.0.jar"/>
</path>
<path id="pct.test.compil">
<path refid="pct.compil" />
<pathelement location="${build-java}" />
<pathelement location="lib/testng-6.13.1.jar" />
<pathelement location="lib/ini4j-0.5.1.jar" />
<pathelement location="lib/guava.jar" />
<pathelement location="lib/mockito-core-3.0.0.jar" />
<pathelement location="lib/byte-buddy-1.9.14.jar" />
<pathelement location="lib/byte-buddy-agent-1.9.14.jar" />
<pathelement location="lib/hamcrest-2.1.jar" />
<pathelement location="lib/objenesis-2.6.jar" />
</path>
<target name="init" description="Initialize PCT builder" depends="init-properties">
<tstamp>
<format property="year" pattern="yyyy" />
</tstamp>
<mkdir dir="${build-java}" />
<mkdir dir="${build-test}" />
<mkdir dir="${build-v10}" />
<mkdir dir="${build-v10-64}" />
<mkdir dir="${build-v11}" />
<mkdir dir="${doc}" />
<mkdir dir="${build-v12}" />
<mkdir dir="${dist}" />
<!-- Checking v10 and v11 availability -->
<available file="${DLC10}/version" property="dlc.v10.present" />
<available file="${DLC10-64}/version" property="dlc.v10-64.present" />
<available file="${DLC11}/version" property="dlc.v11.present" />
<available file="${DLC12}/version" property="dlc.v12.present" />
<echo message="Version tag : ${pct.version.string}" />
<echo file="${src.java}/com/phenix/pct/PCT.properties">PCTVersion=${pct.version.string}</echo>
</target>
<target name="init-properties" description="Initialize properties" unless="${skip.properties}">
<echo message="Loading properties from pct.build.properties" />
<property file="${basedir}/pct.build.properties" />
</target>
<target name="build" depends="init" description="Java source files compilation">
<javac srcdir="${src.java}" destdir="${build-java}" debug="${debug}" source="${javac.source}" target="${javac.target}" deprecation="${deprecation}" optimize="${optimize}" encoding="utf-8" includeAntRuntime="false">
<include name="com/phenix/pct/*.java" />
<include name="net/cordova/prounit/*.java" />
<include name="eu/rssw/pct/**/*.java" />
<include name="za/co/mip/**/*.java" />
<classpath refid="pct.compil" />
</javac>
<copy todir="${build-java}">
<fileset dir="${src.java}" includes="**/*.properties" />
</copy>
</target>
<target name="jar-lite" depends="build" description="Bootstrap JAR file">
<jar jarfile="${dist}/bootstrap.jar">
<fileset dir="${build-java}">
<include name="**/*.class" />
<include name="**/*.properties" />
<exclude name="com/phenix/pct/*Test.class" />
</fileset>
</jar>
<jar jarfile="${dist}/prolib.jar">
<zipfileset src="lib/jcommander-1.30.jar" />
<fileset dir="${build-java}">
<include name="eu/rssw/pct/standalone/**/*.class" />
<include name="com/phenix/pct/PLReader*.class" />
<include name="com/phenix/pct/FileEntry.class" />
<include name="com/phenix/pct/RCodeInfo*.class" />
</fileset>
<manifest>
<attribute name="Main-Class" value="eu.rssw.pct.standalone.Prolib" />
</manifest>
</jar>
</target>
<target name="declare-bootstrap" depends="jar-lite" description="Bootstrap tasks declaration">
<taskdef resource="bootstrap.properties" classpath="${dist}/bootstrap.jar" />
</target>
<target name="cond.pbuild" if="${build.this.version}">
<exec executable="${dlcHome}/bin/_dbutil">
<arg value="procopy" />
<arg value="${dlcHome}/empty.db" />
<arg value="empty" />
<env key="DLC" value="${dlcHome}" />
</exec>
<bootstrapCompile destdir="${buildDir}" debugListing="true" listing="true" keepXref="true" xmlXref="${xmlxref}" md5="true" minSize="false" graphicalMode="false" dlcHome="${dlcHome}" includedPL="false" compileUnderscore="true" cpstream="utf-8" relativePaths="true" requireFullNames="true" requireFieldQualifiers="true">
<fileset refid="${fsid}" />
<propath refid="${propid}" />
<PCTRunOption name="-cprcodeout" value="undefined" />
<PCTConnection dbName="empty" singleUser="true" logicalName="dictdb">
<PCTAlias name="dictdb" />
<PCTAlias name="dictdb2" />
</PCTConnection>
</bootstrapCompile>
<bootstrapLibrary destfile="${build}/${libName}" dlcHome="${dlcHome}" encoding="undefined">
<fileset dir="${buildDir}">
<include name="**/*.r" />
</fileset>
</bootstrapLibrary>
<delete>
<fileset dir="${basedir}" includes="empty*.*" />
</delete>
</target>
<target name="pbuild" depends="declare-bootstrap" description="Progress code compilation">
<echo message="Checking v10 in ${DLC10}" />
<echo message="Checking v10-64 in ${DLC10-64}" />
<echo message="Checking v11 in ${DLC11}" />
<echo message="Checking v12 in ${DLC12}" />
<antcall target="cond.pbuild">
<param name="build.this.version" value="dlc.v10.present" />
<param name="dlcHome" value="${DLC10}" />
<param name="buildDir" value="${build-v10}" />
<param name="libName" value="pct10.pl" />
<param name="fsid" value="fs.v10" />
<param name="propid" value="pp.v10" />
<param name="xmlxref" value="false" />
</antcall>
<antcall target="cond.pbuild">
<param name="build.this.version" value="dlc.v10-64.present" />
<param name="dlcHome" value="${DLC10-64}" />
<param name="buildDir" value="${build-v10-64}" />
<param name="libName" value="pct10-64.pl" />
<param name="fsid" value="fs.v10" />
<param name="propid" value="pp.v10-64" />
<param name="xmlxref" value="false" />
</antcall>
<antcall target="cond.pbuild">
<param name="build.this.version" value="dlc.v11.present" />
<param name="dlcHome" value="${DLC11}" />
<param name="buildDir" value="${build-v11}" />
<param name="libName" value="pct11.pl" />
<param name="fsid" value="fs.v11" />
<param name="propid" value="pp.v11" />
<param name="xmlxref" value="true" />
</antcall>
<antcall target="cond.pbuild">
<param name="build.this.version" value="dlc.v12.present" />
<param name="dlcHome" value="${DLC12}" />
<param name="buildDir" value="${build-v12}" />
<param name="libName" value="pct12.pl" />
<param name="fsid" value="fs.v12" />
<param name="propid" value="pp.v12" />
<param name="xmlxref" value="true" />
</antcall>
<zip destfile="${build}/pct-src.zip">
<fileset dir="${src.progress}" includes="**/*" excludes="Consultingwerk/Studio/ClassDocumentation/Templates/resources/**/*" />
</zip>
</target>
<target name="classDoc" depends="declare-bootstrap" description="Windows compilation of class documentation">
<mkdir dir="${build-win-v11}" />
<bootstrapCompile destdir="${build-win-v11}" md5="true" minSize="false" graphicalMode="true" dlcHome="${DLC11}" includedPL="false" cpstream="iso8859-1" debugListing="true" listing="true" relativePaths="true" requireFullNames="true" requireFieldQualifiers="true">
<fileset refid="fs.classDoc" />
<propath>
<pathelement location="${src.progress}" />
</propath>
<PCTRunOption name="-cprcodeout" value="undefined" />
</bootstrapCompile>
<mkdir dir="${build-win-v12}" />
<bootstrapCompile destdir="${build-win-v12}" md5="true" minSize="false" graphicalMode="true" dlcHome="${DLC12}" includedPL="false" cpstream="iso8859-1" debugListing="true" listing="true" relativePaths="true" requireFullNames="true" requireFieldQualifiers="true">
<fileset refid="fs.classDoc" />
<propath>
<pathelement location="${src.progress}" />
</propath>
<PCTRunOption name="-cprcodeout" value="undefined" />
</bootstrapCompile>
<zip destFile="${dist}/classDoc.zip">
<zipfileset dir="${build-win-v11}" prefix="v11" includes="**/*.r" />
<zipfileset dir="${build-win-v12}" prefix="v12" includes="**/*.r" />
</zip>
</target>
<target name="fakeClassDoc" unless="classDocOK">
<echo message="Generating fake classDoc.zip file" />
<echo file="${dist}/empty.txt" />
<zip destFile="${dist}/classDoc.zip" whenEmpty="create">
<zipfileset dir="${dist}" includes="empty.txt" prefix="v11" />
<zipfileset dir="${dist}" includes="empty.txt" prefix="v12" />
</zip>
</target>
<target name="jar" depends="pbuild,test-build" description="JAR file generation">
<condition property="classDocOK">
<resourceexists><file file="${dist}/classDoc.zip" /></resourceexists>
</condition>
<antcall target="fakeClassDoc" />
<!-- Updating pct11.pl and pct12.pl with rcode compiled on Windows -->
<mkdir dir="classDocTemp" />
<copy todir="classDocTemp">
<zipfileset src="dist/classDoc.zip" />
</copy>
<bootstrapLibrary destfile="${build}/pct11.pl" dlcHome="${DLC11}" encoding="undefined" if:true="${dlc.v11.present}">
<fileset dir="classDocTemp/v11" includes="**/*.r" />
</bootstrapLibrary>
<bootstrapLibrary destfile="${build}/pct12.pl" dlcHome="${DLC12}" encoding="undefined" if:true="${dlc.v12.present}">
<fileset dir="classDocTemp/v12" includes="**/*.r" />
</bootstrapLibrary>
<delete dir="classDocTemp" />
<zip destfile="${build}/ablduck.zip">
<fileset dir="${src.java}/za/co/mip/ablduck/resources" />
</zip>
<jar jarfile="${dist}/PCT.jar">
<fileset dir="${build-java}">
<include name="**/*.class" />
<include name="**/*.properties" />
</fileset>
<fileset dir="${build}">
<include name="pct10.pl" />
<include name="pct10-64.pl" />
<include name="pct11.pl" />
<include name="pct12.pl" />
<include name="pct-src.zip" />
</fileset>
<zipfileset dir="${build}" includes="ablduck.zip" prefix="za/co/mip/ablduck/resources" />
<fileset dir="${src.java}">
<include name="eu/rssw/pct/antlib.xml" />
<include name="eu/rssw/pct/oedoc/antlib.xml" />
<include name="za/co/mip/ablduck/resources/ablduck.zip" />
</fileset>
<zipfileset src="lib/gson-2.2.4.jar" />
<!-- ABLDuck classes -->
<zipfileset src="lib/commonmark-0.11.0.jar"/>
<zipfileset dir="${src.progress}/Consultingwerk/Studio/ClassDocumentation/Templates" prefix="templates" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<section name="common">
<attribute name="Specification-Title" value="PCT" />
<attribute name="Specification-Version" value="${pct.release}" />
<attribute name="Specification-Vendor" value="Riverside Software" />
<attribute name="Implementation-Title" value="PCT" />
<attribute name="Implementation-Version" value="${GIT_COMMIT}" />
<attribute name="Implementation-Vendor" value="Riverside Software" />
</section>
</manifest>
</jar>
</target>
<target name="test-build" depends="build" description="Builds TestNG tests">
<javac srcdir="${src.test}" destdir="${build-test}" debug="${debug}" source="${javac.source}" target="${javac.target}" deprecation="${deprecation}" optimize="${optimize}" encoding="utf-8" includeAntRuntime="false">
<include name="org/ini4j/**/*.java" />
<include name="com/phenix/pct/*.java" />
<include name="net/cordova/prounit/*.java" />
<include name="za/co/mip/ablduck/*.java" />
<classpath refid="pct.test.compil" />
</javac>
</target>
<target name="prepare-test" >
<delete dir="testbox" />
<mkdir dir="testbox" />
<mkdir dir="testbox/PCTCompileExt" />
<copy todir="testbox/PCTCompileExt">
<fileset dir="tests/PCTCompile" />
</copy>
<replace dir="testbox/PCTCompileExt" includes="test??/build.xml" token="PCTCompile" value="PCTCompileExt" />
<replace dir="testbox/PCTCompileExt" includes="test??/build.xml" token="pct:compile" value="pct:compile_ext" />
<copy todir="testbox">
<fileset dir="tests" />
</copy>
<mkdir dir="testbox/ClassDocumentation/test3/src" />
<copy todir="testbox/ClassDocumentation/test3/src">
<fileset dir="${src.progress}" includes="Consultingwerk/**/*" />
</copy>
</target>
<target name="javadoc" depends="build" description="Javadoc generation">
<javadoc destdir="${doc}" useexternalfile="yes" charset="utf-8" encoding="utf-8" additionalParam="-Xdoclint:all,-missing">
<packageset dir="${src.java}" />
<classpath>
<path refid="pct.compil" />
<pathelement location="${build-java}" />
</classpath>
<group title="PCT Core" packages="com.phenix.pct.*" />
<group title="Class documentation" packages="eu.rssw.pct.*" />
<group title="ABLDuck" packages="za.co.mip.ablduck.*" />
<group title="ProUnit" packages="net.cordova.prounit.*" />
<bottom>Copyright © 2003-${year} Gilles QUERRET. All Rights Reserved.</bottom>
<link href="https://docs.oracle.com/javase/8/docs/api/" />
<link href="https://ant.apache.org/manual/api/" />
</javadoc>
<jar destfile="${dist}/PCT-javadoc.jar">
<fileset dir="${doc}" />
</jar>
</target>
<target name="srcdist" description="Generates source zip/tarball archive">
<jar destfile="${dist}/PCT-sources.jar">
<fileset dir="src/java" />
<zipfileset dir="src/progress" prefix="progress" />
</jar>
</target>
<target name="testdist">
<zip destfile="${dist}/testcases.zip" encoding="utf-8">
<zipfileset dir="${build-test}" includes="**/*" prefix="build/test" />
<zipfileset dir="tests" includes="**/*" prefix="testbox" />
<zipfileset dir="${src.progress}" includes="Consultingwerk/**/*" prefix="testbox/ClassDocumentation/test3/src" />
<zipfileset dir="lib" prefix="lib">
<include name="jaxb-*.jar" />
<include name="activation-*.jar" />
<include name="ast.jar" />
<include name="ast-dependencies.jar" />
<include name="ini4j-0.5.1.jar" />
<include name="guava.jar" />
<include name="testng-6.13.1.jar" />
<include name="jcommander-1.30.jar" />
<include name="jacocoant-0.8.4.jar" />
<include name="xmltask.jar" />
<include name="mockito-core-3.0.0.jar" />
<include name="objenesis-2.6.jar" />
<include name="hamcrest-2.1.jar" />
<include name="byte-buddy-1.9.14.jar" />
<include name="byte-buddy-agent-1.9.14.jar" />
<include name="*.pl" />
</zipfileset>
</zip>
</target>
<target name="install" depends="jar" >
<copy file="${dist}/PCT.jar" todir="${ant.library.dir}"/>
</target>
<target name="dist" depends="srcdist,javadoc,jar,testdist" />
<target name="clean" description="Nettoyage">
<delete dir="${build}" />
<delete dir="${dist}" />
<delete dir="${doc}" />
<delete>
<fileset dir=".">
<include name="pct*.tar.gz" />
<include name="pct*.zip" />
<include name="TEST*.xml" />
</fileset>
</delete>
</target>
</project>