-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
1063 lines (943 loc) · 57.4 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"?>
<!--
Copyright (c) 1995-2024 held by the author(s). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the names of the Naval Postgraduate School (NPS)
Modeling Virtual Environments and Simulation (MOVES) Institute
https://www.nps.edu and https://www.nps.edu/web/moves
nor the names of its contributors may be used to endorse or
promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-->
<project name="opendis7-source-generator" default="all" basedir=".">
<description>Builds, tests, and runs the project opendis7-source-generator.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="opendis7-source-generator-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
<tstamp>
<format property="timestamp" pattern="d MMMM yyyy HH:mm:ss"/>
</tstamp>
<!-- javadoc manifest properties -->
<property name="manifest.name" value="OpenDIS7 Entity Enumerations"/>
<property name="Built-By" value="https://github.com/open-dis/opendis7-source-generator"/>
<property name="Specification-Title" value="SISO Reference for Enumerations for Simulation Interoperability SISO-REF-010"/>
<property name="Specification-Version" value="v33"/>
<property name="Specification-Vendor" value="Simulation Interoperability Standards Organization (SISO)"/>
<property name="Implementation-Title" value="edu.nps.moves.dis7"/>
<property name="Implementation-Version" value="${timestamp}"/>
<property name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
<property environment="env"/>
<property name="opendis7-java" location="../opendis7-java"/>
<target name="versions" description="show tool versions and environment values">
<echo>ant -version</echo>
<exec executable="ant" dir="." vmlauncher="false">
<arg value="-version"/>
</exec>
<echo>java -version</echo>
<exec executable="java" dir="." vmlauncher="false">
<arg value="-version"/>
</exec>
<echo></echo>
<!-- Ant environment variables https://ant.apache.org/manual/Tasks/property.html -->
<echo> ANT_HOME=${env.ANT_HOME}</echo>
<echo> JAVA_HOME=${env.JAVA_HOME}</echo>
<echo> CLASSPATH=${env.CLASSPATH}</echo>
<!--<echo>USER =${env.USER}</echo> -->
<!-- https://stackoverflow.com/questions/949678/ant-is-using-wrong-java-version -->
<!--echo>javac source/target $java.source=${java.source}</ -->
<echo>Java/JVM version $ant.java.version=${ant.java.version}</echo>
<echo>Java/JVM detail version $java.version=${java.version}</echo>
<echo>Ant version $ant.version=${ant.version}</echo>
<echo>Configuration settings: https://savage.nps.edu/Savage/developers.html</echo>
<!-- TODO Netbeans version -->
<!-- TODO Netbeans project version -->
<!-- DEBUG: to show all environment and local properties, add
<echoproperties/> -->
<echo message="==========================================="/>
</target>
<target name="all" depends="versions,clean.build,clean" description="Build enumeration and PDU source code, assemble all products.">
<!-- TODO current configuration is Java only; Python is next -->
<echo message="timestamp ${timestamp}"/>
<fail message="Please build using Ant 1.10.14 or higher.">
<condition>
<not>
<antversion atleast="1.10.14"/><!-- recommend latest 1.10.+ -->
</not>
</condition>
</fail>
<echo message="=================================================================================="/>
<echo message="generate enumerations classes (given limited path entries in project classpath)"/>
<antcall target="-pre-pre-compile"/><!-- netbeans build-impl.xml -->
<copy todir="build/classes">
<fileset dir="stringTemplates"/>
</copy>
<javac destdir="build/classes"
debug="true"
debuglevel="lines,vars,source"
release="17"
includeantruntime="false">
<!-- release 17 is LTS, we are building master with 22 -->
<!-- release="8" causes problems immediately after clean; to silence warning:
https://stackoverflow.com/questions/59097317/warning-options-bootstrap-class-path-not-set-in-conjunction-with-source-8 -->
<src>
<pathelement path="src-autogenerate"/>
<pathelement path="src-supporting/java"/>
</src>
</javac>
<mkdir dir="dist" description="ensure dist directory present"/>
<!-- OK let's generate tens of thousands of classes for enumeration types from SISO, including DIS PDUs from DIS definitions -->
<antcall target="generate-source-code-java"/>
<echo message="compile source directories: src-autogenerate, src-generated, src-specialcase and src-supporting"/>
<antcall target="compile" description="compile all autogenerated classes with debug symbols"/>
<echo message="compile complete"/>
<!-- included in jar target
<antcall target="javadoc" description="create javadoc for all compiled code"/>
<echo message="javadoc complete"/>
-->
<antcall target="jar" description="create jar files, includes copy-generated-jars-to-opendis7-java"/>
<antcall target="copy-generated-source-to-opendis7-java" description="useful for debugging, accepted updates in version control there"/>
<echo message="opendis7-source-generator build all complete"/>
</target>
<target name="clean.pduLogs" description="clean recorded pduLog files">
<delete verbose="true" failonerror="false">
<fileset dir="pduLog">
<include name="*.dislog"/>
</fileset>
</delete>
</target>
<target name="clean.build" depends="clean.generated-jars-javadoc,clean.generated-source,clean.pduLogs">
</target>
<target name="clean.generated-jars-javadoc">
<mkdir dir="dist/javadoc" description="ensure necessary directory present"/>
<delete verbose="true">
<fileset dir="dist" includes="*.jar"/>
</delete>
<delete dir="dist/javadoc" description="get rid of all prior files"/>
<mkdir dir="dist/javadoc" description="restore directory"/>
</target>
<target name="clean.generated-source">
<echo message="ensure src-generated/java directory exists and is empty"/>
<mkdir dir="src-generated/java" description="ensure necessary directory present"/>
<delete verbose="false" includeEmptyDirs="true">
<fileset dir="src-generated/java">
<include name="**/*"/>
</fileset>
</delete>
</target>
<!-- Need to clean out previously generated source when rebuilding -->
<target name="-post-clean">
<antcall target="clean.generated-jars-javadoc"/>
<antcall target="clean.generated-source"/>
<!--<antcall target="clean.pduLogs"/>-->
<echo message="make clean complete"/>
</target>
<target name="jar">
<!-- javadoc manifest properties -->
<echo message="manifest.name = ${manifest.name}"/>
<echo message="Built-By = ${Built-By}"/>
<echo message="Specification-Title = ${Specification-Title}"/>
<echo message="Specification-Version = ${Specification-Version}"/>
<echo message="Specification-Vendor = ${Specification-Vendor}"/>
<echo message="Implementation-Title = ${Implementation-Title}"/>
<echo message="Implementation-Version = ${timestamp}"/>
<echo message="Implementation-Vendor = ${Implementation-Vendor}"/>
<antcall target="jar.enumerations.classes"/>
<antcall target="jar.enumerations.source"/>
<antcall target="jar.enumerations.javadoc"/>
<antcall target="copy-generated-jars-to-opendis7-java"/>
</target>
<target name="package-dis7-enumerations-prior-jars"
depends="">
<!-- seems unnecessary
package-dis7-entities-china-jar,
package-dis7-entities-germany-jar,
package-dis7-entities-nato-jar,
package-dis7-entities-russia-jar,
package-dis7-entities-usa-air-jar,
package-dis7-entities-usa-all-jar,
package-dis7-entities-usa-land-jar,
package-dis7-entities-usa-munitions-jar,
package-dis7-entities-usa-surface-jar
-->
<echo message=" package-dis7-enumerations-prior-jars complete"/>
</target>
<target name="jar.enumerations.classes">
<mkdir dir="dist"/>
<echo message="Packaging .class binaries for all generated OpenDIS7 entity enumerations into a single JAR"/>
<delete file="dist/opendis7-enumerations-classes.jar"/>
<jar destfile="dist/opendis7-enumerations-classes.jar"
basedir="."
includes=""
excludes="**/*"
update="true"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<fileset dir="build/classes" defaultexcludes="yes">
<include name="edu/nps/moves/dis7/entities/**/*.class"/>
<include name="edu/nps/moves/dis7/enumerations/**/*.class"/>
<include name="edu/nps/moves/dis7/jammers/**/*.class"/>
<include name="edu/nps/moves/dis7/objectTypes/**/*.class"/>
<exclude name="edu/nps/moves/dis7/pdus/**/*.class"/>
<exclude name="edu/nps/moves/dis7/utilities/**/*.class"/>
<exclude name="edu/nps/moves/dis7/source/generator/**/*.class"/>
<exclude name="edu/nps/moves/spatial/**/*.class"/>
</fileset>
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html -->
<manifest>
<attribute name="description" value="Java class files for ${manifest.name}"/>
<attribute name="Built-By" value="${Built-By}"/>
<attribute name="Specification-Title" value="${Specification-Title}"/>
<attribute name="Specification-Version" value="${Specification-Version}"/>
<attribute name="Specification-Vendor" value="${Specification-Vendor}"/>
<attribute name="Implementation-Title" value="${Implementation-Title}"/>
<attribute name="Implementation-Version" value="${Implementation-Version}"/>
<attribute name="Implementation-Vendor" value="${Implementation-Vendor}"/>
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/sealman.html -->
<section name="edu/nps/moves/dis7/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/entities/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/jammers/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/objectTypes/">
<attribute name="Sealed" value="true"/>
</section>
<!--
<section name="edu/nps/moves/dis7/source/generator/">
<attribute name="Sealed" value="true"/>
</section>
-->
</manifest>
</jar>
</target>
<target name="jar.enumerations.source">
<mkdir dir="dist"/>
<echo message="Packaging .java source for all generated OpenDIS7 entity enumerations into a single JAR"/>
<delete file="dist/opendis7-enumerations-source.jar"/>
<jar destfile="dist/opendis7-enumerations-source.jar"
basedir="."
includes=""
excludes="**/*"
update="true"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<!-- omit
excludes="build/,dist/,images/,lib/,nbproject/,stringTemplates/,test/,xml/,build.xml,src-autogenerate/,src-generated/,src-specialcase/,src-supporting/,src-generated/**/pdus/,**/opendis7-enumerations-source.jar"
includes="src-generated/**/*.java,src-specialcase/**/*.java,src-supporting/**/*.java"
includes="edu/nps/moves/dis7/**/*"
excludes="edu/nps/moves/dis7/pdus/**/*,edu/nps/moves/dis7/source/generator/**/*"
<fileset dir="src-autogenerate">
<include name="**/*.java"/>
</fileset>
-->
<fileset dir="src-generated/java">
<include name="**/*.java"/>
<!-- TODO not excluding pdus directory correctly -->
<exclude name="edu/nps/moves/dis7/pdus/*.java"/>
</fileset>
<fileset dir="src-specialcase/java">
<include name="**/*.java"/>
</fileset>
<fileset dir="src-supporting/java">
<include name="**/*.java"/>
</fileset>
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html -->
<manifest>
<attribute name="description" value="Java source files for ${manifest.name}"/>
<attribute name="Built-By" value="${Built-By}"/>
<attribute name="Specification-Title" value="${Specification-Title}"/>
<attribute name="Specification-Version" value="${Specification-Version}"/>
<attribute name="Specification-Vendor" value="${Specification-Vendor}"/>
<attribute name="Implementation-Title" value="${Implementation-Title}"/>
<attribute name="Implementation-Version" value="${Implementation-Version}"/>
<attribute name="Implementation-Vendor" value="${Implementation-Vendor}"/>
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/sealman.html -->
<section name="edu/nps/moves/dis7/">
<attribute name="Sealed" value="true"/>
</section>
<!--
<section name="edu/nps/moves/dis7/entities/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/jammers/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/objectTypes/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/source/generator/">
<attribute name="Sealed" value="true"/>
</section>
-->
</manifest>
</jar>
</target>
<target name="package-dis7-entities-china-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-chn"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 Chinese entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="README.md,edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/chn/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html -->
<manifest>
<attribute name="Built-By" value="${Built-By}"/>
<attribute name="Specification-Title" value="${Specification-Title}"/>
<attribute name="Specification-Version" value="${Specification-Version}"/>
<attribute name="Specification-Vendor" value="${Specification-Vendor}"/>
<attribute name="Implementation-Title" value="${Implementation-Title}"/>
<attribute name="Implementation-Version" value="${Implementation-Version}"/>
<attribute name="Implementation-Vendor" value="${Implementation-Vendor}"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-germany-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-deu"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 German entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="README.md,edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/deu/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html -->
<manifest>
<attribute name="Built-By" value="opendis7-source-generator https://github.com/open-dis/opendis7-source-generator"/>
<attribute name="Specification-Title" value="OpenDIS7 German Entities"/>
<attribute name="Specification-Version" value="Reference for Enumerations for Simulation Interoperability SISO-REF-010-v33"/>
<attribute name="Specification-Vendor" value="Naval Postgraduate School (NPS)"/>
<attribute name="Implementation-Title" value="edu.nps.moves.dis7"/>
<attribute name="Implementation-Version" value="${timestamp}"/>
<attribute name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-russia-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-rus"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 Russian entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="README.md,edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/rus/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<manifest>
<attribute name="Built-By" value="${Built-By}"/>
<attribute name="Specification-Title" value="${Specification-Title}"/>
<attribute name="Specification-Version" value="${Specification-Version}"/>
<attribute name="Specification-Vendor" value="${Specification-Vendor}"/>
<attribute name="Implementation-Title" value="${Implementation-Title}"/>
<attribute name="Implementation-Version" value="${Implementation-Version}"/>
<attribute name="Implementation-Vendor" value="${Implementation-Vendor}"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-usa-all-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-usa-all"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 American entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="README.md,edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/usa/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<manifest>
<attribute name="Built-By" value="opendis7-source-generator https://github.com/open-dis/opendis7-source-generator"/>
<attribute name="Specification-Title" value="OpenDIS7 American Entities"/>
<attribute name="Specification-Version" value="Reference for Enumerations for Simulation Interoperability SISO-REF-010-v33"/>
<attribute name="Specification-Vendor" value="Naval Postgraduate School (NPS)"/>
<attribute name="Implementation-Title" value="edu.nps.moves.dis7"/>
<attribute name="Implementation-Version" value="${timestamp}"/>
<attribute name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-usa-munitions-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-usa-munitions"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 American munitions entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/usa/munition/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<manifest>
<attribute name="Built-By" value="opendis7-source-generator https://github.com/open-dis/opendis7-source-generator"/>
<attribute name="Specification-Title" value="OpenDIS7 American Munition Entities"/>
<attribute name="Specification-Version" value="Reference for Enumerations for Simulation Interoperability SISO-REF-010-v33"/>
<attribute name="Specification-Vendor" value="Naval Postgraduate School (NPS)"/>
<attribute name="Implementation-Title" value="edu.nps.moves.dis7"/>
<attribute name="Implementation-Version" value="${timestamp}"/>
<attribute name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-usa-air-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-usa-air"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 American air entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/usa/platform/air/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<manifest>
<attribute name="Built-By" value="opendis7-source-generator https://github.com/open-dis/opendis7-source-generator"/>
<attribute name="Specification-Title" value="OpenDIS7 American Air Entities"/>
<attribute name="Specification-Version" value="Reference for Enumerations for Simulation Interoperability SISO-REF-010-v33"/>
<attribute name="Specification-Vendor" value="Naval Postgraduate School (NPS)"/>
<attribute name="Implementation-Title" value="edu.nps.moves.dis7"/>
<attribute name="Implementation-Version" value="${timestamp}"/>
<attribute name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-usa-land-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-usa-land"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 American land entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/usa/platform/land/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<manifest>
<attribute name="Built-By" value="opendis7-source-generator https://github.com/open-dis/opendis7-source-generator"/>
<attribute name="Specification-Title" value="OpenDIS7 American Land Entities"/>
<attribute name="Specification-Version" value="Reference for Enumerations for Simulation Interoperability SISO-REF-010-v33"/>
<attribute name="Specification-Vendor" value="Naval Postgraduate School (NPS)"/>
<attribute name="Implementation-Title" value="edu.nps.moves.dis7"/>
<attribute name="Implementation-Version" value="${timestamp}"/>
<attribute name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-usa-surface-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-usa-surface"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 American surface entities into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
includes="edu/nps/moves/dis7/entities/EntityTypeFactory.class,edu/nps/moves/dis7/entities/uid2EntityClass.properties,edu/nps/moves/dis7/entities/usa/platform/surface/**"
excludes=".keep"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<manifest>
<attribute name="Built-By" value="opendis7-source-generator https://github.com/open-dis/opendis7-source-generator"/>
<attribute name="Specification-Title" value="OpenDIS7 American Surface Entities"/>
<attribute name="Specification-Version" value="Reference for Enumerations for Simulation Interoperability SISO-REF-010-v33"/>
<attribute name="Specification-Vendor" value="Naval Postgraduate School (NPS)"/>
<attribute name="Implementation-Title" value="edu.nps.moves.dis7"/>
<attribute name="Implementation-Version" value="${timestamp}"/>
<attribute name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
</manifest>
</jar>
</target>
<target name="package-dis7-entities-nato-jar">
<local name="store.jar.name"/>
<local name="store.dir"/>
<local name="store.jar"/>
<property name="store.jar.name" value="opendis7-entities-nato"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging OpenDIS7 Nato entities (no USA) into a single JAR at ${store.jar}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.jar}"
basedir="build/classes"
excludes = ".keep, README.md"
includes = "edu/nps/moves/dis7/entities/EntityTypeFactory.class,
edu/nps/moves/dis7/entities/uid2EntityClass.properties,
edu/nps/moves/dis7/entities/alb/**,
edu/nps/moves/dis7/entities/bel/**,
edu/nps/moves/dis7/entities/bgr/**,
edu/nps/moves/dis7/entities/can/**,
edu/nps/moves/dis7/entities/cze/**,
edu/nps/moves/dis7/entities/deu/**,
edu/nps/moves/dis7/entities/dnk/**,
edu/nps/moves/dis7/entities/esp/**,
edu/nps/moves/dis7/entities/est/**,
edu/nps/moves/dis7/entities/fra/**,
edu/nps/moves/dis7/entities/gbr/**,
edu/nps/moves/dis7/entities/grc/**,
edu/nps/moves/dis7/entities/hrv/**,
edu/nps/moves/dis7/entities/hun/**,
edu/nps/moves/dis7/entities/ita/**,
edu/nps/moves/dis7/entities/ltu/**,
edu/nps/moves/dis7/entities/lva/**,
edu/nps/moves/dis7/entities/mne/**,
edu/nps/moves/dis7/entities/nld/**,
edu/nps/moves/dis7/entities/nor/**,
edu/nps/moves/dis7/entities/pol/**,
edu/nps/moves/dis7/entities/prt/**,
edu/nps/moves/dis7/entities/roy/**,
edu/nps/moves/dis7/entities/svk/**,
edu/nps/moves/dis7/entities/tur/**"
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<manifest>
<attribute name="Built-By" value="opendis7-source-generator https://github.com/open-dis/opendis7-source-generator"/>
<attribute name="Specification-Title" value="OpenDIS7 Nato Entities"/>
<attribute name="Specification-Version" value="Reference for Enumerations for Simulation Interoperability SISO-REF-010-v33"/>
<attribute name="Specification-Vendor" value="Naval Postgraduate School (NPS)"/>
<attribute name="Implementation-Title" value="edu.nps.moves.dis7"/>
<attribute name="Implementation-Version" value="${timestamp}"/>
<attribute name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
</manifest>
</jar>
</target>
<property name="SISO-REF-010.xml" value="SISO-REF-010.xml"/>
<target name="generate-source-code-java">
<echo message="=================================================================================="/>
<echo message="generate-source-code-java stage 1 make enums, edu.nps.moves.dis7.source.generator.enumerations.GenerateEnumerations"/>
<java classname="edu.nps.moves.dis7.source.generator.enumerations.GenerateEnumerations">
<arg value="xml/SISO/${SISO-REF-010.xml}"/>
<arg value="src-generated/java/edu/nps/moves/dis7/enumerations"/>
<arg value="edu.nps.moves.dis7.enumerations"/>
<classpath>
<pathelement path="build/classes"/>
</classpath>
</java>
<echo message="=================================================================================="/>
<echo message="generate-source-code-java stage 2 make pdus, edu.nps.moves.dis7.source.generator.pdus.GeneratePdusForGivenLanguage"/>
<java classname="edu.nps.moves.dis7.source.generator.pdus.GeneratePdusForGivenLanguage">
<arg value="xml/dis_7_2012/DIS_7_2012.xml"/>
<arg value="java"/>
<jvmarg value="-Dxmlpg.generatedSourceDir=src-generated/java"/>
<jvmarg value="-Dxmlpg.package=edu.nps.moves.dis7.pdus"/>
<classpath>
<pathelement path="build/classes"/>
</classpath>
</java>
<echo message="copy utilities to special-case tree to support compilation"/>
<mkdir dir="${opendis7-java}/src/edu/nps/moves/dis7/utilities"/>
<copy todir="src-specialcase/java/edu/nps/moves/dis7/utilities" overwrite="true" verbose="true">
<fileset dir="${opendis7-java}/src/edu/nps/moves/dis7/utilities">
<include name="DisTime.java"/>
<include name="PduFactory.java"/>
</fileset>
</copy>
<!-- not yet ready to compile here, more autogeneration needed -->
<echo message="=================================================================================="/>
<echo message="generate-source-code-java stage 3 make jammers, edu.nps.moves.dis7.source.generator.entityTypes.GenerateJammers"/>
<java classname="edu.nps.moves.dis7.source.generator.entityTypes.GenerateJammers">
<arg value="xml/SISO/${SISO-REF-010.xml}"/>
<arg value="src-generated/java/edu/nps/moves/dis7/jammers"/>
<arg value="edu.nps.moves.dis7.jammers"/>
<classpath>
<pathelement path="build/classes"/>
</classpath>
</java>
<!-- not yet ready to compile here, more autogeneration needed -->
<echo message="=================================================================================="/>
<echo message="generate-source-code-java stage 4 make object types, edu.nps.moves.dis7.source.generator.entityTypes.GenerateObjectTypes"/>
<java classname="edu.nps.moves.dis7.source.generator.entityTypes.GenerateObjectTypes">
<arg value="xml/SISO/${SISO-REF-010.xml}"/>
<arg value="src-generated/java/edu/nps/moves/dis7/objectTypes"/>
<arg value="edu.nps.moves.dis7.objectTypes"/>
<classpath>
<pathelement path="build/classes"/>
</classpath>
</java>
<echo message="*** delete problem classes replaced by manually tuned files in src-specialcase"/>
<delete verbose="true" file="src-generated\java\edu\nps\moves\dis7\pdus\SignalPdu.java"/>
<delete verbose="true" file="src-generated\java\edu\nps\moves\dis7\pdus\IntercomSignalPdu.java"/>
<javac destdir="build/classes"
debug="true"
debuglevel="lines,vars,source"
release="17"
includeantruntime="false"
fork="true">
<src>
<pathelement path="src-specialcase/java"/>
<pathelement path="src-generated/java"/>
</src>
<exclude name="edu/nps/moves/dis7/pdus/VariableDatum.java"/><!-- TODO fix autogeneration to match special case -->
<classpath>
<pathelement path="build/classes"/>
</classpath>
</javac>
<!-- must compile to gain access to necessary classes for generate-source-code-java stage 5 -->
<echo message="=================================================================================="/>
<echo message="generate-source-code-java stage 5 make entities, edu.nps.moves.dis7.source.generator.entityTypes.GenerateEntityTypes"/>
<java classname="edu.nps.moves.dis7.source.generator.entityTypes.GenerateEntityTypes">
<arg value="xml/SISO/${SISO-REF-010.xml}"/>
<arg value="src-generated/java/edu/nps/moves/dis7/entities"/>
<arg value="edu.nps.moves.dis7.entities"/>
<classpath>
<pathelement path="build/classes"/>
</classpath>
</java>
<echo message="generate-source-code-java complete"/>
<echo message="=================================================================================="/>
</target>
<target name="jar.enumerations.javadoc" depends="javadoc">
<mkdir dir="dist"/>
<echo message="Packaging javadoc documentation for all generated OpenDIS7 entity enumerations into a single JAR"/>
<echo message="(note that generated javadoc subdirectory is found within dist subdirectory)"/>
<delete file="dist/opendis7-enumerations-javadoc.jar"/>
<jar destfile="dist/opendis7-enumerations-javadoc.jar"
update="true"
includes=""
excludes="**/*"
basedir="."
zip64Mode="as-needed"> <!-- if not default zip64Mode="as-needed" then NetBeans has problems looking into this jar -->
<fileset dir="dist/javadoc">
<include name="**/*"/>
</fileset>
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html -->
<manifest>
<attribute name="description" value="javadoc files for ${manifest.name}"/>
<attribute name="Built-By" value="${Built-By}"/>
<attribute name="Specification-Title" value="${Specification-Title}"/>
<attribute name="Specification-Version" value="${Specification-Version}"/>
<attribute name="Specification-Vendor" value="${Specification-Vendor}"/>
<attribute name="Implementation-Title" value="${Implementation-Title}"/>
<attribute name="Implementation-Version" value="${Implementation-Version}"/>
<attribute name="Implementation-Vendor" value="${Implementation-Vendor}"/>
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/sealman.html -->
<section name="edu/nps/moves/dis7/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/entities/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/jammers/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/objectTypes/">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/dis7/source/generator/">
<attribute name="Sealed" value="true"/>
</section>
</manifest>
</jar>
</target>
<!-- Invoke this in lieu of step #3 under "If you desire to update the opendis7-java" project in ./README.md -->
<target name="copy-generated-source-to-opendis7-java">
<echo message="Both enumerations and PDUs are created by opendis7-source-generator, with"/>
<echo message=" PDU classes packaged into opendis7-pdus-*.jar archives by opendis7-java project and"/>
<echo message=" enumerations packaged into opendis7-enumerations-*.jar archives by opendis7-source-generator."/>
<echo message=" Complete set packaged into opendis7-full.jar archive by opendis7-java project."/>
<delete includeemptydirs="true" failonerror="false"><!-- verbose="true" -->
<fileset dir="${opendis7-java}/src-generated" includes="**/*"/>
</delete>
<mkdir dir="${opendis7-java}/src-generated"/>
<copy todir="${opendis7-java}/src-generated" overwrite="true">
<fileset dir="src-generated/java">
<include name="**/*.java"/>
<exclude name="edu/nps/moves/dis7/pdus/VariableDatum.java"/><!-- TODO fix autogeneration to match special case -->
</fileset>
<fileset dir="src-supporting/java">
<include name="**/*.java"/>
</fileset>
</copy>
<!-- TODO duplicate; this can become order dependent if autogenerated version makes corresponding specialcase unnecessary... -->
<copy todir="${opendis7-java}/src-generated" overwrite="true">
<fileset dir="src-specialcase/java">
<include name="**/*.java"/>
<exclude name="edu/nps/moves/dis7/utilities/DisTime.java"/> <!-- duplicated for source-generator compilation purposes -->
<exclude name="edu/nps/moves/dis7/utilities/PduFactory.java"/><!-- duplicated for source-generator compilation purposes -->
</fileset>
</copy>
</target>
<target name="copy-generated-jars-to-opendis7-java">
<echo message="Copy copy generated jars to opendis7-java project"/>
<echo message="Both enumerations and PDUs are created by opendis7-source-generator, with"/>
<echo message=" PDU classes packaged into opendis7-*.jar archives by opendis7-java project and"/>
<echo message=" enumerations packaged into opendis7-enumerations-*.jar archives by opendis7-source-generator."/>
<delete includeemptydirs="true" failonerror="false" verbose="false"><!-- verbose="true" false -->
<fileset dir="${opendis7-java}/dist">
<include name="opendis7-enumerations-classes.jar"/>
<include name="opendis7-enumerations-source.jar"/>
<include name="opendis7-enumerations-javadoc.jar"/>
</fileset>
</delete>
<mkdir dir="${opendis7-java}/dist"/>
<echo message="copy dist/opendis7-enumerations-classes.jar, -source.jar, -javadoc.jar to ${opendis7-java}/dist"/>
<copy todir="${opendis7-java}/dist" overwrite="true" verbose="true" force="true" failonerror="true">
<fileset dir="dist">
<include name="opendis7-enumerations-classes.jar"/>
<include name="opendis7-enumerations-source.jar"/>
<include name="opendis7-enumerations-javadoc.jar"/>
</fileset>
</copy>
</target>
<target name="view.issues.online" description="view online issues in web browser (Netbeans only)">
<echo message="https://github.com/open-dis/opendis7-source-generator/issues" />
<nbbrowse url="https://github.com/open-dis/opendis7-source-generator/issues" />
<!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. -->
</target>
<target name="view.javadoc.local" description="view local package javadoc in web browser (Netbeans only)">
<nbbrowse file="dist/javadoc/index.html" />
<!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. -->
</target>
<target name="view.javadoc.online" description="view online package javadoc in web browser (Netbeans only)">
<echo message="view online javadoc in dist/javadoc subdirectory"/>
<nbbrowse url="https://savage.nps.edu/opendis7-java/javadoc" />
<!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. -->
</target>
<!-- special test harness for JUnit5 by Terry Norbraten -->
<target depends="compile-test,-pre-test-run"
description="Run unit tests."
name="test" >
<java classpath="${run.test.classpath}"
classname="org.junit.platform.console.ConsoleLauncher"
fork="true">
<arg value="--disable-banner"/>
<arg value="--fail-if-no-tests"/>
<arg value="--scan-classpath=${build.test.classes.dir}"/>
<arg value="--reports-dir=${build.test.results.dir}"/>
</java>
<junitreport todir="build/test/results">
<fileset dir="build/test/results">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="build/test/results/html"/>
</junitreport>
</target>
<target depends="compile-test-single,-pre-test-run-single"
description="Run single unit test."
name="-do-test-run-single">
<echo message="Testing: ${test.class}"/>
<java classpath="${run.test.classpath}"
classname="org.junit.platform.console.ConsoleLauncher"
fork="true">
<arg value="--disable-banner"/>
<arg value="--fail-if-no-tests"/>
<arg line="-c=${test.class}"/>
<!--<arg value="-h"/>-->
</java>
</target>
<!-- https://stackoverflow.com/questions/919692/how-to-execute-xslt-2-0-with-ant -->
<!-- https://sourceforge.net/projects/saxon/files/Saxon-HE jar download handled in X3DJSAIL build -->
<!-- https://github.com/Saxonica/Saxon-HE/tree/main/12/Java -->
<!-- https://www.saxonica.com/documentation10/#!about/gettingstarted/gettingstartedjava -->
<!-- SaxonHE 11 (java.lang.NoClassDefFoundError: org/xmlresolver/Resolver) https://saxonica.plan.io/boards/3/topics/8478?r=8480 -->
<property name="saxon.dir" location="lib" description="relative path from stylesheets directory"/>
<!-- previously saxon-he-12.4.jar saxon-he-11.4.jar saxon-he-11.3.jar saxon-he-11.2.jar saxon-he-10.6.jar saxon9he.jar -->
<property name="saxon.jar" value="saxon-he-12.5.jar"/>
<property name="xmlresolver.jar" value="xmlresolver-5.2.2.jar"/><!-- required with saxon-he-11+.jar -->
<property name="xmlresolver-data.jar" value="xmlresolver-5.2.2-data.jar"/><!-- provided with saxon-he-11+.jar -->
<property name="jline.jar" value="jline-2.14.6.jar"/>
<property name="saxon.classpath" value="${saxon.dir}/${saxon.jar};.${saxon.dir}/${jline.jar};.${saxon.dir}/${xmlresolver.jar};.${saxon.dir}/${xmlresolver-data.jar};."/>
<target name="get.saxon" description="get saxon.jar if not checked out" depends="get.saxon.check" unless="${saxon.found}"> <!-- -->
<echo message="get tested saxon.jar from project version control if not already checked out locally"/>
<mkdir dir="${saxon.dir}"/>
<echo message="get https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/stylesheets/java/lib/${saxon.jar}"/>
<get src="https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/stylesheets/java/lib/${saxon.jar}"
dest="${saxon.dir}/${saxon.jar}" verbose="${VERBOSE}" ignoreerrors="${ignoreSetupDownloadErrors}"/>
<get src="https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/stylesheets/java/lib/${xmlresolver.jar}"
dest="${saxon.dir}/${xmlresolver.jar}" verbose="${VERBOSE}" ignoreerrors="${ignoreSetupDownloadErrors}"/>
<get src="https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/stylesheets/java/lib/${xmlresolver-data.jar}"
dest="${saxon.dir}/${xmlresolver-data.jar}" verbose="${VERBOSE}" ignoreerrors="${ignoreSetupDownloadErrors}"/>
</target>
<target name="get.saxon.check">
<condition property="saxon.found" else="false">
<available file="${saxon.dir}/${saxon.jar}"/>
</condition>
<echo message="found ${saxon.dir}/${saxon.jar}: ${saxon.found}"/>
<condition property="xmlresolver.found" else="false">
<available file="${saxon.dir}/${xmlresolver.jar}"/>
</condition>
<echo message="found ${saxon.dir}/${xmlresolver.jar}: ${xmlresolver.found}"/>
<condition property="xmlresolver-data.found" else="false">
<available file="${saxon.dir}/${xmlresolver-data.jar}"/>
</condition>
<echo message="found ${saxon.dir}/${xmlresolver-data.jar}: ${xmlresolver-data.found}"/>
</target>
<!-- DIS Schema creation from Don McGregor's OpenDIS7 XML structures -->
<target name="create.DIS7.schema" depends="validate.DIS7.definitions"
description="DIS Schema creation from Don McGregor's OpenDIS7 XML structures">
<property name="DIS7.schema.filename" value="DIS_7_2012.autogenerated.xsd"/>
<delete file="xml/${DIS7.schema.filename}"/>
<java classname="net.sf.saxon.Transform" classpath="${saxon.classpath}" fork="${fork}">
<arg value="-t" description="timing information"/>
<arg value="-warnings:recover" description="recover after writing a warning message"/>
<arg value="-o:xml/${DIS7.schema.filename}" description="output-doc"/>
<arg value="-s:xml/dis_7_2012/DIS_7_2012.xml" description="source-doc"/>
<arg value="-xsl:xml/MergeOpenDisTemplatesIntoDis7Schema.xslt" description="style-doc"/>
</java>
<!-- debug -->
<echo message="======================================="/>
<!-- debug
<echo message="concat xml/${DIS7.schema.filename}"/>
<concat>
<fileset dir="xml" includes="${DIS7.schema.filename}"/>
</concat>
-->
<antcall target="validate.DIS7.schema"/>
<echo message="======================================="/>
<echo message="Generate xml/AllPduAssessment.md"/>
<java classname="net.sf.saxon.Transform" classpath="${saxon.classpath}" fork="${fork}">
<arg value="-t" description="timing information"/>
<arg value="-warnings:recover" description="recover after writing a warning message"/>
<arg value="-o:xml/AllPduAssessment.md" description="output-doc"/>
<arg value="-s:xml/DIS_7_2012.autogenerated.xsd" description="source-doc"/>
<arg value="-xsl:xml/DisSchemaToAllPduMarkdown.xslt" description="style-doc"/>
</java>
<!-- debug -->
<echo message="======================================="/>
<echo message="build create.DIS7.schema complete, output logged in xml/build.DIS7.schema.log.txt"/>
</target>