forked from open-dis/opendis7-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
595 lines (542 loc) · 31.7 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1995-2023 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-java" default="default" basedir="." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3">
<description>Builds, tests, and runs the opendis7-java project.</description>
<import file="nbproject/build-impl.xml"/>
<property file="nbproject/project.properties"/>
<tstamp>
<format property="timestamp" pattern="d MMMM yyyy HH:mm:ss"/>
</tstamp>
<!-- javadoc manifest properties -->
<property name="manifest.name" value="OpenDIS7 Protocol Data Units (PDUs)"/>
<property name="Built-By" value="https://github.com/open-dis/opendis7-java"/>
<property name="Specification-Title" value="IEEE Distributed Interactive Simulation (DIS) Protocol"/>
<property name="Specification-Version" value="7"/>
<property name="Specification-Vendor" value="Institute of Electrical and Electronics Engineers (IEEE)"/>
<property name="Implementation-Title" value="edu.nps.moves.dis7"/>
<property name="Implementation-Version" value="${timestamp}"/>
<property name="Implementation-Vendor" value="Naval Postgraduate School (NPS)"/>
<!-- ensure backwards compatibility of produced jar to specified version of Java, though project itself is JDK 17+ -->
<property name="java.source" value="11"/>
<property name="java.target" value="11"/>
<!-- https://ant.apache.org/manual/Tasks/zip.html#zip64 -->
<property name="zip64Mode" value="as-needed" description="needed for large zip files"/>
<property name="javadoc.additionalparam" value=""/>
<property name="javadoc.author" value="Don Brutzman [email protected]"/>
<property name="javadoc.dir" value="${dist.javadoc.dir}"/>
<property name="javadoc.encoding" value="ISO-8859-1"/>
<property name="javadoc.copyright" value="Copyright ©1995-2023 held by the authors, <a href='https://www.nps.edu'>Naval Postgraduate School (NPS)</a> under an <a href='../license.html'>open-source license</a> and free for any use. <a href='mailto:[email protected]?subject=opendis7-java%20feedback'>Feedback</a> is welcome."/>
<property name="javadoc.noindex" value="false"/>
<property name="javadoc.nonavbar" value="false"/>
<property name="javadoc.notree" value="false"/>
<property name="javadoc.private" value="false"/>
<property name="javadoc.source" value="${java.source}"/>
<property name="javadoc.splitindex" value="true"/>
<property name="javadoc.breakiterator" value="true"/>
<property name="javadoc.use" value="true"/><!-- Create class and package usage pages -->
<property name="javadoc.version" value="true"/>
<property name="javadoc.windowtitle" value="opendis7 Javadoc"/>
<property name="javadoc.doctitle" value="${javadoc.windowtitle}"/>
<!-- build.impl <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" 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}"> -->
<target name="all" description="Build and test the whole project, create distribution jar files.">
<!-- TODO current configuration is Java only; Python is next -->
<echo message="timestamp ${timestamp}"/>
<fail message="Please build using Ant 1.10.12 or higher.">
<condition>
<not>
<antversion atleast="1.10.12"/><!-- recommend latest 1.10.+ -->
</not>
</condition>
</fail>
<antcall target="clean"/>
<mkdir dir="build" description="ensure necessary directory present"/>
<mkdir dir="build/classes" description="ensure necessary directory present"/>
<mkdir dir="build/test/classes" description="ensure necessary directory present"/>
<echo message="================"/>
<antcall target="compile"/>
<echo message="================"/>
<antcall target="test"/>
<echo message="TODO: more test suite additions, meanwhile individual programs are runnable OK"/>
<echo message="================"/>
<antcall target="javadoc.custom"/>
<echo message="================"/>
<antcall target="jar"/>
<copy file="license.txt" todir="${dist.dir}" force="true" verbose="true"/>
<copy file="license.html" todir="${dist.dir}" force="true" verbose="true"/>
<echo message="================"/>
<antcall target="deploy.guidance"/>
<echo message="================"/>
<echo message="opendis7-java build all complete"/>
</target>
<target name="clean.pduLog" description="clean recorded pduLog files">
<mkdir dir="pduLog" description="ensure necessary directory present"/>
<echo message="deleting prior default autogenerated pduLog/*.dislog files, if any"/>
<delete verbose="true">
<fileset dir="pduLog">
<include name="*.dislog"/>
</fileset>
</delete>
</target>
<target name="clean" depends="init" description="clean assets created by this project">
<delete verbose="true" failonerror="false">
<fileset dir="${dist.dir}">
<include name="opendis7-pdus-classes.jar"/>
<include name="opendis7-pdus-source.jar"/>
<include name="opendis7-pdus-javadoc.jar"/>
<include name="opendis7-full.zip"/>
<include name="opendis7-full.jar"/>
<!-- do not delete jar files produced by opendis7-source-generator -->
<exclude name="opendis7-enumerations-classes.jar"/>
<exclude name="opendis7-enumerations-source.jar"/>
<exclude name="opendis7-enumerations-javadoc.jar"/>
<exclude name="README.md"/>
</fileset>
</delete>
<delete dir="${dist.javadoc.dir}" description="get rid of all prior files" failonerror="false"/>
<delete verbose="false" includeemptydirs="false" failonerror="false">
<fileset dir="${build.classes.dir}" includes="**/*"/>
<fileset dir="${build.test.dir}" includes="**/*"/>
</delete>
</target>
<target name="clean.build">
<!-- should be fixed now... <echo message="warning: be judicious about clean.build, full recompilation may require multiple compilation loops afterward"/> -->
<mkdir dir="build" description="ensure necessary directory present"/>
<delete includeemptydirs="true" verbose="false" failonerror="false">
<fileset dir="build" includes="**/*"/>
<fileset dir="build" includes="**/*"/>
</delete>
</target>
<target name="view.issues.online" description="view online issues in web browser (Netbeans only)">
<echo message="https://github.com/open-dis/opendis7-java/issues" />
<nbbrowse url="https://github.com/open-dis/opendis7-java/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)">
<echo message="view local javadoc in ${dist.javadoc.dir} subdirectory"/>
<nbbrowse file="${dist.javadoc.dir}/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>
<target name="deploy.guidance" description="instructions">
<echo message="Deployment steps:"/>
<echo message="1. opendis7-java-source-generator build"/>
<echo message=" * build all"/>
<echo message="2. opendis7-java build"/>
<echo message=" * build all"/>
<echo message=" * commit and push all changed source files in both projects"/>
<echo message="3. MV3500 Distributed Simulation Fundamentals"/>
<echo message=" * run update.opendis7.jar.from.local to for new copy in lib/opendis7-full.jar"/>
<echo message=" * test course examples via build all invocations"/>
<echo message=" * test student assignments via build all invocations"/>
<echo message=" * commit and push opendis7-full.jar"/>
<echo message="4. scp savage.nps.edu/data/html/opendis7-java"/>
<echo message=" * TODO automate the following uploads by adding build tasks..."/>
<echo message=" * opendis7-java/dist/javadoc"/>
<echo message=" * opendis7-java/dist/opendis7-full.jar"/>
<echo message=" * opendis7-source-generator/xml/DIS_7_2012.autogenerated.xsd to xml/ subdirectory"/>
<echo message=" * opendis7-source-generator/xml/dis_7_2021 directory of template files"/>
<echo message=" * Corresponding Altova XMLSpy autogenerated documentation to xml/SchemaDocumentation"/>
<!-- TODO additional pieces/parts -->
</target>
<target name="javadoc.custom" description="Customized javadoc">
<echo message="$javac.classpath=${javac.classpath}"/>
<copy file="images/OpenDisSurferDude.png" todir="${javadoc.dir}"/>
<javadoc destdir="${javadoc.dir}"
author="${javadoc.author}"
bottom="${javadoc.copyright}"
breakiterator="${javadoc.breakiterator}"
classpath="${x3djsail.stylesheets.dir}/${jsai.full.archive.jar.name};${run.test.classpath}"
Encoding="${javadoc.encoding}"
Doctitle="${javadoc.doctitle}"
Header="${javadoc.doctitle}"
maxmemory="4096m"
noindex="${javadoc.noindex}"
nonavbar="${javadoc.nonavbar}"
notree="${javadoc.notree}"
Overview="src/overview.html"
Private="${javadoc.private}"
source="${java.source}"
Splitindex="${javadoc.splitindex}"
Use="${javadoc.use}"
useexternalfile="yes"
verbose="true"
version="${javadoc.version}"
windowtitle="${javadoc.windowtitle}">
<fileset dir="." defaultexcludes="yes">
<include name="src/**/*.java"/>
<!-- latest enumerations are found in src-generated -->
<include name="src-generated/**/*.java"/>
<include name="test/**/*.java"/>
</fileset>
</javadoc>
<antcall target="view.javadoc.local"/>
</target>
<!--
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-java-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.
-->
<!--
TODO Terry please confirm or improve this comment block
JUnit 5 is not perfectly supported in Netbeans 11 at this time. This
technique will enable the "Test Project" choice in the "Run" menu to properly
run junit 5 test. Running in other ways, such as individually, doesn't seem
to work. https://blogs.apache.org/netbeans/entry/junit-5-apache-ant-and
Porting this project over to Maven might do the trick. NB supports right
click, test-single for Maven. TDN 08 JUN 2020.
-->
<target name="jar" depends="compile">
<!-- 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-pdus-classes"/>
<antcall target="jar-pdus-source"/>
<antcall target="jar-pdus-javadoc"/>
<antcall target="jar-full"/>
<!--<antcall target="zip-full"/>-->
</target>
<target name="zip-full" description="full set of everything, pdus and enumerations">
<!-- TODO README -->
<!-- https://ant.apache.org/manual/Tasks/delete.html -->
<delete file="${dist.dir}/opendis7-full.zip" performGCOnFailedDelete="true" failonerror="true"/>
<zip destfile="${dist.dir}/opendis7-full.zip"
update="true"
zip64Mode="${zip64Mode}">
<!-- zip64Mode https://stackoverflow.com/questions/39524481/error-creating-jar-archive-contains-more-than-65535-entries/ -->
<!-- https://stackoverflow.com/questions/515428/clean-way-to-combine-multiple-jars-preferably-using-ant -->
<zipfileset src="${dist.dir}/opendis7-enumerations-classes.jar"/>
<zipfileset src="${dist.dir}/opendis7-enumerations-javadoc.jar"/>
<zipfileset src="${dist.dir}/opendis7-enumerations-source.jar"/>
<zipfileset src="${dist.dir}/opendis7-pdus-classes.jar"/>
<zipfileset src="${dist.dir}/opendis7-pdus-javadoc.jar"/>
<zipfileset src="${dist.dir}/opendis7-pdus-source.jar"/>
<!-- <fileset dir="build" defaultexcludes="yes">
<include name="classes/**/*"/>
<exclude name="test/*"/>
</fileset>-->
<fileset dir="${dist.dir}" defaultexcludes="yes">
<exclude name="javadoc/**"/>
</fileset>
<!-- <fileset dir="src" defaultexcludes="yes">
<include name="**/*"/>
<exclude name="test/*"/>
</fileset>
<fileset dir="src-generated" defaultexcludes="yes">
<include name="**/*"/>
<exclude name="test/*"/>
</fileset>-->
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html -->
<!--
<manifest>
<attribute name="description" value="Full set of 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}"/>
<section name="**/edu/nps/moves/**">
<attribute name="Sealed" value="true"/>
</section>
</manifest>
-->
</zip>
</target>
<target name="jar-pdus-javadoc" description="full set of javadoc"> <!-- avoid performing multiple times: depends="javadoc" -->
<echo message="(note that generated javadoc subdirectory is found within ${dist.dir} subdirectory)"/>
<delete file="${dist.dir}/opendis7-pdus-javadoc.jar"/>
<mkdir dir="${dist.dir}/javadoc"/>
<jar destfile="${dist.dir}/opendis7-pdus-javadoc.jar"
update="true"
zip64Mode="${zip64Mode}">
<fileset dir="${dist.javadoc.dir}" defaultexcludes="yes">
<include name="**/*"/>
<exclude name="edu/nps/moves/dis7/entities/**"/>
<exclude name="edu/nps/moves/dis7/enumerations/**"/>
<exclude name="edu/nps/moves/dis7/jammers/**"/>
<exclude name="edu/nps/moves/dis7/objectTypes/**"/>
</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}"/>
<section name="edu/nps/moves/**">
<attribute name="Sealed" value="true"/>
</section>
</manifest>
</jar>
</target>
<target name="jar-pdus-source">
<delete file="${dist.dir}/opendis7-pdus-source.jar"/>
<jar destfile="${dist.dir}/opendis7-pdus-source.jar"
update="true"
zip64Mode="${zip64Mode}">
<fileset dir="src" defaultexcludes="yes">
<include name="**/*.java"/>
<include name="**/*.md"/>
<include name="**/*.txt"/>
<!--<include name="**/*.dislog"/>-->
<exclude name="edu/nps/moves/dis7/utilities/logs/*"/>
</fileset>
<fileset dir="src-generated" defaultexcludes="yes">
<!-- omitting enumerations directories -->
<include name="edu/nps/moves/dis7/pdus/**"/>
</fileset>
<fileset dir="test" defaultexcludes="yes">
<include name="edu/nps/moves/dis7/test/**"/>
</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}"/>
<section name="edu/nps/moves/dis7">
<attribute name="Sealed" value="true"/>
</section>
</manifest>
</jar>
</target>
<target name="jar-full" depends="compile" description="merges all dis7 subpackage assets">
<delete file="${dist.dir}/opendis7-full.jar" verbose="false"/>
<!-- https://stackoverflow.com/questions/515428/clean-way-to-combine-multiple-jars-preferably-using-ant -->
<jar destfile="${dist.dir}/opendis7-full.jar"
update="true"
zip64Mode="${zip64Mode}">
<zipgroupfileset dir="${dist.dir}">
<!-- enumerations and pdus, classes/javadoc/source -->
<include name="opendis7-*.jar"/>
<!-- TODO consider whether these dependencies are strictly needed -->
<include name="../lib/commons-io-2.6.jar"/>
<include name="../lib/guava-28.0-jre.jar"/>
<include name="../lib/srm-4.4.0.jar"/>
<!--<exclude name="opendis7-source.jar"/> only about 30MB, keep it for debugging -->
<exclude name="opendis7-full.jar"/><!-- not self -->
</zipgroupfileset>
<zipgroupfileset dir="lib">
<include name="commons-io-2.6.jar"/>
<include name="guava-28.0-jre.jar"/>
<include name="srm-4.4.0.jar"/>
</zipgroupfileset>
<!-- https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html -->
<manifest>
<attribute name="description" value="Full set of assets 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}"/>
<section name="edu/nps/moves/dis7">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/spatial">
<attribute name="Sealed" value="true"/>
</section>
</manifest>
</jar>
</target>
<target name="jar-pdus-classes" depends="compile" description="merges all dis7 subpackage classes except for enumerations">
<delete file="${dist.jar}"/>
<jar destfile="${dist.jar}"
update="true"
zip64Mode="${zip64Mode}">
<fileset dir="build/classes" defaultexcludes="yes">
<include name="edu/nps/moves/dis7/examples/*"/>
<include name="edu/nps/moves/dis7/pdus/*"/>
<include name="edu/nps/moves/dis7/utilities/*"/>
<include name="edu/nps/moves/dis7/utilities/stream/*"/>
<include name="edu/nps/moves/legacy/math/*"/>
<include name="edu/nps/moves/spatial/*"/>
<exclude name="edu/nps/moves/dis7/entities/*"/>
<exclude name="edu/nps/moves/dis7/enumerations/*"/>
<exclude name="edu/nps/moves/dis7/jammers/*"/>
<exclude name="edu/nps/moves/dis7/objectTypes/*"/>
<exclude name="**/*.txt"/>
<exclude name="**/*.TXT"/>
<exclude name="**/*.*log"/>
</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}"/>
<section name="edu/nps/moves/dis7">
<attribute name="Sealed" value="true"/>
</section>
<section name="edu/nps/moves/spatial">
<attribute name="Sealed" value="true"/>
</section>
</manifest>
</jar>
</target>
<!-- special test harness for JUnit5 by Terry Norbraten -->
<!-- https://blogs.apache.org/netbeans/entry/junit-5-apache-ant-and -->
<target name="test"
depends="compile-test,-pre-test-run,clean.pduLog"
description="Run DisTime tests and all unit tests">
<java classpath="${run.classpath}"
classname="edu.nps.moves.dis7.utilities.DisTime"
fork="false" failonerror="true">
</java>
<!-- https://stackoverflow.com/questions/5113287/what-does-fork-true-do -->
<java classpath="${run.test.classpath}"
classname="org.junit.platform.console.ConsoleLauncher"
fork="true"
failonerror="false">
<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>
<echo message="Now produce junitreport:"/>
<junitreport todir="${build.test.results.dir}" >
<fileset dir="${build.test.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${build.test.results.dir}/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="false">
<arg value="--disable-banner"/>
<arg value="--fail-if-no-tests"/>
<arg line="-c=${test.class}"/>
<!--<arg value="-h"/>-->
</java>
<junitreport todir="${build.test.results.dir}">
<fileset dir="${build.test.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${build.test.results.dir}/html"/>
</junitreport>
<!--
<echo message="*** ant sleep 2 seconds..."/>
<sleep seconds="2" description="hoping to avoid intermittent test failures due to network timeout"/>
-->
</target>
<target depends="compile-test-single,-pre-test-run-single"
description="Debug single unit test."
name="-debug-start-debuggee-test">
<java classpath="${run.test.classpath}"
classname="org.junit.platform.console.ConsoleLauncher"
fork="false">
<arg value="--disable-banner"/>
<arg value="--fail-if-no-tests"/>
<arg line="-c=${test.class}"/>
<jvmarg value="-Xdebug" />
<jvmarg value="-Xnoagent" />
<jvmarg value="-Djava.compiler=NONE" />
<jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}" />
</java>
<junitreport todir="${build.test.results.dir}">
<fileset dir="${build.test.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${build.test.results.dir}/html"/>
</junitreport>
</target>
</project>