-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
708 lines (611 loc) · 27.1 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
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
<project name="qmaxuse" default="build" basedir=".">
<description>Build file for USE</description>
<property environment="env"/>
<property name="release.version.base" value="4.0.0"/>
<condition property="release.version" value="${release.version.base}-${env.BUILD_NUMBER}" else="${release.version.base}">
<isset property="env.BUILD_NUMBER"/>
</condition>
<!-- set release name to "use-x.y.z" -->
<property name="release.name" value="${ant.project.name}-${release.version}"/>
<!-- define Java source and target version -->
<property name="java.targetversion" value="1.7" />
<property name="java.sourceversion" value="1.7" />
<property name="use.mainClass" value="org.tzi.use.main.Main" />
<!-- define top-level directories -->
<property name="bin.dir" location="${basedir}/bin"/>
<property name="etc.dir" location="${basedir}/etc"/>
<property name="examples.dir" location="${basedir}/examples"/>
<property name="images.dir" location="${basedir}/images"/>
<property name="lib.dir" location="${basedir}/lib"/>
<property name="src.dir" location="${basedir}/src"/>
<property name="uran.dir" location="${basedir}/src/uran"/>
<property name="src.main.dir" location="${src.dir}/main"/>
<property name="src.gui.dir" location="${src.dir}/gui"/>
<property name="src.runtime.dir" location="${src.dir}/runtime" />
<property name="src.test.dir" location="${src.dir}/test"/>
<property name="test.dir" location="${basedir}/test"/>
<property name="test.lang" value="en_US.UTF-8"/>
<!-- define build directories and files -->
<property name="build.dir" location="${basedir}/build"/>
<property name="build.classes.dir" location="${build.dir}/classes"/>
<property name="build.lib.dir" location="${basedir}/lib"/>
<property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
<property name="build.release.dir" location="${build.dir}/release/${release.name}"/>
<property name="build.doc.dir" location="${build.dir}/doc"/>
<property name="qmaxuse.jar" location="${build.lib.dir}/qmaxuse.jar"/>
<property name="use-gui.jar" location="${build.lib.dir}/use-gui.jar"/>
<property name="use-runtime.jar" location="${build.lib.dir}/use-runtime.jar" />
<property name="build.libbuild.dir" location="${basedir}/lib_build"/>
<property name="test.build.query.dir" location="${build.classes.dir}"/>
<!-- add Z3 jar files -->
<property name="com.microsoft.z3.jar" location="${lib.dir}/com.microsoft.z3.jar" />
<property name="antlr.jar" location="${lib.dir}/antlr-3.4-complete.jar"/>
<property name="junit.jar" location="${lib.dir}/junit.jar"/>
<property name="gsbase.jar" location="${lib.dir}/gsbase.jar"/>
<property name="jruby.jar" location="${lib.dir}/jruby-1.7.2.jar"/>
<property name="combinatoricslib.jar" location="${lib.dir}/combinatoricslib-0.2.jar"/>
<property name="vtd-xml.jar" location="${lib.dir}/vtd-xml.jar"/>
<property name="itextpdf.jar" location="${lib.dir}/itextpdf-5.5.2.jar"/>
<property name="guava.jar" location="${lib.dir}/guava-17.0.jar"/>
<property name="annotation.jar" location="${build.libbuild.dir}/org.eclipse.jdt.annotation_1.1.0.v20140129-1625.jar"/>
<property name="readline.src.dir" location="${src.main.dir}/org/tzi/use/util/input"/>
<property name="parser.dir" location="${src.main.dir}/org/tzi/use/parser"/>
<property name="query.dir" location="${src.main.dir}/org/tzi/use/query"/>
<path id="use.classpath.absolute">
<fileset dir="${lib.dir}" includes="*.jar" excludes="use*"/>
<pathelement path="${use-gui.jar}"/>
<pathelement path="${use-runtime.jar}"/>
</path>
<path id="classpath.test">
<pathelement location="${junit.jar}" />
</path>
<manifestclasspath property="use.classpath" jarfile="${qmaxuse.jar}">
<classpath refid="use.classpath.absolute"/>
</manifestclasspath>
<condition property="os.windows">
<os family="windows"/>
</condition>
<condition property="os.mac">
<os family="mac" />
</condition>
<!-- perform all major targets. Should be done before a checkin to
avoid broken snapshots. -->
<target name="all" description="perform clean, build, test-junit, javadoc" depends="clean, build, test-junit, javadoc" />
<!-- compile with jikes. Use like "ant with.jikes build" -->
<target name="with.jikes" description="compile using jikes">
<property name="build.compiler" value="jikes"/>
<property name="build.compiler.emacs" value="true"/>
<property name="build.compiler.pedantic" value="false"/>
<property name="build.compiler.warnings" value="false"/>
</target>
<!-- help -->
<target name="help" description="Shows how to get a list of available targets">
<echo>run "ant -projecthelp" for a list of available targets</echo>
</target>
<!-- output configuration information -->
<target name="config-info">
<echo>Operating System: ${os.name} ${os.version}</echo>
<echo>Java Runtime: ${java.runtime.name}</echo>
<echo>Java Home: ${java.home}</echo>
<echo>Java Version: ${java.vm.version}</echo>
<echo>Build Compiler: ${build.compiler}</echo>
<echo>Ant Version: ${ant.version}</echo>
</target>
<!-- initialization required before all targets -->
<target name="init">
<tstamp/>
</target>
<!-- check whether ANTLR generated parser is up-to-date -->
<target name="check-parser-uptodate" depends="init">
<condition property="parser.uptodate">
<and>
<!-- ocl parser grammar exists -->
<available file="${parser.dir}/ocl/OCL.g" />
<!-- ocl parser to ocl base -->
<uptodate srcfile="${parser.dir}/base/OCLBase.gpart"
targetfile="${parser.dir}/ocl/OCLParser.java"/>
<!-- ocl parser to ocl lexer rules -->
<uptodate srcfile="${parser.dir}/base/OCLLexerRules.gpart"
targetfile="${parser.dir}/ocl/OCLParser.java"/>
<!-- ocl parser to ocl -->
<uptodate srcfile="${parser.dir}/ocl/OCL.gpart"
targetfile="${parser.dir}/ocl/OCLParser.java"/>
<!-- use parser grammar exists -->
<available file="${parser.dir}/use/USE.g" />
<!-- use parser to required grammars -->
<uptodate srcfile="${parser.dir}/use/USE.gpart"
targetfile="${parser.dir}/use/USEParser.java"/>
<uptodate srcfile="${parser.dir}/base/USEBase.gpart"
targetfile="${parser.dir}/use/USEParser.java"/>
<!-- query grammar exists -->
<available file="${query.dir}/query/Query.g" />
<!-- query parser to required grammars -->
<uptodate srcfile="${query.dir}/Query.gpart"
targetfile="${query.dir}/QueryParser.java"/>
<!-- <uptodate srcfile="${parser.dir}/use/USELexerRules.gpart"
targetfile="${parser.dir}/use/USEParser.java"/> -->
<!-- shell grammar exists -->
<available file="${parser.dir}/shell/ShellCommand.g" />
<!-- shell language parser to required grammars -->
<uptodate srcfile="${parser.dir}/base/ShellCommandBase.gpart"
targetfile="${parser.dir}/shell/ShellCommandParser.java"/>
<uptodate srcfile="${parser.dir}/shell/ShellCommand.gpart"
targetfile="${parser.dir}/shell/ShellCommandParser.java"/>
<!-- generator parser grammar exists -->
<available file="${parser.dir}/generator/Generator.g" />
<!-- generator parser -->
<uptodate srcfile="${parser.dir}/generator/Generator.gpart"
targetfile="${parser.dir}/generator/GeneratorParser.java"/>
<!-- soil parser grammar exists -->
<available file="${parser.dir}/soil/Soil.g" />
<!-- soil parser -->
<uptodate srcfile="${parser.dir}/soil/Soil.gpart"
targetfile="${parser.dir}/soil/SoilParser.java"/>
<uptodate srcfile="${parser.dir}/base/SoilBase.gpart"
targetfile="${parser.dir}/soil/SoilParser.java"/>
<!-- testsuite parser grammar exists -->
<available file="${parser.dir}/testsuite/TestSuite.g" />
<!-- testsuite parser -->
<uptodate srcfile="${parser.dir}/testsuite/TestSuite.gpart"
targetfile="${parser.dir}/testsuite/TestSuiteParser.java"/>
</and>
</condition>
</target>
<!-- create ANTLR generated parser -->
<target name="create-parser" depends="check-parser-uptodate" unless="parser.uptodate">
<!-- ocl parser -->
<echo>Generating ocl parser</echo>
<concat destfile="${parser.dir}/ocl/OCL.g">
<fileset file="${parser.dir}/ocl/OCL.gpart" />
<fileset file="${parser.dir}/base/OCLBase.gpart" />
<fileset file="${parser.dir}/base/OCLLexerRules.gpart" />
</concat>
<java classname="org.antlr.Tool" dir="${parser.dir}/ocl" fork="yes">
<classpath path="${antlr.jar}"/>
<arg line="OCL.g"/>
</java>
<!-- soil parser -->
<echo>Generating soil parser</echo>
<concat destfile="${parser.dir}/soil/Soil.g">
<fileset file="${parser.dir}/soil/Soil.gpart" />
<fileset file="${parser.dir}/base/SoilBase.gpart" />
<fileset file="${parser.dir}/base/OCLBase.gpart" />
<fileset file="${parser.dir}/base/OCLLexerRules.gpart" />
</concat>
<java classname="org.antlr.Tool" dir="${parser.dir}/soil" fork="yes">
<classpath path="${antlr.jar}"/>
<arg line="Soil.g"/>
</java>
<!-- use parser -->
<echo>Generating use parser</echo>
<concat destfile="${parser.dir}/use/USE.g">
<fileset file="${parser.dir}/use/USE.gpart" />
<fileset file="${parser.dir}/base/USEBase.gpart" />
<fileset file="${query.dir}/QueryUSE.gpart" />
<fileset file="${parser.dir}/base/OCLBase.gpart" />
<fileset file="${parser.dir}/base/SoilBase.gpart" />
<!-- <fileset file="${parser.dir}/use/USELexerRules.gpart" /> -->
<fileset file="${parser.dir}/base/OCLLexerRules.gpart" />
</concat>
<java classname="org.antlr.Tool" dir="${parser.dir}/use" fork="yes">
<classpath path="${antlr.jar}"/>
<arg line="USE.g"/>
</java>
<!-- query parser -->
<echo>Generating query parser</echo>
<concat destfile="${query.dir}/Query.g">
<fileset file="${query.dir}/Query.gpart" />
<fileset file="${parser.dir}/base/OCLBase.gpart"/>
<fileset file="${query.dir}/QueryLexerRules.gpart" />
</concat>
<java classname="org.antlr.Tool" dir="${query.dir}" fork="yes">
<classpath path="${antlr.jar}"/>
<arg line="Query.g"/>
</java>
<!-- shell command parser -->
<echo>Generating shell command parser</echo>
<concat destfile="${parser.dir}/shell/ShellCommand.g">
<fileset file="${parser.dir}/shell/ShellCommand.gpart" />
<fileset file="${parser.dir}/base/ShellCommandBase.gpart" />
<fileset file="${parser.dir}/base/OCLBase.gpart" />
<fileset file="${parser.dir}/base/SoilBase.gpart" />
<fileset file="${parser.dir}/base/OCLLexerRules.gpart" />
</concat>
<java classname="org.antlr.Tool" dir="${parser.dir}/shell" fork="yes">
<classpath path="${antlr.jar}"/>
<arg line="-lib ../base ShellCommand.g"/>
</java>
<!-- generator parser -->
<echo>Generating generator parser</echo>
<concat destfile="${parser.dir}/generator/Generator.g">
<fileset file="${parser.dir}/generator/Generator.gpart" />
<fileset file="${parser.dir}/base/USEBase.gpart"/>
<fileset file="${query.dir}/QueryUSE.gpart"/>
<fileset file="${parser.dir}/base/OCLBase.gpart" />
<fileset file="${parser.dir}/base/SoilBase.gpart" />
<fileset file="${parser.dir}/base/OCLLexerRules.gpart" />
</concat>
<java classname="org.antlr.Tool" dir="${parser.dir}/generator" fork="yes">
<classpath path="${antlr.jar}"/>
<arg line="Generator.g"/>
</java>
<!-- test suite parser -->
<echo>Generating testsuite parser</echo>
<concat destfile="${parser.dir}/testsuite/TestSuite.g">
<fileset file="${parser.dir}/testsuite/TestSuite.gpart" />
<fileset file="${parser.dir}/base/OCLBase.gpart" />
<fileset file="${parser.dir}/base/ShellCommandBase.gpart" />
<fileset file="${parser.dir}/base/SoilBase.gpart" />
<fileset file="${parser.dir}/base/OCLLexerRules.gpart" />
</concat>
<java classname="org.antlr.Tool" dir="${parser.dir}/testsuite" fork="yes">
<classpath path="${antlr.jar}"/>
<arg line="-lib ../base TestSuite.g"/>
</java>
</target>
<!-- compile USE sources -->
<target name="compile-use" depends="compile-use-runtime" />
<target name="compile-use-main" depends="create-parser, setversion">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="${src.main.dir}:${src.runtime.dir}:${src.gui.dir}:${uran.dir}"
destdir="${build.classes.dir}" deprecation="on" debug="off" listfiles="off"
classpath="${antlr.jar}:${jruby.jar}:${combinatoricslib.jar}:${vtd-xml.jar}:${itextpdf.jar}:${guava.jar}:${annotation.jar}:${com.microsoft.z3.jar}"
source="${java.sourceversion}" target="${java.targetversion}" includeantruntime="false">
</javac>
<javac srcdir="${src.test.dir}"
destdir="${build.classes.dir}" deprecation="on" debug="on" listfiles="off"
classpath="${antlr.jar}:${junit.jar}:${gsbase.jar}:${combinatoricslib.jar}:${vtd-xml.jar}:${itextpdf.jar}"
source="${java.sourceversion}" target="${java.targetversion}" includeantruntime="false">
<exclude name="org/tzi/use/gui/**/*.java" />
</javac>
</target>
<target name="compile-use-gui" depends="compile-use-main">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="${src.gui.dir}:${src.runtime.dir}"
destdir="${build.classes.dir}" deprecation="on" debug="off" listfiles="off"
classpath="${antlr.jar}:${vtd-xml.jar}:${itextpdf.jar}:${annotation.jar}"
source="${java.sourceversion}" target="${java.targetversion}" includeantruntime="false">
</javac>
<javac srcdir="${src.test.dir}"
destdir="${build.classes.dir}" deprecation="on" debug="off" listfiles="off"
classpath="${antlr.jar}:${junit.jar}:${gsbase.jar}:${vtd-xml.jar}:${itextpdf.jar}"
source="${java.sourceversion}" target="${java.targetversion}" includeantruntime="false">
<include name="org/tzi/use/gui/**/*.java" />
</javac>
</target>
<target name="compile-use-runtime" depends="compile-use-gui">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="${src.runtime.dir}"
destdir="${build.classes.dir}" deprecation="on" debug="off" listfiles="off"
classpath="${antlr.jar}:${annotation.jar}"
source="${java.sourceversion}" target="${java.targetversion}" includeantruntime="false">
</javac>
</target>
<target name="setversion">
<replaceregexp file="${src.main.dir}/org/tzi/use/config/Options.java"
match='RELEASE_VERSION = ".*"' replace='RELEASE_VERSION = "${release.version}"'/>
</target>
<!-- create USE jar -->
<target name="jar-use" depends="compile-use">
<mkdir dir="${build.lib.dir}"/>
<jar jarfile="${qmaxuse.jar}" basedir="${build.classes.dir}">
<manifest>
<attribute name="Main-Class" value="${use.mainClass}"/>
<attribute name="Class-Path" value="${use.classpath}"/>
</manifest>
<exclude name="org/tzi/use/runtime/**" />
<exclude name="org/tzi/use/gui/**"/>
<exclude name="**/*Test.class"/>
</jar>
<jar jarfile="${use-gui.jar}" basedir="${build.classes.dir}">
<include name="org/tzi/use/gui/**"/>
<exclude name="**/*Test.class"/>
</jar>
<jar jarfile="${use-runtime.jar}" basedir="${build.classes.dir}">
<include name="org/tzi/use/runtime/**" />
<exclude name="**/*Test.class" />
</jar>
</target>
<!-- check whether the native readline wrapper lib must be build -->
<target name="check-nativelib-needcompile" depends="init">
<uptodate property="nativelib.uptodate" srcfile="${readline.src.dir}/natGNUReadline.c" targetfile="${build.lib.dir}/libnatGNUReadline.so" />
<condition property="nativelib.needcompile">
<and>
<!-- no readline on windows -->
<not>
<isset property="nativelib.uptodate" />
</not>
<not>
<or>
<isset property="os.windows" />
<isset property="os.mac" />
</or>
</not>
</and>
</condition>
</target>
<!-- create native readline wrapper -->
<target name="create-nativelib" depends="compile-use,check-nativelib-needcompile" if="nativelib.needcompile">
<echo>executing javah</echo>
<exec executable="javah" failonerror="true">
<arg value="-jni"/>
<arg value="-classpath"/>
<arg value="${build.classes.dir}"/>
<arg value="-d"/>
<arg value="${build.lib.dir}"/>
<arg value="org.tzi.use.util.input.GNUReadline"/>
</exec>
<echo>executing gcc: compiling native code</echo>
<exec executable="gcc" failonerror="true">
<arg value="-fPIC"/>
<arg value="-Wall"/>
<arg value="-g"/>
<arg value="-O2"/>
<arg value="-I"/>
<arg value="${build.lib.dir}"/>
<arg value="-I"/>
<arg value="${java.home}/../include"/>
<arg value="-I"/>
<arg value="${java.home}/../include/linux"/>
<arg value="-I"/>
<arg value="${java.home}/../include/solaris"/>
<arg value="-c"/>
<arg value="${readline.src.dir}/natGNUReadline.c"/>
<arg value="-o"/>
<arg value="${build.lib.dir}/natGNUReadline.o"/>
</exec>
<delete file="${build.lib.dir}/org_tzi_use_util_input_GNUReadline.h"/>
<echo>executing gcc: linking shared library</echo>
<exec executable="gcc" failonerror="true">
<arg value="${build.lib.dir}/natGNUReadline.o"/>
<arg value="-shared"/>
<arg value="-lreadline"/>
<arg value="-lcurses"/>
<arg value="-o"/>
<arg value="${build.lib.dir}/libnatGNUReadline.so"/>
</exec>
<delete file="${build.lib.dir}/natGNUReadline.o" quiet="true"/>
</target>
<!-- create all jars -->
<target name="build" depends="jar-use" description="build everything "/>
<!-- delete the build tree -->
<target name="clean" description="clean build directory" >
<delete dir="${build.dir}"/>
<!-- generated grammar files -->
<delete verbose="yes">
<fileset dir="${parser.dir}" includes="**/*.tokens">
<present targetdir="${parser.dir}">
<globmapper from="*.tokens" to="*.g" />
</present>
</fileset>
<fileset dir="${parser.dir}" includes="**/*Parser.java">
<present targetdir="${parser.dir}">
<globmapper from="*Parser.java" to="*.g" />
</present>
</fileset>
<fileset dir="${parser.dir}" includes="**/*Lexer.java">
<present targetdir="${parser.dir}">
<globmapper from="*Lexer.java" to="*.g" />
</present>
</fileset>
<fileset dir="${parser.dir}" includes="**/*.g"/>
</delete>
<!-- jar files -->
<delete file="${qmaxuse.jar}"/>
<delete file="${use-runtime.jar}"/>
<delete file="${use-gui.jar}"/>
</target>
<!-- delete files in the source tree that can be regenerated -->
<target name="maintainer-clean" depends="clean">
<exec executable="make" dir="${test.dir}" failonerror="true">
<arg value="maintainer-clean"/>
</exec>
<exec executable="make" dir="${test.dir}/state" failonerror="true">
<arg value="maintainer-clean"/>
</exec>
<exec executable="make" dir="${examples.dir}" failonerror="true">
<arg value="maintainer-clean"/>
</exec>
</target>
<!-- generate javadoc -->
<target name="javadoc" depends="javadoc_api, create-parser" description="generates javadoc documentation">
<mkdir dir="${build.javadoc.dir}/complete"/>
<javadoc packagenames="org.*" sourcepath="${src.main.dir}" classpath="${antlr.jar}:${junit.jar}:${combinatoricslib.jar}" destdir="${build.javadoc.dir}/complete" author="true" version="true" private="true" use="true" windowtitle="${ant.project.name} API" doctitle="${release.name}">
<tag name="ocl.pre" scope="constructors,methods" description="Precondition:" />
<bottom><![CDATA[<i>Copyright © 1999-2014 University of Bremen, Mark Richters. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<target name="javadoc_api" depends="create-parser" description="generates javadoc API documentation">
<mkdir dir="${build.javadoc.dir}/api"/>
<javadoc packagenames="org.tzi.use.api.*" sourcepath="${src.main.dir}" classpath="${antlr.jar}:${junit.jar}:${combinatoricslib.jar}" destdir="${build.javadoc.dir}/api" author="true" version="true" private="false" use="true" windowtitle="${ant.project.name} API" doctitle="${release.name}">
<tag name="ocl.pre" scope="constructors,methods" description="Precondition:" />
<bottom><![CDATA[<i>Copyright © 1999-2014 University of Bremen, Mark Richters. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!-- generate html code from the USE grammar -->
<target name="generate-grammar-html" depends="init" description="generates html code from the USE grammar">
<java classname="antlr.Tool" dir="${parser.dir}" fork="yes">
<classpath path="${antlr.jar}" />
<arg value="-html" />
<arg value="use.g" />
</java>
</target>
<!-- generate diagnostic files from the USE grammar -->
<target name="generate-grammar-diagnostic" depends="init" description="generates diagnostic files from the USE grammar">
<java classname="antlr.Tool" dir="${parser.dir}" fork="yes">
<classpath path="${antlr.jar}"/>
<arg value="-diagnostic"/>
<arg value="use.g"/>
</java>
</target>
<!-- run all tests -->
<target name="test" description="run all tests" depends="test-classcycles, test-junit" /> <!-- test-other -->
<!-- run unit tests -->
<target name="test-junit" description="run unit tests" depends="build">
<junit haltonfailure="yes">
<jvmarg value="-Dbasedir=${basedir}"/>
<jvmarg value="-Duser.language=${test.lang}"/>
<formatter type="brief" usefile="no"/>
<classpath path="${antlr.jar}:${build.classes.dir}:${gsbase.jar}:${jruby.jar}:${junit.jar}:${guava.jar}"/>
<batchtest fork="yes">
<fileset dir="${src.test.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- run unit tests with gui -->
<target name="test-junit-swing" description="runs unit tests with gui" depends="build">
<java classname="junit.swingui.TestRunner" fork="yes">
<jvmarg value="-Dbasedir=${basedir}"/>
<jvmarg value="-Duser.language=${test.lang}"/>
<classpath path="${antlr.jar}:${build.classes.dir}:${gsbase.jar}:${junit.jar}:${jruby.jar};${guava.jar}"/>
</java>
</target>
<!-- run other tests via make -->
<target name="test-other" description="run scripted tests" depends="build">
<exec executable="make" dir="${test.dir}" failonerror="true" >
<arg value="clean"/>
<arg value="test"/>
</exec>
<exec executable="make" dir="${test.dir}/state" failonerror="true">
<arg value="clean"/>
<arg value="test"/>
</exec>
<exec executable="make" dir="${examples.dir}" failonerror="true">
<arg value="clean"/>
<arg value="test"/>
</exec>
</target>
<!-- perform classcycle checks -->
<target name="check-classcycles-available">
<condition property="classcycleslib.available">
<available file="${build.libbuild.dir}/Classycle1.3.3/classycle.jar" />
</condition>
</target>
<target name="test-classcycles" depends="compile-use,check-classcycles-available" if="classcycleslib.available">
<property name="package" value="org.tzi.use"/>
<taskdef name="classycleDependencyCheck"
classname="classycle.ant.DependencyCheckingTask" classpath="lib_build/Classycle1.3.3/classycle.jar"/>
<classycleDependencyCheck failOnUnwantedDependencies="false"
excludingClasses="*Test,*Tests,*.All*Tests">
<fileset dir="${build.classes.dir}">
<include name="**/*.class"/>
</fileset>
show allResults
[gui] = ${package}.gui.*
[runtimeGui] = ${package}.runtime.gui.*
[runtime] = ${package}.runtime excluding [runtimeGui]
[noGui] = ${package}.* excluding [gui] [runtimeGui]
check [noGui] independentOf [gui]
check [runtime] independentOf [runtimeGui]
check [noGui] independentOf [runtimeGui]
</classycleDependencyCheck>
</target>
<!-- create release -->
<target name="release" description="create release distribution" depends="maintainer-clean, build">
<!-- clean up example and test directories -->
<exec executable="make" dir="${test.dir}" failonerror="true">
<arg value="clean"/>
</exec>
<exec executable="make" dir="${test.dir}/state" failonerror="true">
<arg value="clean"/>
</exec>
<exec executable="make" dir="${examples.dir}" failonerror="true">
<arg value="clean"/>
</exec>
<!-- copy top-level files -->
<mkdir dir="${build.release.dir}"/>
<copy todir="${build.release.dir}">
<fileset dir="${basedir}" includes=".classpath,.project,AUTHORS,build.xml,ChangeLog,COPYING,INSTALL,NEWS,README*"/>
</copy>
<!-- copy bin files -->
<mkdir dir="${build.release.dir}/bin"/>
<copy todir="${build.release.dir}/bin">
<fileset dir="${bin.dir}"/>
</copy>
<chmod file="${build.release.dir}/bin/use" perm="a+rx" />
<!-- copy etc files -->
<mkdir dir="${build.release.dir}/etc"/>
<copy todir="${build.release.dir}/etc">
<fileset dir="${etc.dir}"/>
</copy>
<!-- copy extension files -->
<mkdir dir="${build.release.dir}/oclextensions"/>
<copy todir="${build.release.dir}/oclextensions">
<fileset dir="${basedir}/oclextensions" />
</copy>
<!-- copy example files -->
<mkdir dir="${build.release.dir}/examples"/>
<copy todir="${build.release.dir}/examples">
<fileset dir="${examples.dir}" excludes="**/*.done" />
</copy>
<!-- copy image files -->
<mkdir dir="${build.release.dir}/images"/>
<copy todir="${build.release.dir}/images">
<fileset dir="${images.dir}" />
</copy>
<!-- copy lib files -->
<mkdir dir="${build.release.dir}/lib"/>
<copy todir="${build.release.dir}/lib">
<fileset dir="${build.lib.dir}"/>
</copy>
<!-- copy src files -->
<mkdir dir="${build.release.dir}/src"/>
<copy todir="${build.release.dir}/src">
<fileset dir="${src.dir}"/>
</copy>
<!-- copy test files -->
<mkdir dir="${build.release.dir}/test"/>
<copy todir="${build.release.dir}/test">
<fileset dir="${test.dir}" />
</copy>
<chmod file="${build.release.dir}/test/mkcmd.pl" perm="a+rx" />
<chmod file="${build.release.dir}/test/mkout.pl" perm="a+rx" />
<!-- create release tar file -->
<property name="release.tar" value="${build.release.dir}/../${release.name}.tar"/>
<delete file="${release.tar}"/>
<delete file="${release.tar}.gz"/>
<tar longfile="gnu" destfile="${release.tar}">
<tarfileset dir="${build.release.dir}/.." mode="755">
<include name="${release.name}/bin/use"/>
<include name="${release.name}/test/*.pl"/>
</tarfileset>
<tarfileset dir="${build.release.dir}/..">
<include name="${release.name}/**"/>
<exclude name="${release.name}/bin/use"/>
<exclude name="${release.name}/test/*.pl"/>
</tarfileset>
</tar>
<gzip src="${release.tar}" zipfile="${release.tar}.gz"/>
<!-- create release zip file -->
<property name="release.zip" value="${build.release.dir}/../${release.name}.zip"/>
<delete file="${release.zip}"/>
<zip destfile="${release.zip}">
<zipfileset dir="${build.release.dir}/.." filemode="755">
<include name="${release.name}/bin/use"/>
<include name="${release.name}/test/*.pl"/>
</zipfileset>
<zipfileset dir="${build.release.dir}/..">
<include name="${release.name}/**"/>
<exclude name="${release.name}/bin/use"/>
<exclude name="${release.name}/test/*.pl"/>
</zipfileset>
</zip>
<!-- cleanup -->
<delete file="${release.tar}"/>
<delete dir="${build.release.dir}"/>
</target>
<target name="run-query-test">
<echo>"Running query test cases..." </echo>
<junit haltonfailure="yes" printsummary="on" fork="true">
<formatter type="brief" usefile="no"/>
<classpath>
<path refid="classpath.test" />
<pathelement location="${test.build.query.dir}"/>
</classpath>
<test name="query.QueryTest" />
</junit>
<echo>"Leaving query test." </echo>
</target>
</project>