-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
497 lines (457 loc) · 16 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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
<?xml version="1.0" encoding="iso-8859-1" ?>
<!-- $Id$ -->
<project name="jas" default="usage" basedir="."
xmlns:jacoco="antlib:org.jacoco.ant"
xmlns:ivy="antlib:org.apache.ivy.ant"
>
<!-- xmlns:artifact="antlib:org.apache.maven.artifact.ant" -->
<property name="src" value="src" />
<property name="testsrc" value="trc" />
<property name="mpjsrc" value="mpj/src" />
<property name="mpisrc" value="mpi/src" />
<property name="jysrc" value="jython/src" />
<!--property name="jlinalg" value="../jas-versions/jlinalg_adapter/edu" /-->
<property name="bin" value="edu" />
<property name="build" value="." />
<property name="doc" value="doc/api" />
<property name="texdoc" value="doc/tex" />
<property name="test" value="test" />
<property name="libs" value="${basedir}/../lib" />
<property name="antlib" value="/home/kredel/.ant/lib/" />
<!--property name="log4j" value="${libs}/log4j.jar" /-->
<!--property name="log4j" value="${libs}/mylog.jar" /-->
<!--property name="log4j" value="${libs}/nolog.jar" /-->
<!--property name="log4j" value="${libs}/log4j-1.2.17.jar" /-->
<property name="log4j" value="${libs}/log4j-core-2.17.1.jar:${libs}/log4j-api-2.17.1.jar" />
<property name="ACmath" value="commons-math_adapter-bin.jar:${libs}/commons-math3-3.3.jar" />
<!--property name="junit" value="${libs}/junit-3.8.jar" /-->
<property name="junit" value="${libs}/junit-4.13.1.jar:${libs}/hamcrest-core-1.3.jar" />
<property name="jomp" value="${libs}/jomp1.0b.jar" />
<property name="jython" value="${libs}/jython.jar" />
<property name="meditor" value="${libs}/meditor.jar" />
<property name="tnj" value="${libs}/tnj.jar" />
<property name="tex" value="${libs}/texgen.jar" />
<property name="lint" value="${libs}/lint4j.jar" />
<property name="l4j.level" value="3" />
<property name="l4j.exact" value="true" />
<property name="cp" value="${log4j}:${junit}:." />
<property name="doccp" value="${log4j}:${junit}" />
<property name="dist.dir" value="target" />
<property name="ivy-publish.overwrite" value="true" />
<property name="dist" value="../jas-versions/jas-2.7" />
<property name="tmpdist" value="../jas-versions/tmp" />
<property name="artifactId" value="jas" />
<property name="svnrev" value="200" />
<property name="gitrev" value="${svnrev}" />
<!--property name="version" value="2.7.${SVNREV}" /--> <!-- no more set in vorher-->
<!--
<taskdef name="lint4j" classname="com.jutils.lint4j.ant.Lint4jAntTask">
<classpath>
<pathelement location="${lint}"/>
</classpath>
</taskdef>
-->
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${antlib}/jacocoant.jar"/>
</taskdef>
<!--
-->
<target name="vorher" >
<!-- set properties DSTAMP, TSTAMP -->
<tstamp />
<mkdir dir="edu/jas" />
<mkdir dir="${test}" />
<mkdir dir="doc" />
<mkdir dir="${tmpdist}" />
<!--exec executable="svnlook" outputproperty="svnrev" >
<arg line="youngest /home/SUBVERSION/jas"/>
</exec-->
<property name="version" value="2.7.${gitrev}" />
<!--echo message="artifact version = ${artifactId}-${version}" /-->
</target>
<target name="usage" >
<echo message="ant compile" />
<echo message="ant run -Dclass=<class> -Dargs='command-line arguments'" />
<echo message="ant resolve # use ivy to retrieve dependency jars" />
<echo message="ant <other-target>" />
<echo message="basedir = ${basedir}" />
<echo message="libs = ${libs}" />
<echo message="java -version = ${ant.java.version}" />
<!--echo message="java.home = ${java.home}" /-->
<!--echoproperties /-->
</target>
<target name="recompile" depends="vorher,distclean" description="compile after distclean">
<javac destdir="${build}"
debug="on" debuglevel="lines,source"
classpath="${cp}"
includeantruntime="false"
>
<src path="${src}" />
<src path="${testsrc}" />
<!--compilerarg value="-Xlint:unchecked" /-->
<!--compilerarg value="-Xlint:deprecation" /-->
</javac>
</target>
<target name="compile" depends="vorher" description="compilation of changed sources">
<javac destdir="${build}"
debug="on" debuglevel="lines,source"
classpath="${cp}"
listfiles="true"
includeantruntime="false"
>
<compilerarg value="-Xlint:unchecked" />
<!--
<compilerarg value="-Xlint:-unchecked" />
<compilerarg value="-Xlint:deprecation" />
-->
<src path="${src}" />
<src path="${testsrc}" />
</javac>
</target>
<target name="recomp8" depends="vorher,distclean" >
<javac destdir="${build}"
debug="on" debuglevel="lines,source"
classpath="${cp}"
source="1.8"
target="1.8"
bootclasspath="/usr/lib64/jvm/java-1.8.0/jre/lib/rt.jar"
includeantruntime="false"
>
<src path="${src}" />
<src path="${testsrc}" />
</javac>
</target>
<target name="doc" depends="vorher" description="generate javadoc">
<javadoc destdir="${doc}"
classpath="${doccp}"
overview="doc/overview.html"
author="true"
linksource="true"
additionalparam="-Xdoclint:none -html5"
>
<!-- - - no-module-directories
private="true"
linksource="true"
-->
<!--tag name="unused" description="Not used" scope="all" /-->
<!--tag name="todo" description="To do" scope="all" /-->
<!--tag name="fix" description="Fix me" scope="all" /-->
<!--tag name="usage" description="Usage" scope="all" /-->
<fileset dir="${src}" includes="**/*.java" />
<fileset dir="${testsrc}" includes="**/*.java" />
<!--fileset dir="${mpjsrc}" includes="**/*.java" /-->
<!--fileset dir="${jysrc}" includes="**/*.java" /-->
</javadoc>
</target>
<target name="texdoc" >
<javadoc sourcepath="${src}" destdir="${texdoc}"
classpath="${doccp}"
doclet="TexGen"
docletpath="${tex}"
verbose="true"
>
<fileset dir="${src}" includes="**/*.java" />
</javadoc>
</target>
<target name="timing" depends="vorher" >
<java classname="edu.jas.poly.PolynomialTimings"
classpath="${cp}"
fork="yes" />
</target>
<target name="run" depends="compile" description="run -Dclass=c.l.a.s.s -Dargs=a-r-g-s">
<java classname="${class}"
classpath="${cp}"
fork="yes" >
<arg line="${args}"/>
<!--
<jvmarg value="-verbose:gc"/>
<jvmarg value="-Xmx12900M"/>
<jvmarg value="-Xms8900M"/>
<jvmarg value="-server"/>
<jvmarg value="-verbose:class"/>
<jvmarg value="-Dorg.apache.logging.log4j.simplelog.StatusLogger.level=DEBUG"/>
-->
</java>
</target>
<target name="junit"
if="class"
depends="compile" >
<junit printsummary="yes"
fork="yes"
showoutput="yes"
timeout="10000"
haltonfailure="no" >
<!--
<jvmarg value="-server"/>
<jvmarg value="-verbose:gc"/>
<jvmarg value="-Xmx2900M"/>
<jvmarg value="-Xms2900M"/>
<jvmarg value="-ea"/>
-->
<formatter type="plain" /> <!-- plain, xml, brief -->
<classpath path="${cp}" />
<test name="${class}"
todir="${test}"
outfile="TEST-1-${class}" />
</junit>
</target>
<target name="test"
depends="compile" >
<junit printsummary="yes"
fork="yes"
showoutput="yes"
timeout="20000"
haltonfailure="no" >
<!--
<jvmarg value="-server"/>
<jvmarg value="-verbose:gc"/>
<jvmarg value="-Xmx2900M"/>
<jvmarg value="-Xms2900M"/>
-->
<jvmarg value="-ea"/>
<classpath path="${cp}" />
<formatter type="plain" /> <!-- plain, xml, brief -->
<batchtest todir="${test}" >
<fileset dir="${build}">
<include name="edu/jas/**/*Test.class"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="exam" depends="compile" >
<java classname="edu.jas.poly.Examples" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.vector.Examples" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.gbufd.Examples" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.ps.Examples" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.ps.ExamplesMulti" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.ufd.Examples" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.ufd.ExamplesPartialFraction" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.integrate.Examples" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.integrate.ExamplesMore" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.application.Examples" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
<java classname="edu.jas.application.ExamplesGeoTheorems" classpath="${cp}" fork="yes" >
<arg line="1" />
</java>
</target>
<target name="lint" depends="vorher" >
<lint4j sourcepath="${src}"
classpath="${cp}"
packages="edu.jas.*"
level="${l4j.level}"
exact="${l4j.exact}" >
</lint4j>
</target>
<target name="jdepend" depends="vorher" >
<jdepend format="text"
outputfile="test/jdepend-report-${DSTAMP}.out"
>
<exclude name="java.*" />
<exclude name="javax.*" />
<exclude name="org.apache.*" />
<exclude name="junit.*" />
<exclude name="*Test" /> <!-- not working -->
<classespath>
<pathelement location="${bin}"/>
</classespath>
<!--sourcespath>
<pathelement location="${src}"/>
</sourcespath-->
</jdepend>
</target>
<target name="coverage"
depends="vorher" >
<jacoco:coverage>
<junit printsummary="yes"
fork="yes"
showoutput="yes"
timeout="20000"
haltonfailure="no" >
<classpath path="${cp}" />
<formatter type="plain" /> <!-- plain, xml, brief -->
<batchtest todir="${test}" >
<fileset dir="${build}">
<include name="edu/**/*Test.class"/>
<!--no junit constructor: include name="edu/**/*Examples*.class"/-->
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
</target>
<target name="jacoco" depends="vorher" > <!-- coverage -->
<jacoco:report>
<executiondata>
<file file="jacoco.exec"/>
</executiondata>
<structure name="Java Algebra System Jacoco Report">
<classfiles>
<fileset dir="edu">
<exclude name="**/*Test.class"/>
<exclude name="**/*Examples*"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="src"/>
<!--fileset dir="trc"/-->
</sourcefiles>
</structure>
<html destdir="report"/>
</jacoco:report>
</target>
<target name="jar" depends="vorher" >
<jar jarfile="/tmp/jas-ant-${DSTAMP}.jar" >
<fileset dir="." includes="**/*.java" />
<fileset dir="." includes="**/*.html" />
<fileset dir="." includes="*.py" />
<fileset dir="." includes="examples/*.py" />
<fileset dir="." includes="examples/*.rb" />
<fileset dir="." includes="**/*.jas" />
<fileset dir="." includes="build.xml Makefile log4j.properties" />
</jar>
</target>
<target name="bin-jar" depends="vorher" >
<jar jarfile="jas-bin-${DSTAMP}.jar"
manifest="GBManifest.MF"
>
<fileset dir="." includes="**/*.class" />
<!--fileset dir="." includes="log4j.properties log4j2.properties" /-->
</jar>
</target>
<target name="packmvn" depends="vorher,compile">
<!-- define artifacts' name, which follows the convention of Maven -->
<property name="pom-xml" value="${artifactId}-${version}.pom" />
<property name="bin-jar" value="${artifactId}-${version}.jar" />
<property name="javadoc-jar" value="${artifactId}-${version}-javadoc.jar" />
<property name="sources-jar" value="${artifactId}-${version}-sources.jar" />
<!-- copy/rename the bytecode jar -->
<property name="m2dist" value="${tmpdist}/${version}" />
<mkdir dir="${m2dist}" />
<replace file="${dist}/pom.xml" token="@SVNREV@" value="${version}" />
<copy file="${dist}/pom.xml" tofile="${m2dist}/${pom-xml}" />
<copy file="${dist}/${artifactId}-${version}-bin.jar" tofile="${m2dist}/${bin-jar}" />
<copy file="${dist}/${artifactId}-${version}-doc.zip" tofile="${m2dist}/${javadoc-jar}" />
<copy file="${dist}/${artifactId}-${version}-src.zip" tofile="${m2dist}/${sources-jar}" />
<!-- sign the the pom and jars -->
<delete verbose="true" >
<fileset dir="${m2dist}" includes="*.asc" />
<fileset dir="${tmpdist}" includes="*bundle.jar" />
</delete>
<exec executable="gpg" >
<arg value="-u C5283F53"/>
<arg value="-ab"/>
<arg value="${m2dist}/${pom-xml}"/>
</exec>
<exec executable="gpg" >
<arg value="-u C5283F53"/>
<arg value="-ab"/>
<arg value="${m2dist}/${bin-jar}"/>
</exec>
<exec executable="gpg" >
<arg value="-u C5283F53"/>
<arg value="-ab"/>
<arg value="${m2dist}/${javadoc-jar}"/>
</exec>
<exec executable="gpg" >
<arg value="-u C5283F53"/>
<arg value="-ab"/>
<arg value="${m2dist}/${sources-jar}"/>
</exec>
<!-- create bundle for upload, again -->
<jar jarfile="${tmpdist}/${artifactId}-${version}-bundle.jar" >
<fileset dir="${m2dist}" includes="${pom-xml}" />
<fileset dir="${m2dist}" includes="${bin-jar}" />
<fileset dir="${m2dist}" includes="${javadoc-jar}" />
<fileset dir="${m2dist}" includes="${sources-jar}" />
<fileset dir="${m2dist}" includes="*.asc" />
</jar>
</target>
<target name="clean" description="remove backup files">
<delete verbose="true" >
<fileset dir="${src}" defaultexcludes="no" includes="**/*~" />
<fileset dir="${testsrc}" defaultexcludes="no" includes="**/*~" />
</delete>
</target>
<target name="distclean" depends="clean" description="remove all class files">
<delete verbose="true" >
<fileset dir="${src}" includes="**/*.class" />
<fileset dir="${testsrc}" includes="**/*.class" />
<fileset dir="${build}" includes="**/*.class" />
</delete>
</target>
<target name="resolve" description="retrieve dependencies with ivy">
<property name="ivy.lib.dir" value="${libs}"/>
<!--ivy:cleancache /-->
<ivy:retrieve />
</target>
<target name="publish" description="publish artifacts with ivy">
<echo message="publish is not working" />
<ivy:resolve />
<ivy:publish
forcedeliver="${ivy-publish.forcedeliver}"
overwrite="${ivy-publish.overwrite}"
resolver="local">
<artifacts pattern="[artifact]-[revision].[ext]"/>
</ivy:publish>
<!--ivy:publish
forcedeliver="${ivy-publish.forcedeliver}"
overwrite="${ivy-publish.overwrite}"
resolver="local">
<artifacts pattern="[artifact]-[revision]-src.[ext]"/>
</ivy:publish-->
</target>
<!--artifacts pattern="${ivy-publish.artifacts.pattern}"/-->
<target name="untabify" depends="vorher" >
<fixcrlf srcdir="${src}"
tab="remove"
tablength="8"
javafiles="yes"
includes="**/*.java"
/>
<fixcrlf srcdir="${testsrc}"
tab="remove"
tablength="8"
javafiles="yes"
includes="**/*.java"
/>
<fixcrlf srcdir="${mpisrc}"
tab="remove"
tablength="8"
javafiles="yes"
includes="**/*.java"
/>
<fixcrlf srcdir="${mpjsrc}"
tab="remove"
tablength="8"
javafiles="yes"
includes="**/*.java"
/>
</target>
<target name="sed-isdone" depends="vorher" >
<replace dir="${src}"
token="@param C coefficient"
value="@typeparam C coefficient"
summary="true"
>
<include name="**/*.java" />
</replace>
</target>
</project>