-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
executable file
·1545 lines (1393 loc) · 71.9 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
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<project name="Visage Compiler" default="binaries" basedir=".">
<description>Builds, tests, and runs the visage-compiler project.</description>
<property name="build.defs" location="build-defs.xml"/>
<condition property="build.defs.missing">
<not>
<available file="${build.defs}" type="file" property="ignored"/>
</not>
</condition>
<tstamp>
<format property="date.stamp" pattern="yyyy-MM-dd"/>
</tstamp>
<property name="top-repo" value="visage-compiler~soma-setup"/>
<property name="top-url" value="http://kenai.com/hg/${top-repo}"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="dist.dir" value="${basedir}/dist"/>
<!-- there must be a way to not duplicate this message -->
<fail if="build.defs.missing">
:
${build.defs} does not exist.
Your visage-compiler repo must be under the top level repository, ${top-repo}.
You should do this:
cd ..
hg clone ${top-url}
mv visage-compiler ${top-repo}
And then, you must create the ${top-repo}/import/ directory containing all the external
packages that are needed to build:
download file import.zip from
http://kenai.com/projects/visage-compiler/downloads
cp ...../import.zip .
cd ${top-repo}
ant import
You don't really have to download import.zip. If it does not exist, then the 'ant import' command
will use http to fetch all the needed packages. But, this is slow and prone to timeouts.
After doing the above, you can cd visage-compiler and do your build.
</fail>
<import file="${build.defs}"/>
<!--
If the visage.build.number is not set to a real value, then we are building outside hudson. Use
userName-date instead.
-->
<condition property="build.number.string" value="${user.name}-${date.stamp}" else="${visage.build.number}">
<matches string="${visage.build.number}" pattern="^0*$"/>
</condition>
<property name="visagedoc.dir" value="${basedir}/visagedoc"/>
<property name="launcher.dir" value="${basedir}/launcher"/>
<property environment="env" />
<condition property="exe" value=".exe" else="">
<isset property="isWindows"/>
</condition>
<import file="tools-defs.xml"/>
<property name="antlr.grammarv4p" value="v4Parser" />
<property name="antlr.grammarv4l" value="v4Lexer" />
<target name="jj">
<echo>
</echo>
</target>
<!-- Here are targets required by the upper level build.xml. -->
<target name="visage-clean" depends="clean"/>
<target name="visage-clean-sdk" depends="init,-do-visage-clean-sdk"/>
<target name="visage-clean-deploy" depends="init,-do-visage-clean-deploy"/>
<target name="visage-sdk" depends="init,-do-visage-sdk"/>
<target name="visage-test" depends="smoketest"/>
<target name="visage-full-test"/>
<target name="visage-samples"/>
<target name="visage-deploy" depends="init,-do-visage-deploy"/>
<target name="visage-sdk-docs" depends="init,-do-visage-sdk-docs"/>
<!-- Here are popular targets for building in this dir -->
<target name="help" depends="-do-help" description="Show help on targets"/>
<target name="binaries" depends="jar,visagedoc,launcher" description="Build compiler and compiler runtime binaries"/>
<!-- jjh: temporarily changed to dev-test until the tests on the exclude lists can be fixed
<target name="test" depends="binaries,-do-test" description="Build binaries and run tests"/>
-->
<target name="test" depends="dev-test" description="Build binaries and run tests"/>
<target name="smoketest" depends="-init-smoke-test,binaries,-do-test" description="Build binaries and run smoke tests"/>
<target name="docs" depends="binaries,source-zip,-do-docs" description="Build binaries, docs, and src.zip"/>
<target name="all" depends="docs,test,pack-jars" description="Build and test all project artifacts"/>
<target name="bundle" depends="docs,pack-jars,-do-bundle" description="Build distribution bundle"/>
<target name="clean" depends="-do-clean" description="Remove build products"/>
<!-- This can be called by the user, but it would be a NOP -->
<target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-presetdef-jar">
<!-- If we are building from hudson, we need to use the formatters in the junit tasks. -->
<condition property="use-formatters" value="true" else="false">
<isset property="hudson-build"/>
</condition>
</target>
<!-- Deprecated targets -->
<target name="default" depends="binaries" description="Deprecated; use 'binaries' instead"/>
<target name="dist" depends="bundle" description="Deprecated; use 'bundle' instead"/>
<target name="-do-help">
<echo>
Main developer targets:
name="dev-..." description="temp targets to assist in move to compiled bind"
dev-test: run tests that are not on the exclude list (ie, don't hang, and don't contain 'lazy')
dev-no-hang: run tests that are not on the hang list
dev-pass: run tests that are expected to pass.
dev-fail: run tests that are currently failing - see lists in project.properties
dev-check: find unexpected passes and unexpected failures in a previous dev-* test run. EG
ant dev-test dev-check
dev-xxx: run tests named in file -Dxxx=filename; default filename is ./xxx.
name="help"
name="jar" description="Build compiler .jar files"
name="binaries" depends="jar,visagedoc,launcher" description="Build compiler and compiler runtime binaries"
name="test" depends="binaries,-do-test" description="Build binaries and run all tests"
To run a single framework/xxxTest.java, do
ant test -Dincludes=framework/xxxTest.java
or for example
ant test -Dincludes=launchers/VersionTest.java
To run a subset, say visageunit/ of the VisageCompilerTest tests, do
ant test -Dtest.visage.roots=test/visageunit -Dincludes=framework/VisageCompilerTest.java
name="docs" depends="binaries,source-zip,-do-docs" description="Build binaries, docs, and src.zip"
name="all" depends="docs,test,pack-jars" description="Build and test all project artifacts"
name="bundle" depends="docs,pack-jars,-do-bundle" description="Build distribution bundle"
name="clean" depends="-do-clean" description="Remove build products"
name="all-with-coverage" depends="-init-coverage, all, findbugs, plot-data, coverage-report"
description="Build and test all project artifacts with coverage"
name="smoketest" description="Run tests that interface to SDK code"
name="test-single" depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,
-do-test-run-single,-post-test-run-single"
description="Run single unit test."
E.G. ant test-single -Dtest.visage.includes='**/vsgc2347.visage'
or ant test-single -Dtest.visage.includes=vsgc2347.visage
Your visage-compiler repo must be under the top level repository, ${top-repo}.
You should do this:
cd ..
hg clone ${top-url}
mv visage-compiler ${top-repo}
And then, you must create the ${top-repo}/import/ directory containing all the external
packages that are needed to build:
download file import.zip from
http://kenai.com/projects/visage-compiler/downloads
cp ...../import.zip .
cd ${top-repo}
ant import
You don't really have to download import.zip. If it does not exist, then the 'ant import' command
will use http to fetch all the needed packages. But, this is slow and prone to timeouts.
After doing the above, you can cd visage-compiler and do your build.
</echo>
</target>
<target name="-do-test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse"/>
<!--
We don't build docs as part of the visage-sdk target; the api docs that go into the SDK
are built by a process outside this repo.
-->
<target name="-do-visage-sdk" depends="binaries,source-zip">
<copy todir="${visage.sdk.dir}">
<fileset dir="${dist.dir}" includes="${dist.contents}"/>
</copy>
<chmod dir="${visage.sdk.dir}" perm="a+x" type="both" includes="${dist.executables}"/>
</target>
<target name="-do-visage-clean-sdk">
<delete includeemptydirs="true">
<fileset dir="${visage.sdk.dir}" includes="${dist.contents}"/>
</delete>
</target>
<target name="-do-visage-deploy" depends="binaries">
<copy todir="${visage.deployed.dir}">
<fileset dir="${dist.dir}/lib" includes="${deployed.contents}"/>
</copy>
</target>
<target name="-do-visage-sdk-docs" depends="docs">
<copy todir="${visage.sdk.api.docs.dir}">
<fileset dir="${basedir}/javadoc-files">
<include name="draft.*"/>
<include name="*.css"/>
<include name="*.js"/>
<include name="*.png"/>
</fileset>
</copy>
<mkdir dir="${visage.xml.docs.dir}"/>
<copy file="${build.dir}/docs/javacode.xml"
tofile="${visage.xml.docs.dir}/visage-compiler_javacode.xml"/>
<copy file="build/docs/visagecode.xml"
tofile="${visage.xml.docs.dir}/visage-compiler_visagecode.xml"/>
</target>
<target name="-do-visage-clean-deploy">
<delete includeemptydirs="true">
<fileset dir="${visage.deployed.dir}" includes="${deployed.contents}"/>
</delete>
</target>
<target name="-bundle-init">
<mkdir dir="${bundle.dir}"/>
</target>
<target name="-bundle-zip">
<zip basedir="dist" compress="true" destfile="${zip.bundle}" includes="${bundle.includes}"/>
</target>
<target name="-bundle-tgz">
<tar basedir="dist" longfile="fail" compression="gzip" destfile="${tgz.bundle}" includes="${bundle.includes}"/>
</target>
<target name="-do-bundle" depends="-bundle-init,-bundle-zip,-bundle-tgz"/>
<target name="hudson-dev" depends="-hudson-init, all, findbugs, plot-data, coverage-report, hudson-post-build"
description="Build and test all project artifacts for each developer push"/>
<target name="hudson-all" depends="-hudson-init, -init-coverage, all, findbugs, plot-data, coverage-report, hudson-post-build"
description="Build and test with coverage all project artifacts for nightly build"/>
<target name="all-with-coverage" depends="-init-coverage, all, findbugs, plot-data, coverage-report"
description="Build and test all project artifacts with coverage"/>
<target name="-hudson-init">
<!-- This must be done before init on a build done by hudson in order to tell the junit task to use
the output formatters. Hudson needs this to graph errors, but we don't want to use them from non
Hudson builds because they causes two copies of the result to be written to stdout.
-->
<property name="hudson-build" value="true"/>
</target>
<target name="compiler-only" depends="jar"
description="Build just the visagec compiler (no bin scripts, visagedoc, etc)"/>
<available property="ant.jar" value="${import.ant.jar}" file="${import.ant.jar}"/>
<!-- if the previous location is not correct than find the ant.jar from the java.class.path value -->
<pathconvert property="ant.jar">
<mapper type="regexp" from="${path.separator}([^${path.separator}]*ant.jar)${path.separator}" to="\1"/>
<path location="${path.separator}${java.class.path}${path.separator}"/>
</pathconvert>
<target name="check-ant">
<fail message="Ant version 1.7.0 or later is required to build Visage.">
<condition>
<not>
<antversion atleast="1.7.0"/>
</not>
</condition>
</fail>
</target>
<target name="check-jdk-1.5">
<available property="has-jdk-1.5" classname="java.lang.Appendable"/>
</target>
<target name="tool-paths">
<!-- Define actual properties for the known paths so they can be used in the properties file -->
<property name="ant.class.path" refid="ant.class.path"/>
<property name="junit.class.path" refid="junit.class.path"/>
<property name="findbugs.class.path" refid="findbugs.class.path"/>
<property name="saxon.class.path" refid="saxon.class.path"/>
<property name="xincluder.class.path" refid="xincluder.class.path"/>
<property name="antlr.class.path" refid="antlr.class.path"/>
<property name="antlr-runtime.class.path" refid="antlr-runtime.class.path"/>
<property name="antlrworks.class.path" refid="antlrworks.class.path"/>
<property name="cobertura.class.path" refid="cobertura.class.path"/>
</target>
<target name="single-visage-test-check" if="test.visage.includes">
<property name="test.class" value="framework.VisageCompilerTest"/>
<property name="test.includes" value="**/VisageCompilerTest.java"/>
<property name="javac.includes" value="**/VisageCompilerTest.java"/>
<property name="test-sys-prop.test.visage.includes" value="${test.visage.includes}"/>
</target>
<target name="-pre-init" depends="check-ant,check-jdk-1.5,tool-paths,single-visage-test-check">
<fail unless="has-jdk-1.5">You need JDK 1.5 or higher to build Visage.</fail>
<echo message="JDK version ${java.version}"/>
<echo message="Ant version ${ant.version}"/>
</target>
<target name="-post-init">
<property name="antlr.grammarv4l.file" value="${antlr.src.dir}/${antlr.grammarv4l}.g" />
<property name="antlr.grammarv4p.file" value="${antlr.src.dir}/${antlr.grammarv4p}.g" />
</target>
<!-- jar file creation: external runtime jar contents are included to reduce classpath issues -->
<target depends="init,compile,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
<jar compress="${jar.compress}" destfile="${dist.jar}" manifest="${manifest.file}">
<fileset dir="${build.classes.dir}"/>
<zipfileset src="${file.reference.javac.jar}" excludes="META-INF/**/,javax/annotation/**/,com/sun/tools/javac/processing"/>
<zipfileset src="${antlr-runtime.class.path}" excludes="META-INF/**/,org/antlr/runtime/debug/**/,org/antlr/runtime/misc/**/"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<!-- make CLASS.LIST file using "jar tf" command -->
<exec executable="jar" failonerror="true"
output="${build.classes.dir}/META-INF/CLASS.LIST">
<arg value="tf"/>
<arg value="${dist.jar}"/>
</exec>
<taskdef name="bytecode-verify" classname="org.visage.tools.bytecodeverifier.VerifierTask">
<classpath>
<pathelement location="${ant.jar}"/>
<pathelement location="${build.buildtools.dir}/"/>
<path refid="asm.class.path"/>
</classpath>
</taskdef>
<bytecode-verify path="${dist.jar}" verbose="false"/>
<!--
<jar compress="${jar.compress}" destfile="${dist.jar}" manifest="${manifest.file}">
<fileset dir="${build.classes.dir}"/>
<zipfileset src="${file.reference.javac.jar}" excludes="META-INF/**/,javax/annotation/**/,com/sun/tools/javac/processing"/>
<zipfileset src="${antlr-runtime.class.path}" excludes="META-INF/**/,org/antlr/runtime/debug/**/,org/antlr/runtime/misc/**/"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
-->
<jar compress="${jar.compress}" destfile="${dist.visagert.jar}" >
<fileset dir="${build.classes.dir}" >
<include name="**/*.class" />
<include name="org/visage/runtime/resources/version.properties"/>
<exclude name="org/visage/tools/**"/>
<exclude name="org/visage/api/**"/>
<exclude name="org/visage/runtime/main/**"/>
</fileset>
</jar>
<zip compress="${jar.compress}" destfile="${dist.visagert-main.jar}" >
<zipfileset dir="${build.classes.dir}" >
<include name="org/visage/runtime/main/Main.class"/>
</zipfileset>
</zip>
<!-- make CLASS.LIST file using "jar tf" command -->
<exec executable="jar" failonerror="true"
output="${build.classes.dir}/META-INF/CLASS.LIST">
<arg value="tf"/>
<arg value="${dist.visagert.jar}"/>
</exec>
<!--
<jar compress="${jar.compress}" destfile="${dist.visagert.jar}" >
<fileset dir="${build.classes.dir}">
<include name="**/*.class" />
<include name="org/visage/runtime/resources/version.properties"/>
<include name="**/CLASS.LIST" />
<exclude name="org/visage/tools/**"/>
<exclude name="org/visage/api/**"/>
</fileset>
</jar>
-->
</target>
<target depends="-pre-compile" name="generate-lexerv4" unless="lexerv4.uptodate" >
<java classname="org.antlr.Tool" classpathref="antlr.class.path" fork="true">
<arg value="-Xconversiontimeout" />
<arg value="10000" />
<arg value="-verbose"/>
<arg value="-o" />
<arg value="${antlr.generated.dir}" />
<arg value="${antlr.grammarv4l.file}" />
<jvmarg value="-Xmx${visage.antlr.max.memory}"/>
</java>
<java classname="org.antlr.Tool" classpathref="antlr.class.path" fork="true">
<arg value="-Xconversiontimeout" />
<arg value="10000" />
<arg value="-verbose"/>
<arg value="-o" />
<arg value="${antlr.generated.dir}" />
<arg value="${antlr.grammarv4p.file}" />
<jvmarg value="-Xmx${visage.antlr.max.memory}"/>
</java>
<property name="parserv4.uptodate" value="true" />
</target>
<target depends="-pre-compile, generate-lexerv4" name="generate-parserv4" unless="parserv4.uptodate">
<java classname="org.antlr.Tool" classpathref="antlr.class.path" fork="true">
<arg value="-Xconversiontimeout" />
<arg value="10000" />
<arg value="-verbose"/>
<arg value="-o" />
<arg value="${antlr.generated.dir}" />
<arg value="${antlr.grammarv4l.file}" />
<jvmarg value="-Xmx${visage.antlr.max.memory}"/>
</java>
<java classname="org.antlr.Tool" classpathref="antlr.class.path" fork="true">
<arg value="-Xconversiontimeout" />
<arg value="10000" />
<arg value="-verbose"/>
<arg value="-o" />
<arg value="${antlr.generated.dir}" />
<arg value="${antlr.grammarv4p.file}" />
<jvmarg value="-Xmx${visage.antlr.max.memory}"/>
</java>
</target>
<target name="syntax-diagrams" depends="init, generate-parserv4">
<mkdir dir="${syntax.diagrams.dir}"/>
<mkdir dir="${antlr.src.dir}/output"/>
<copy todir="${antlr.src.dir}/output">
<fileset dir="${antlr.generated.dir}" includes="**/*.tokens"/>
</copy>
<java classname="org.antlr.works.Console" fork="true">
<classpath>
<path refid="antlrworks.class.path" />
<path refid="antlr.class.path" />
</classpath>
<arg value="-f" />
<arg value="${antlr.grammarv4p.file}" />
<arg value="-sd" />
<arg value="png" />
<arg value="-o" />
<arg value="${syntax.diagrams.dir}" />
<arg value="-verbose"/>
<jvmarg value="-Xmx${visage.antlr.max.memory}"/>
</java>
<delete dir="${antlr.src.dir}/output"></delete>
</target>
<target name="generate-templates" depends="-pre-compile">
<java classname="org.visage.tools.stringtemplate.ExpandXxxTemplate">
<arg value="${build.generated.dir}" />
<arg value="org/visage/runtime/XxxTemplate.stg" />
<arg value="org/visage/runtime/sequence" />
<arg line="AbstractSequence Sequences XxxArraySequence" />
<classpath>
<pathelement location="${build.buildtools.dir}"/>
<path refid="antlr.class.path" />
<pathelement location="${src.classes.dir}" />
</classpath>
</java>
</target>
<target name="-do-compile" depends="init,generated-java,-pre-compile" if="have.sources">
<pcompile srcdir="${src.classes.dir}/org/visage"
destdir="${build.generated.dir}/org/visage"
includes="${includes}"/>
<!-- visage platform version -->
<touch file="${visage.version.file}" mkdirs="yes"/>
<echo file="${visage.version.file}">release=${visage.release}${line.separator}full=${visage.full.version}
</echo>
<!-- visagec tool version file -->
<touch file="${visagec.version.file}" mkdirs="yes"/>
<echo file="${visagec.version.file}">release=${visagec.release}${line.separator}full=${visagec.full.version}
</echo>
<!-- visagedoc tool version file -->
<touch file="${visagedoc.version.file}" mkdirs="yes"/>
<echo file="${visagedoc.version.file}">release=${visagedoc.release}${line.separator}full=${visagedoc.full.version}
</echo>
<pcompile srcdir="${build.generated.dir}"
destdir="${build.generated.dir}"
includes="**/*.properties"/>
<javac compiler="modern" fork="true"
destdir="${build.classes.dir}" includes="${includes}" excludes="${excludes}"
debug="${javac.debug}" deprecation="${javac.deprecation}"
source="${javac.source}" target="${javac.target}" includeantruntime="false">
<src path="${src.classes.dir}"/>
<src path="${build.generated.dir}"/>
<classpath>
<path path="${javac.classpath}"/>
</classpath>
<compilerarg line="${javac.compilerargs} -Xmaxerrs 10000"/>
</javac>
<copy todir="${build.classes.dir}">
<fileset dir="${src.classes.dir}" excludes="${build.classes.excludes}"/>
</copy>
</target>
<target name="generated-java" depends="generate-lexerv4,generate-parserv4,generate-templates" />
<target depends="init,-def-pcompile" name="-pre-compile">
<mkdir dir="${build.classes.dir}"/>
<uptodate property="lexerv4.uptodate" srcfile="${antlr.grammarv4l.file}" targetfile="${antlr.generated.dir}/${antlr.grammarv4l}.java" />
<uptodate property="parserv4.uptodate" srcfile="${antlr.grammarv4p.file}" targetfile="${antlr.generated.dir}/${antlr.grammarv4p}.java" />
</target>
<target name="-post-compile">
<!-- compiles the visage files in the compiler workspace. These are the runtime
files shipped with the compiler (not related to the Visage Runtime
project). -->
<taskdef name="visagec" classname="org.visage.tools.ant.VisageAntTask">
<classpath>
<pathelement location="${ant.jar}"/>
<pathelement location="${build.classes.dir}"/>
<pathelement path="${javac.classpath}"/>
</classpath>
</taskdef>
<visagec debug="${javac.debug}" deprecation="${javac.deprecation}"
destdir="${build.classes.dir}"
excludes="${excludes}" includeantruntime="false"
includes="**/*.visage" source="${javac.source}" sourcepath=""
srcdir="${src.classes.dir}" target="${javac.target}"
classpath="${build.classes.dir}:${javac.test.classpath}"
compilerclasspath="${build.classes.dir}:${javac.classpath}">
</visagec>
<taskdef name="bytecode-verify" classname="org.visage.tools.bytecodeverifier.VerifierTask">
<classpath>
<pathelement location="${ant.jar}"/>
<pathelement location="${build.buildtools.dir}/"/>
<path refid="asm.class.path"/>
</classpath>
</taskdef>
<bytecode-verify path="${build.classes.dir}" verbose="false"/>
</target>
<target depends="init,visagedoc" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
<path id="bootpath" path="${javac.classpath}"/>
<property name="bootjars" refid="bootpath"/>
<path id="clspath" path="build/classes"/>
<property name="clsjars" refid="clspath"/>
<path id="srcpath" path="src/share/classes"/>
<property name="srcpathprop" refid="srcpath"/>
<copy todir="${dist.visagedoc.dir}">
<fileset dir="${basedir}/javadoc-files">
<include name="draft.*"/>
<include name="*.css"/>
<include name="*.js"/>
<include name="*.png"/>
</fileset>
</copy>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" destdir="${dist.javadoc.dir}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"
packagenames="${javadoc.pkgs}" sourcepath="${src.classes.dir}">
<classpath>
<path path="${javac.classpath}"/>
</classpath>
</javadoc>
<!--
switch to alternate launching method so we can add gui jars to classpath
<java jar="dist/lib/visagedoc.jar" fork="true" failonerror="true">
-->
<mkdir dir="${build.dir}/doc"/>
<javadoc destdir="${dist.javadoc.dir}" failonerror="true" version="${javadoc.version}" private="${javadoc.private}" source="${javac.source}"
packagenames="visage.animation,visage.lang,visage.reflect,visage.util"
sourcepath="${src.classes.dir}">
<doclet name="org.visage.tools.xmldoclet.XMLDoclet"
path="${dist.visagedoc.jar}">
<param name="-o" value="${build.dir}/docs/javacode.xml"/>
<param name="-nohtml"/>
</doclet>
</javadoc>
<!-- generate visage class docs -->
<echo message="generating visage docs for ${visagedoc.packages}"/>
<java fork="true" failonerror="true" classname="org.visage.tools.visagedoc.Main">
<classpath location="${dist.visagedoc.jar}"/>
<classpath>
<path path="${build.classes.dir}:${javac.test.classpath}"/>
</classpath>
<jvmarg value="-Xbootclasspath/p:${bootjars}"/>
<jvmarg value="-Djava.awt.headless=true"/>
<jvmarg value="-Xmx${visage.javadoc.max.memory}"/>
<arg value="-o"/> <arg value="build/docs/visagecode.xml"/>
<arg value="-nohtml"/>
<arg value="-sourcepath"/> <arg value="${srcpathprop}"/>
<arg value="-classpath"/> <arg value="${clsjars}"/>
<arg line="${visagedoc.packages}"/>
</java>
<java fork="true" failonerror="true" classname="org.visage.tools.visagedoc.Main">
<classpath location="${dist.visagedoc.jar}"/>
<classpath refid="clspath"/>
<arg value="-d"/>
<arg value="${dist.visagedoc.dir}"/>
<arg value="-sourcepath"/>
<arg value="${srcpathprop}"/>
<arg value="-classpath"/>
<arg value="${clsjars}"/>
<arg line="-i ${build.dir}/docs/javacode.xml"/>
<classpath>
<path path="${build.classes.dir}:${javac.test.classpath}"/>
</classpath>
<jvmarg value="-Xbootclasspath/p:${bootjars}"/>
<jvmarg value="-Djava.awt.headless=true"/>
<jvmarg value="-Xmx${visage.javadoc.max.memory}"/>
<arg line="${visagedoc.packages}"/>
</java>
</target>
<target name="-def-pcompile">
<mkdir dir="${build.buildtools.dir}"/>
<javac srcdir="${src.buildtools.dir}" destdir="${build.buildtools.dir}" classpath="${import.ant.jar}">
<classpath>
<path refid="ant.class.path" />
<path refid="asm.class.path" />
<path refid="antlr.class.path" />
</classpath>
</javac>
<taskdef name="pcompile"
classname="org.visage.tools.compileproperties.CompilePropertiesTask"
classpath="${build.buildtools.dir}/"/>
</target>
<target name="-do-docs" depends="javadoc,langref">
<copy todir="dist/doc">
<fileset dir="doc" includes="**/*.pdf"/>
</copy>
<copy file="doc/doc-index.html" tofile="dist/doc/index.html"/>
<copy todir="dist/doc/images">
<fileset dir="doc/images"/>
</copy>
</target>
<!-- Stuff dealing with adding coverage to JUnit execution -->
<target name="-init-coverage">
<property name="do.coverage" value="true"/>
</target>
<target name="cobertura-taskdefs">
<taskdef classpathref="cobertura.class.path" resource="tasks.properties"/>
</target>
<target name="conditional-instrument" if="do.coverage" depends="cobertura-taskdefs">
<mkdir dir="${build.instrumented.dir}"/>
<cobertura-instrument todir="${build.instrumented.dir}">
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
<classpath refid="cobertura.class.path"/>
</cobertura-instrument>
</target>
<target name="conditional-clean-instrument" unless="do.coverage">
<delete dir="${build.instrumented.dir}"/>
</target>
<target name="conditional-coverage-report" if="do.coverage" depends="cobertura-taskdefs">
<mkdir dir="${dist.coverage.dir}"/>
<cobertura-report srcdir="${src.classes.dir}" destdir="${dist.coverage.dir}">
<classpath>
<path location="${build.classes.dir}"/>
</classpath>
</cobertura-report>
<cobertura-report format="xml" srcdir="${src.classes.dir}" destdir="${build.dir}"/>
</target>
<target depends="init,conditional-instrument,conditional-clean-instrument" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}"/>
<mkdir dir="${build.test.tmp.dir}"/>
</target>
<target if="have.tests" name="-post-test-run">
<fail if="build.tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="check-test-results">
<!-- Ignore junit errors on Hudson, so it reports an UNSTABLE build instead of a FAILURE -->
<condition property="build.tests.failed">
<and>
<isset property="tests.failed" description="JUnit task failed"/>
<not>
<isset property="export.dir" description="Hudson build"/>
</not>
</and>
</condition>
</target>
<target depends="conditional-coverage-report" name="coverage-report" />
<!-- End stuff dealing with adding coverage to JUnit execution -->
<target name="langref" description="Build Visage Language Reference.">
<ant antfile="doc/build.xml" target="ref" inheritAll="true"/>
<copy todir="dist/doc/reference">
<fileset dir="build/doc/html"/>
</copy>
<copy todir="dist/doc/reference/images/callouts">
<fileset dir="doc/callouts"/>
</copy>
<!-- create an index.html redirector to VisageReference.html-->
<echo file="dist/doc/reference/index.html" append="false">
<HTML><HEAD>
<META HTTP-EQUIV="REFRESH" content="0; url=VisageReference.html">
</HEAD></HTML>
</echo>
</target>
<target name="findbugs" depends="compile">
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpathref="findbugs.class.path" />
<mkdir dir="${dist.findbugs.dir}"/>
<findbugs output="xml" outputFile="${build.dir}/findbugs.xml" home="${import.findbugs.home}" jvmargs="-Xmx512m"
projectName="Visage compiler ${full.version}" excludeFilter="findbugs-exclude.xml">
<class location="${build.classes.dir}"/>
<auxclasspath path="${javac.classpath}:${import.junit.jar}"/>
<sourcepath path="${src.classes.dir}"/>
</findbugs>
<exec executable="sh" failonerror="true">
<arg value="${import.findbugs.home}/bin/convertXmlToText"/>
<arg value="-longBugCodes"/>
<arg value="-html:${import.findbugs.home}/src/xsl/fancy.xsl"/>
<arg value="${build.dir}/findbugs.xml"/>
<redirector output="${dist.findbugs.dir}/findbugs.html"/>
</exec>
</target>
<!-- we want to compile the benchmarks up front but run it
later during the nightly build.
-->
<target name="performance-compile">
<ant antfile="build.xml" dir="performance" target="compile" inheritall="false"/>
</target>
<target name="performance-clean">
<ant antfile="build.xml" dir="performance" target="clean" inheritall="false"/>
</target>
<target name="performance-run" depends="binaries">
<ant antfile="build.xml" dir="performance" target="run" inheritall="false"/>
</target>
<target name="staticsizes-clean">
<delete dir="${build.staticsizes.dir}" />
</target>
<target name="plot-data" depends="staticsizes, ldclassreport, performance-compile"/>
<target name="staticsizes" depends="jar, staticsizes-clean">
<mkdir dir="${build.staticsizes.dir}"/>
<java classname="org.visage.tools.jaranalyzer.JarAnalyzer">
<arg value="${dist.visagert.jar}" />
<arg value="${build.staticsizes.dir}" />
<arg value="http://visage.org/hudson/job/visage-compiler/${visage.build.number}/artifact/build/staticsizes" />
<classpath>
<pathelement location="${build.buildtools.dir}"/>
</classpath>
</java>
</target>
<target name="ldclassreport-clean">
<delete dir="${build.ldclassreport.dir}" />
</target>
<target name="ldclassreport" depends="binaries, ldclassreport-clean">
<mkdir dir="${build.ldclassreport.dir}" />
<java classname="org.visage.tools.classreporter.ClassReporter">
<arg value="-dist.dir=${dist.dir}" />
<arg value="-build.dir=${build.ldclassreport.dir}" />
<arg value="-reference.url=http://visage.org/hudson/job/visage-compiler/${visage.build.number}/changes" />
<classpath>
<pathelement location="${build.buildtools.dir}" />
</classpath>
</java>
</target>
<!-- Runs only if export.dir is set, which should only be set from the continuous build.
Publishes build results to ${export.dir}.
Depends on environment params JOB_NAME.
Publishes result of findbugs analysis, where it can later be combined into
a multi-version bug database. -->
<target name="hudson-post-build" depends="init, bundle" if="export.dir">
<property environment="env"/>
<mkdir dir="${export.dir}/ROOT/findbugs"/>
<exec executable="sh" failonerror="true">
<arg value="${import.findbugs.home}/bin/setBugDatabaseInfo"/>
<arg value="-name"/>
<arg value="${env.JOB_NAME}"/>
<arg value="${build.dir}/findbugs.xml"/>
<redirector output="${export.dir}/ROOT/findbugs/${env.JOB_NAME}.xml"/>
</exec>
<delete dir="${export.dir}/ROOT/current-build" />
<copy todir="${export.dir}/ROOT/current-build">
<fileset dir="${dist.dir}" excludes="**/doc/api/**"/>
</copy>
<!-- create an index.html redirector to the real API location -->
<mkdir dir="${export.dir}/ROOT/current-build/doc/api"/>
<echo file="${export.dir}/ROOT/current-build/doc/api/index.html" append="false">
<HTML><HEAD>
<META HTTP-EQUIV="REFRESH" content="0; url=${visage.api.url}">
</HEAD></HTML>
</echo>
<copy todir="${export.dir}/ROOT/current-build/doc">
<fileset dir="doc" includes="**/*.pdf"/>
</copy>
<copy file="${zip.bundle}" todir="${export.dir}/ROOT/current-build"/>
</target>
<condition property="preJDK6">
<or>
<equals arg1="${ant.java.version}" arg2="1.0"/>
<equals arg1="${ant.java.version}" arg2="1.1"/>
<equals arg1="${ant.java.version}" arg2="1.2"/>
<equals arg1="${ant.java.version}" arg2="1.3"/>
<equals arg1="${ant.java.version}" arg2="1.4"/>
<equals arg1="${ant.java.version}" arg2="1.5"/>
</or>
</condition>
<condition property="preJDK7">
<or>
<equals arg1="${ant.java.version}" arg2="1.0"/>
<equals arg1="${ant.java.version}" arg2="1.1"/>
<equals arg1="${ant.java.version}" arg2="1.2"/>
<equals arg1="${ant.java.version}" arg2="1.3"/>
<equals arg1="${ant.java.version}" arg2="1.4"/>
<equals arg1="${ant.java.version}" arg2="1.5"/>
<equals arg1="${ant.java.version}" arg2="1.6"/>
</or>
</condition>
<target name="visagedoc" depends="jar" if="preJDK7" >
<echoproperties/>
<!-- javadoc.jar depends on doclets.jar but we don't have it. Create a temporary file here: -->
<jar jarfile="lib/doclets.jar"/>
<ant dir="${visagedoc.dir}" antfile="build.xml" target="jar" inheritall="false">
<property name="visage.version" value="${visage.version}"/>
</ant>
<delete file="lib/doclets.jar"/>
</target>
<target name="visagejdi" description="Build visagejdi.jar" depends="-visagejdi-build, -visagejdi-skip">
</target>
<target name="-visagejdi-skip" description="Skip building visagejdi.jar on JDK LT 6" if="preJDK6">
<echo message="Skipping build of visagejdi because JDK 5 or earlier is in use"/>
</target>
<target name="-visagejdi-build" description="Build visagejdi.jar and javadoc on JDK >= 6" unless="preJDK6">
<echo message="Building visagejdi"/>
<ant dir="visagejdi" antfile="build.xml" target="dist" inheritAll="false">
<property name="build.defs" value="${build.defs}" />
</ant>
<copy file="visagejdi/dist/visagejdi.jar" tofile="${dist.visagejdi.jar}"/>
<copy todir="${basedir}/dist/doc/visagejdi/api">
<fileset dir="visagejdi/dist/javadoc/"/>
</copy>
</target>
<target name="launcher" description="Copy command wrappers to dist/bin directory.">
<ant dir="${launcher.dir}" antfile="build.xml" target="all" inheritall="true">
<property name="compiler.dist.dir" location="${basedir}/dist/bin" />
</ant>
<copy todir="dist/bin">
<fileset dir="src/bin"/>
</copy>
<chmod dir="dist/bin" perm="755" includes="**/visage*"/>
</target>
<target name="visagedoc-clean">
<echo message="clean in visagedoc/"/>
<ant dir="${visagedoc.dir}" antfile="build.xml" target="clean" inheritall="false" />
</target>
<target name="visagejdi-clean">
<echo message="clean in visagejdi/"/>
<ant dir="visagejdi" antfile="build.xml" target="clean" inheritall="false">
<property name="build.defs" value="${build.defs}" />
</ant>
</target>
<target name="launcher-clean">
<echo message="clean in launcher/"/>
<ant dir="${launcher.dir}" antfile="build.xml" target="clean" inheritall="false" />
</target>
<target name="langref-clean">
<echo message="clean in doc/"/>
<ant dir="doc" antfile="build.xml" target="clean" inheritall="false" />
</target>
<!-- Not part of the "clean" target processing. Used by ?? -->
<target name="real-clean">
<antcall target="visagejdi-clean" inheritall="false"/>
<antcall target="clean"/>
<antcall target="visagedoc-clean" inheritall="true"/>
<antcall target="langref-clean" inheritall="true"/>
<antcall target="launcher-clean" inheritall="true"/>
</target>
<!-- kelly? --> <available property="mail.jar" value="${ant.home}/lib/mail.jar" file="${ant.home}/lib/mail.jar"/>
<target name="weekly-build-check">
<!-- weekly build parameters, normally set by Hudson -->
<fail unless="weekly.build.alias"/>
<fail unless="weekly.buildmaster"/>
<!-- JavaMail jar, needed for build notification -->
<fail unless="mail.jar"/>
</target>
<target name="weekly-build" description="Weekly build target" depends="weekly-build-check">
<antcall target="-bundle-build">
<param name="release" value="weekly-${date.stamp}"/>
</antcall>
<mail from="${weekly.buildmaster}"
replyto="${weekly.build.alias}"
tolist="${weekly.build.alias}"
message="${date.stamp} weekly build completed:\n\nhttp://visage.org/builds/weekly/visage-compiler/weekly-${date.stamp}"
subject="Weekly build available"/>
</target>
<target name="milestone-build" description="Milestone build target">
<antcall target="-bundle-build"/>
</target>
<target name="-bundle-build" depends="init">
<fail unless="release" description="release tag not specified"/>
<mkdir dir="${bundle.dir}"/>
<zip destfile="${src.bundle}" basedir="${basedir}"
excludes="${bundle.dir}/**, ${build.dir}/**, ${dist.dir}/** , **/.svn/**" level="9"/>
<antcall target="bundle"/>
<!-- property set separately by Hudson build -->
<property name="bundle.destdir" value="${env.WORKSPACE}"/>
<mkdir dir="${bundle.destdir}/${release}"/>
<copy todir="${bundle.destdir}/${release}">
<fileset dir="${bundle.dir}"/>
</copy>
<delete dir="${bundle.destdir}/latest" failonerror="true"/>
<mkdir dir="${bundle.destdir}/latest"/>
<copy todir="${bundle.destdir}/latest">
<fileset dir="${bundle.dir}"/>
</copy>
</target>
<target name="pack-jars" depends="jar">
<taskdef name="pack200" classpath="${file.reference.pack200task.jar}"
classname="org.jdesktop.deployment.ant.pack200.Pack200Task"/>
<pack200 src="${dist.jar}" gzipoutput="true" destfile='${dist.jar}.pack.gz'/>
<pack200 src="${dist.visagert.jar}" gzipoutput="true" destfile='${dist.visagert.jar}.pack.gz'/>
</target>
<target name="source-zip" depends="init">
<zip destfile="${dist.dir}/src.zip">
<zipfileset file="${basedir}/LICENSE"/>
<zipfileset dir="${src.classes.dir}"/>
<zipfileset dir="visagedoc/src"/>
</zip>
</target>
<!--
======================
INITIALIZATION SECTION
======================
-->
<target depends="-pre-init" name="-init-private">
<property file="nbproject/private/config.properties"/>
<property file="nbproject/private/configs/${config}.properties"/>
<property file="nbproject/private/private.properties"/>
</target>
<target depends="-pre-init,-init-private" name="-init-user">
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
</target>
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
<property file="nbproject/configs/${config}.properties"/>
<property file="project.properties"/>
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project" name="-do-init">
<available file="${manifest.file}" property="manifest.available"/>
<condition property="manifest.available+main.class">
<and>
<isset property="manifest.available"/>
<isset property="main.class"/>
<not>
<equals arg1="${main.class}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="manifest.available+main.class+mkdist.available">
<and>
<istrue value="${manifest.available+main.class}"/>
<isset property="libs.CopyLibs.classpath"/>
</and>
</condition>
<condition property="have.tests">