forked from jgralab/jgralab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
515 lines (457 loc) · 20.8 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
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
<?xml version="1.0" encoding="UTF-8"?>
<!-- JGraLab - The Java Graph Laboratory -->
<!-- -->
<!-- Copyright (C) 2006-2013 Institute for Software Technology -->
<!-- University of Koblenz-Landau, Germany -->
<!-- [email protected] -->
<!-- -->
<!-- For bug reports, documentation and further information, visit -->
<!-- -->
<!-- https://github.com/jgralab/jgralab -->
<!-- -->
<!-- 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 3 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, see <http://www.gnu.org/licenses>. -->
<!-- -->
<!-- Additional permission under GNU GPL version 3 section 7 -->
<!-- -->
<!-- If you modify this Program, or any covered work, by linking or combining -->
<!-- it with Eclipse (or a modified version of that program or an Eclipse -->
<!-- plugin), containing parts covered by the terms of the Eclipse Public -->
<!-- License (EPL), the licensors of this Program grant you additional -->
<!-- permission to convey the resulting work. Corresponding Source for a -->
<!-- non-source form of such a combination shall include the source code for -->
<!-- the parts of JGraLab used as well as that of the covered work. -->
<project name="jgralab" basedir="." default="build">
<!-- override default properties -->
<property name="projectname" value="jgralab" />
<property name="main" value="JGraLab" />
<property name="documentexcludes" value="de.uni_koblenz.jgralab.greql.schema.*,de.uni_koblenz.jgralab.grumlschema.*,de.uni_koblenz.jgralab.plugin.*" />
<property name="unjarexcludes" value="clover/** apache/ant/** junit/**" />
<property name="test.suite" value="de.uni_koblenz.jgralabtest.RunTests" />
<property name="manifest.static" value="true" />
<!-- TODO: Currently the greqltest won't compile -->
<property name="testcompileexcludes" value="de/uni_koblenz/jgralabtest/greql/**" />
<!-- import the common build file -->
<import file="common.xml" />
<property name="license.file" value="../jgralab/license-header/gpl-3.0-header.txt" />
<property file="${testcases.dir}/jgralabtest.properties" />
<!-- enable clover for the testcases:
run with "$ ant with.clover build test clover.html" -->
<property name="clover.jar" value="${lib.dir}/clover/clover-3.1.3.jar" />
<taskdef resource="cloverlib.xml" classpath="${clover.jar}" />
<target name="with.clover">
<clover-setup />
</target>
<target name="clover.html">
<clover-report>
<current outfile="${project.dir}/build/clover-report" title="JGraLab">
<format type="html" />
<!-- What to include/exclude from the report (include
everything except the generated schema classes in
src/. -->
<fileset dir="${src.dir}" includes="**/*.java" excludes="de/uni_koblenz/jgralab/grumlschema/**/*.java de/uni_koblenz/jgralab/greql/schema/**/*.java de/uni_koblenz/jgralab/gretl/template/**/*.java" />
<fileset dir="${testcases.dir}" includes="**/*.java" />
<!-- Where are the test classes (listed separately in
the report) -->
<testsources dir="${testcases.dir}" includes="**/*.java" />
</current>
</clover-report>
<!-- After generating the report, delete the clover db and its
clover record files. -->
<clover-clean/>
</target>
<!-- classpath additions -->
<!-- here all needed common libs are included -->
<path id="classpathExtension">
<fileset dir="${lib.dir}/apache/commons/cli/" includes="**/*.jar" />
<fileset dir="${lib.dir}/apache/ant" includes="**/*.jar" />
<fileset dir="${lib.dir}/junit/" includes="**/*.jar" />
<pathelement path="${clover.jar}" />
</path>
<!-- set project specific properties -->
<property name="greql.schemafile" value="${src.dir}/de/uni_koblenz/jgralab/greql/GreqlSchema.tg" />
<property name="gruml.schemafile" value="${src.dir}/de/uni_koblenz/jgralab/schema/GrumlSchema.tg" />
<property name="gretl.templategraphschemafile" value="${src.dir}/de/uni_koblenz/jgralab/gretl/templateGraphSchema.tg" />
<!-- the directory location for the testschemas -->
<property name="testschemas.dir" value="${testcases.dir}/testschemas" />
<!-- compile src.dir and include statements for the targets
it is always "targetname.src" and "targetname.includes" -->
<property name="core.src" value="${src.dir}/de/uni_koblenz/jgralab" />
<property name="core.includes" value="*.java exception/** graphmarker/** schema/** impl/** algolib/functions/** eca/ECARuleManagerInterface.java" />
<property name="pcollections.src" value="${src.dir}/org/pcollections" />
<property name="tgtools.src" value="${src.dir}/de/uni_koblenz/jgralab/utilities" />
<property name="tgtools.includes" value="tgschema2java/** ant/TgSchema2JavaTask.java ant/DeleteGeneratedSchemaTask.java tg2whatever/** tgmerge/**" />
<property name="greql.src" value="${src.dir}/de/uni_koblenz/jgralab/greql" />
<property name="gretl_eca.src" value="${src.dir}/de/uni_koblenz/jgralab/" />
<property name="gretl_eca.includes" value="gretl/** eca/**" />
<property name="algolib.src" value="${src.dir}/de/uni_koblenz/jgralab/algolib" />
<property name="gruml.src" value="${src.dir}/de/uni_koblenz/jgralab/grumlschema/" />
<property name="graphvalidator.src" value="${src.dir}/de/uni_koblenz/jgralab" />
<property name="graphvalidator.includes" value="graphvalidator/**" />
<property name="rsa.src" value="${src.dir}/de/uni_koblenz/jgralab/utilities" />
<property name="rsa.includes" value="ant/Rsa2TgTask.java rsa2tg/** tg2schemagraph/**" />
<property name="tg2dot.src" value="${src.dir}/de/uni_koblenz/jgralab/utilities" />
<property name="tg2dot.includes" value="tg2dot/** tg2image/**" />
<property name="common-tools.src" value="${src.dir}/de/uni_koblenz/jgralab/utilities" />
<property name="common-tools.includes" value="common/**" />
<property name="utilities.src" value="${src.dir}/de/uni_koblenz/jgralab/utilities" />
<property name="utilities.includes" value="*/**" />
<property name="utilities.excludes" value="tgschema2java/**" />
<!-- The targets -->
<target name="build" depends="clean,createClassesDir,ist_utilities,compile,modify_manifest,jar" />
<target name="clean">
<delete dir="${classes.dir}" />
<delete file="${jar.dir}/jgralab.jar" />
<delete dir="${tmp.dir}" />
<delete dir="${testclasses.dir}" />
<delete dir="${src.dir}/de/uni_koblenz/jgralab/greql/schema" />
<delete dir="${src.dir}/de/uni_koblenz/jgralab/grumlschema" />
<delete dir="${src.dir}/de/uni_koblenz/jgralab/gretl/template" />
<delete dir="${testcases.dir}/de/uni_koblenz/jgralabtest/schemas" />
<delete dir="${testcases.dir}/de/uni_koblenz/jgralabtest/gretl/schemas" />
<delete file="${testschemas.dir}/greqltestschema.tg" />
<delete dir="testit/testdata" />
</target>
<!-- ist_utilities -->
<target name="ist_utilities">
<javac fork="true" srcdir="${src.dir}"
source="1.6" target="1.6"
includes="de/uni_koblenz/ist/utilities/**"
destdir="${classes.dir}"
memoryinitialsize="512m"
memorymaximumsize="512m"
classpathref="classpath"
debug="${debug}"
includeantruntime="false"
encoding="${javac.encoding}" >
</javac>
</target>
<!-- compile -->
<target name="compile" depends="pcollections,core,tgtools,greql,algolib,graphvalidator,rsa,utilities,gretl_and_eca,generatetestschemas">
<mkdir dir="testit/testdata" />
</target>
<target name="pcollections" depends="createClassesDir">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${pcollections.src}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<!-- jgralab -->
<!-- compiles jgralab basic sources -->
<target name="core" depends="createClassesDir">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${core.src}"
includes="${core.includes}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<!-- ant tasks for versioning -->
<target name="versiontasks" depends="ist_utilities,createClassesDir">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${tgtools.src}"
includes="ant/RetrieveVersion.java ant/BumpMicroVersion.java ant/BumpMinorVersion.java"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false" />
<taskdef name="bump_micro" classname="de.uni_koblenz.jgralab.utilities.ant.BumpMicroVersion" classpath="${classes.dir}" />
<taskdef name="bump_minor" classname="de.uni_koblenz.jgralab.utilities.ant.BumpMinorVersion" classpath="${classes.dir}" />
<taskdef name="retrieve_version" classname="de.uni_koblenz.jgralab.utilities.ant.RetrieveVersion" classpath="${classes.dir}" />
</target>
<!-- tgtools (utils which are needed for schema creation (TgSchema2Java)
and that don't depend on schemas themselves) -->
<target name="tgtools" depends="core">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${tgtools.src}"
includes="${tgtools.includes}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
<taskdef name="tgschema2java" classname="de.uni_koblenz.jgralab.utilities.ant.TgSchema2JavaTask" classpathref="classpath" />
<taskdef name="deletegeneratedschema" classname="de.uni_koblenz.jgralab.utilities.ant.DeleteGeneratedSchemaTask" classpath="${classes.dir}" />
</target>
<!-- compiles greql sources -->
<target name="greql" depends="tgtools,algolib">
<tgschema2java schemaFile="${greql.schemafile}" sourcePath="${src.dir}" />
<javac fork="true"
source="1.6" target="1.6"
srcdir="${greql.src}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<target name="algolib" depends="core">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${algolib.src}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<!-- graphvalidator -->
<target name="graphvalidator" depends="greql">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${graphvalidator.src}"
includes="${graphvalidator.includes}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<target name="rsa" depends="tg2dot,gruml,graphvalidator">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${rsa.src}"
includes="${rsa.includes}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
<taskdef classpathref="classpath" name="rsa2tg" classname="de.uni_koblenz.jgralab.utilities.ant.Rsa2TgTask" />
</target>
<target name="tg2dot" depends="gruml,graphvalidator,greql,common-tools">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${tg2dot.src}"
includes="${tg2dot.includes}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<target name="common-tools">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${common-tools.src}"
includes="${common-tools.includes}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<!-- compiles utility sources -->
<target name="utilities" depends="rsa,gruml,xmlschema">
<javac fork="true"
source="1.6" target="1.6"
srcdir="${utilities.src}"
includes="${utilities.includes}"
excludes="${utilities.excludes} ${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<!-- generates the xml graph schema -->
<target name="xmlschema" depends="tgtools,greql">
<tgschema2java schemaFile="${src.dir}/de/uni_koblenz/jgralab/utilities/xml2tg/XMLSchema.tg" sourcePath="${src.dir}" />
</target>
<!-- generates the gruml schema and compiles it -->
<target name="gruml" depends="tgtools,greql">
<tgschema2java schemaFile="${gruml.schemafile}" sourcePath="${src.dir}" />
<javac fork="true"
source="1.6" target="1.6"
srcdir="${gruml.src}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<!-- generates the schemas required for test cases without compiling them -->
<target name="generatetestschemas" depends="tgtools">
<taskdef classpathref="classpath" name="rsa2tg" classname="de.uni_koblenz.jgralab.utilities.ant.Rsa2TgTask" />
<!--
<taskdef name="tgschema2java" classname="de.uni_koblenz.jgralab.utilities.ant.TgSchema2JavaTask" classpath="${classes.dir}" />
-->
<rsa2tg xmifile="${testschemas.dir}/rsa-xmi/greqltestschema.xmi" schemafile="${testschemas.dir}/greqltestschema.tg" />
<!-- The jgralab & greql test schemas -->
<tgschema2java sourcePath="${testcases.dir}">
<fileset dir="${testschemas.dir}" includes="*.tg" />
</tgschema2java>
<!-- The GReTL test schemas -->
<tgschema2java sourcePath="${testcases.dir}">
<fileset dir="${testschemas.dir}/gretl" includes="*.tg" />
</tgschema2java>
<!-- The ECA test schemas -->
<tgschema2java sourcePath="${testcases.dir}">
<fileset dir="${testschemas.dir}/eca" includes="*.tg" />
</tgschema2java>
</target>
<!-- GReTL and ECA -->
<target name="gretl_and_eca" depends="greql">
<tgschema2java schemaFile="${gretl.templategraphschemafile}" sourcePath="${src.dir}"/>
<javac fork="true"
source="1.6" target="1.6"
srcdir="${gretl_eca.src}"
includes="${gretl_eca.includes}"
excludes="${no_package_info}"
destdir="${classes.dir}"
memoryinitialsize="${minmemsize}"
memorymaximumsize="${maxmemsize}"
classpathref="classpath"
debug="${debug}"
encoding="${javac.encoding}"
includeantruntime="false">
<compilerarg line="-Xlint:unchecked" />
</javac>
</target>
<!-- unjar -->
<!-- prepares additional common libraries to be added to the jar file -->
<target name="unjar" depends="common.unjar">
<!--
<unjar_mp dest="${tmp.dir}">
<fileset dir="${lib.dir}/apache/commons/cli/" includes="**/*.jar" />
</unjar_mp>
-->
<copy todir="${tmp.dir}/META-INF" file="${project.dir}/LICENSE" />
</target>
<target name="modify_manifest" depends="versiontasks">
<!-- sets the attribute "revision" -->
<retrieve_version />
<manifest file="${manifest.file}" mode="update">
<attribute name="Bundle-Version" value="${version}.${version.codename}" />
<attribute name="Main-Class" value="${main.fq}" />
<section name="de/uni_koblenz/jgralab/">
<attribute name="Implementation-Title" value="JGraLab" />
<attribute name="Implementation-Version" value="${version}@${version.codename}@${version.head}" />
<attribute name="Implementation-Vendor" value="University of Koblenz, Institute for Software Technology" />
</section>
</manifest>
</target>
<!-- release -->
<!-- calls targets modify, clean, jar, test and document -->
<target name="release" depends="cleanall,bumpmicro,build,sourcejar,document" />
<target name="bumpmicro_internal" depends="versiontasks">
<bump_micro />
</target>
<target name="bumpmicro" depends="bumpmicro_internal,modify_manifest" />
<target name="bumpminor_internal" depends="versiontasks">
<bump_minor />
</target>
<target name="bumpminor" depends="bumpminor_internal,modify_manifest" />
<target name="testcompile" depends="generatetestschemas,common.testcompile" />
<!-- test -->
<!-- run the test suite specified by test.suite -->
<target name="test" if="test.suite" depends="testcompile">
<mkdir dir="${testresults.dir}" />
<echo>Starting the test...</echo>
<junit fork="yes" forkmode="perTest" maxmemory="${maxmemsize}" printsummary="on" showoutput="true" outputtoformatters="true">
<jvmarg value="-enableassertions" />
<classpath>
<path refid="testclasspath" />
</classpath>
<formatter type="${test.formattertype}" />
<test name="${test.suite}" todir="${testresults.dir}" />
</junit>
</target>
<target name="manualtest" if="manual.test.suite">
<mkdir dir="${testresults.dir}" />
<echo>Starting the test...</echo>
<junit fork="yes" forkmode="perTest" maxmemory="${maxmemsize}" printsummary="on" showoutput="true" outputtoformatters="true">
<jvmarg value="-enableassertions" />
<classpath>
<path refid="testclasspath" />
</classpath>
<formatter type="${test.formattertype}" />
<test name="${manual.test.suite}" todir="${testresults.dir}" />
</junit>
</target>
<!-- Push a new jgralab jar to clojars.org -->
<target name="clojars-push">
<exec executable="scp">
<arg value="pom.xml" />
<arg value="build/jar/jgralab.jar" />
<arg value="[email protected]:" />
</exec>
</target>
</project>