forked from AbFab3D/AbFab3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·974 lines (872 loc) · 38.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
<?xml version="1.0" standalone="yes"?>
<project basedir="." default="build" name="AbFab3D">
<import file="build_common.xml"/>
<description>AbFab3D Project</description>
<property name="version" value="1.0.0"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="apps.dir" value="${basedir}/apps"/>
<property name="release.dir" value="${basedir}/release"/>
<property name="test.dir" value="${basedir}/test/junit"/>
<property name="japex.dir" value="${basedir}/test/japex"/>
<property name="classes.dir" value="${basedir}/classes"/>
<property name="test.classes.dir" value="${classes.dir}/test"/>
<property name="japex.classes.dir" value="${classes.dir}/japex"/>
<property name="jar.dir" value="${basedir}/jars"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="manifest.dir" value="${basedir}/manifest"/>
<property name="javadocs.dir" value="${basedir}/docs/javadoc"/>
<property name="refguide.dir" value="${basedir}/docs/refguide"/>
<property name="xj3d.dir" value="..\..\..\xj3d\code\trunk"/>
<property name="av3d.dir" value="..\..\..\j3d.org\aviatrix3d-2\aviatrix3d"/>
<property name="shapeways.dir" value="../../../shapeways/git/3dtools/abfab3d/apps/gpu"/>
<property name="runarg0" value="-Xmx16000M"/>
<!-- <property name="runarg0" value="-Xmx7000M"/> -->
<!-- <property name="runarg0" value="-Xmx1200M -Xprof"/> -->
<!--
<property name="runarg1" value="-Dsun.java2d.noddraw=true"/>
<property name="runarg2" value="-Djava.library.path="./natives/${os.name}/${os.arch}"" />
-->
<property name="jvmrunargs" value="${runarg0}"/>
<property name="test.coverage.dir" value="${basedir}/tmp/coverage"/>
<!-- Emma code coverage properties -->
<property name="emma.dir" value="${basedir}/lib/support/emma"/>
<property name="emma.out.dir" value="${basedir}/emma"/>
<property name="emma.coverage.dir" location="${emma.out.dir}/coverage"/>
<property name="emma.instr.dir" location="${emma.out.dir}/instrumented"/>
<property name="env.JAPEX_HOME" value="lib/support/japex"/>
<path id="run.classpath">
<pathelement location="${classes.dir}"/>
</path>
<!-- path element used by EMMA taskdef below: -->
<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar"/>
<pathelement location="${emma.dir}/emma_ant.jar"/>
</path>
<!-- this loads <emma> and <emmajava> custom tasks: -->
<taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
<!-- End Emma code coverage properties -->
<!-- Cobertura code coverage properties -->
<property name="cobertura.dir" value="${basedir}/lib/support/cobertura"/>
<property name="cobertura.out.dir" value="${basedir}/cobertura"/>
<property name="cobertura.reports.dir" value="${cobertura.out.dir}/reports"/>
<property name="cobertura.reports.xml.dir" value="${cobertura.reports.dir}/junit-xml"/>
<property name="cobertura.reports.html.dir" value="${cobertura.reports.dir}/junit-html"/>
<property name="cobertura.instrumented.dir" value="${cobertura.out.dir}/instrumented"/>
<property name="cobertura.coverage.xml.dir" value="${cobertura.out.dir}/coverage/xml"/>
<property name="cobertura.coverage.summaryxml.dir" value="${cobertura.out.dir}/coverage/summaryxml"/>
<property name="cobertura.coverage.html.dir" value="${cobertura.out.dir}/coverage/html"/>
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
<include name="cobertura.jar"/>
<include name="lib/**/*.jar"/>
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
<!-- End Cobertura code coverage properties -->
<!-- jacoco code coverage properties -->
<property name="jacoco.dir" value="${basedir}/lib/support/jacoco"/>
<property name="jacoco.out.dir" value="${test.coverage.dir}/jacoco"/>
<property name="jacoco.reports.dir" value="${jacoco.out.dir}/jacoco"/>
<path id="jacoco.classpath">
<fileset dir="${jacoco.dir}">
<include name="jacocoant.jar"/>
<include name="lib/**/*.jar"/>
</fileset>
</path>
<!-- End jacoco code coverage properties -->
<target name="build"
description="Complete clean, setup, compilation, run"
depends="clean,init,compile,compileApps,jar"/>
<!-- Create destination directories -->
<target name="init" description="Create destination directories">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${javadocs.dir}"/>
<mkdir dir="${test.classes.dir}"/>
</target>
<target name="compile" depends="init" description="Compile all Java source files">
<compilejava package="abfab3d/core"
jars=""
/>
<compilejava package="abfab3d/util"
jars="gson-2.1.jar commons-io-2.6.jar commons-codec-1.7.jar commons-compress-1.9.jar xj3d-core_2.0.0.jar vecmath.jar xj3d.cadfilter_2.0.0.jar j3d-org-all_2.0.0.jar"
/>
<compilejava package="abfab3d/param"
jars=""
/>
<compilejava package="abfab3d/spatial"
jars=""
/>
<compilejava package="abfab3d/symmetry"
jars=""
/>
<compilejava package="abfab3d/opencl"
jars="jocl.jar commons-io-2.6.jar"
/>
<compilejava package="abfab3d/random"
jars=""
/>
<compilejava package="abfab3d/sample"
jars=""
/>
<compilejava package="abfab3d/geomutil"
jars=""
/>
<compilejava package="abfab3d/param/editor"
jars=""
/>
<compilejava package="abfab3d/transforms"
jars="jafama.jar vecmath.jar"
/>
<compilejava package="abfab3d/intersect"
jars=""
/>
<compilejava package="abfab3d/distance"
jars=""
/>
<compilejava package="abfab3d/path"
jars=""
/>
<compilejava package="abfab3d/grid"
jars=""
/>
<compilejava package="abfab3d/grid/util"
jars=""
/>
<compilejava package="abfab3d/grid/op"
jars="jafama.jar xj3d-core_2.0.0.jar xj3d-common_2.0.0.jar j3d-org-all_2.0.0.jar vecmath.jar batik-all-1.9.jar commons-io-2.6.jar js.jar"
/>
<compilejava package="abfab3d/grid/query"
jars=""
/>
<compilejava package="abfab3d/datasources"
jars="jafama.jar vecmath.jar core-renderer.jar js.jar"
/>
<compilejava package="abfab3d/mesh"
jars=""
/>
<compilejava package="abfab3d/geom"
jars=""
/>
<compilejava package="abfab3d/io/input"
jars="guava-18.0.jar commons-codec-1.7.jar commons-compress-1.9.jar vecmath.jar vlc.jar uri.jar xj3d-core_2.0.0.jar xj3d.cadfilter_2.0.0.jar j3d-org-all_2.0.0.jar commons-io-2.6.jar"
/>
<compilejava package="abfab3d/io/output"
jars="vecmath.jar toxiclibscore.jar volumeutils.jar vlc.jar uri.jar xj3d-core_2.0.0.jar xj3d.cadfilter_2.0.0.jar commons-io-2.6.jar"
/>
<compilejava package="abfab3d/io/cli"
jars="commons-io-2.6.jar xj3d-core_2.0.0.jar"
/>
<compilejava package="abfab3d/shapejs"
jars=""
/>
<compilejava package="abfab3d/io/soap"
jars=""
/>
<compilejava package="abfab3d/io/soap/transport"
jars=""/>
<compilejava package="abfab3d/io/soap/encoders"
jars=""/>
<compilejava package="abfab3d/io/soap/envelope"
jars=""/>
<compilejava package="shapeways/api"
jars=""/>
<compilejava package="shapeways/api/models"
jars=""/>
<compilejava package="shapeways/api/models/reservation"
jars=""/>
<compilejava package="shapeways/api/price"
jars=""/>
<compilejava package="abfab3d/io/shapeways"
jars="vecmath.jar xj3d-core_2.0.0.jar j3d-org-all_2.0.0.jar"
/>
<compilejava package="abfab3d/validate"
jars=""
/>
<!--
<compilejava package="abfab3d/creator"
jars=""
/>
<compilejava package="abfab3d/creator/util"
jars=""
/>
<compilejava package="abfab3d/creator/shapeways"
jars=""
/>
<compilejava package="abfab3d/creator/ui"
jars=""
/>
-->
</target>
<target name="compileApps" depends="init" description="Compile all applications">
<echo message="Compiling Common Apps"/>
<ant dir="apps/common" inheritAll="false"/>
<echo message="Compiling ShapeJS"/>
<ant dir="apps/shapejs_cmd" inheritAll="false"/>
</target>
<target name="run" depends="compile" description="Run the application">
<echo message="jvmargs: ${jvmrunargs}"/>
<java classname="${entrypoint}" fork="true">
<jvmarg line="${jvmrunargs}"/>
<classpath>
<pathelement path="${classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes=""/>
<!-- <fileset dir="natives/${os.name}/${os.arch}" includes="**/*.jar" /> -->
</classpath>
</java>
</target>
<target name="javadoc" description="Generates javadoc" depends="compile">
<echo message="Generating javadoc..."/>
<javadoc sourcepath="${src.dir}/java"
destdir="${javadocs.dir}"
packagenames="*"
version="true"
author="yes">
</javadoc>
</target>
<target name="makeRef" description="Generates VolumeSculptor Reference Guide" depends="compile">
<echo message="Generating reference guide..."/>
<mkdir dir="${classes.dir}/build"/>
<compilejava srcdir="src/build/java" package="doclet" destdir="${classes.dir}/build"
jars=""
/>
<!-- TODO: remove index* -->
<javadoc sourcepath=""
destdir="${refguide.dir}"
version="true"
author="yes">
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="java/abfab3d/datasources/TransformableDataSource.java"/>
<include name="java/abfab3d/datasources/Abs.java"/>
<include name="java/abfab3d/datasources/Add.java"/>
<include name="java/abfab3d/datasources/Box.java"/>
<include name="java/abfab3d/datasources/Complement.java"/>
<include name="java/abfab3d/datasources/Constant.java"/>
<include name="java/abfab3d/datasources/Cone.java"/>
<include name="java/abfab3d/datasources/Cylinder.java"/>
<include name="java/abfab3d/datasources/DataSourceGrid.java"/>
<include name="java/abfab3d/datasources/DataTransformer.java"/>
<include name="java/abfab3d/datasources/Embossing.java"/>
<include name="java/abfab3d/datasources/Image3D.java"/>
<include name="java/abfab3d/datasources/ImageMap.java"/>
<include name="java/abfab3d/datasources/Intersection.java"/>
<include name="java/abfab3d/datasources/Mad.java"/>
<include name="java/abfab3d/datasources/Mask.java"/>
<include name="java/abfab3d/datasources/Max.java"/>
<include name="java/abfab3d/datasources/Min.java"/>
<include name="java/abfab3d/datasources/Mix.java"/>
<include name="java/abfab3d/datasources/Mul.java"/>
<include name="java/abfab3d/datasources/Plane.java"/>
<!-- <include name="java/abfab3d/datasources/Ring.java" /> -->
<include name="java/abfab3d/datasources/Sphere.java"/>
<include name="java/abfab3d/datasources/Sub.java"/>
<include name="java/abfab3d/datasources/Subtraction.java"/>
<include name="java/abfab3d/datasources/Text.java"/>
<include name="java/abfab3d/datasources/Text2D.java"/>
<include name="java/abfab3d/datasources/Torus.java"/>
<include name="java/abfab3d/datasources/Union.java"/>
<include name="java/abfab3d/datasources/VolumePatterns.java"/>
<include name="java/abfab3d/transforms/CompositeTransform.java"/>
<include name="java/abfab3d/transforms/FriezeSymmetry.java"/>
<include name="java/abfab3d/transforms/ReflectionSymmetry.java"/>
<include name="java/abfab3d/transforms/WallpaperSymmetry.java"/>
<include name="java/abfab3d/transforms/PlaneReflection.java"/>
<include name="java/abfab3d/transforms/SphereInversion.java"/>
<include name="java/abfab3d/transforms/CompositeTransform.java"/>
<include name="java/abfab3d/transforms/Scale.java"/>
<include name="java/abfab3d/transforms/Translation.java"/>
<include name="java/abfab3d/transforms/Rotation.java"/>
<include name="java/abfab3d/transforms/RingWrap.java"/>
<include name="java/abfab3d/transforms/PeriodicWrap.java"/>
</fileset>
<doclet name="doclet.RefGuideDoclet" path="${classes.dir}/build;${lib.dir}/commons-io-2.6.jar">
<param name="-generateParts" value="true"/>
</doclet>
<!-- Copy items from Javadoc to refguide directory for easy packaging -->
</javadoc>
<javadoc sourcepath=""
destdir="${refguide.dir}"
version="true"
author="yes">
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="java/abfab3d/datasources/TransformableDataSource.java"/>
<include name="java/abfab3d/datasources/Abs.java"/>
<include name="java/abfab3d/datasources/Add.java"/>
<include name="java/abfab3d/datasources/Box.java"/>
<include name="java/abfab3d/datasources/Complement.java"/>
<include name="java/abfab3d/datasources/Constant.java"/>
<include name="java/abfab3d/datasources/Cone.java"/>
<include name="java/abfab3d/datasources/Cylinder.java"/>
<include name="java/abfab3d/datasources/DataSourceGrid.java"/>
<include name="java/abfab3d/datasources/DataTransformer.java"/>
<include name="java/abfab3d/datasources/Embossing.java"/>
<include name="java/abfab3d/datasources/Image3D.java"/>
<include name="java/abfab3d/datasources/ImageMap.java"/>
<include name="java/abfab3d/datasources/Intersection.java"/>
<include name="java/abfab3d/datasources/Mad.java"/>
<include name="java/abfab3d/datasources/Mask.java"/>
<include name="java/abfab3d/datasources/Max.java"/>
<include name="java/abfab3d/datasources/Min.java"/>
<include name="java/abfab3d/datasources/Mix.java"/>
<include name="java/abfab3d/datasources/Mul.java"/>
<include name="java/abfab3d/datasources/Plane.java"/>
<include name="java/abfab3d/datasources/Sphere.java"/>
<include name="java/abfab3d/datasources/Sub.java"/>
<include name="java/abfab3d/datasources/Subtraction.java"/>
<include name="java/abfab3d/datasources/Text.java"/>
<include name="java/abfab3d/datasources/Text2D.java"/>
<include name="java/abfab3d/datasources/Torus.java"/>
<include name="java/abfab3d/datasources/Union.java"/>
<include name="java/abfab3d/datasources/VolumePatterns.java"/>
<include name="java/abfab3d/transforms/CompositeTransform.java"/>
<include name="java/abfab3d/transforms/FriezeSymmetry.java"/>
<include name="java/abfab3d/transforms/ReflectionSymmetry.java"/>
<include name="java/abfab3d/transforms/WallpaperSymmetry.java"/>
<include name="java/abfab3d/transforms/PlaneReflection.java"/>
<include name="java/abfab3d/transforms/SphereInversion.java"/>
<include name="java/abfab3d/transforms/CompositeTransform.java"/>
<include name="java/abfab3d/transforms/Scale.java"/>
<include name="java/abfab3d/transforms/Translation.java"/>
<include name="java/abfab3d/transforms/Rotation.java"/>
<include name="java/abfab3d/transforms/RingWrap.java"/>
<include name="java/abfab3d/transforms/PeriodicWrap.java"/>
</fileset>
<doclet name="doclet.RefGuideDoclet" path="${classes.dir}/build;${lib.dir}/commons-io-2.6.jar">
<param name="-generateParts" value="false"/>
</doclet>
</javadoc>
</target>
<target name="jar" depends="compile">
<createjar name="abfab3d_core"
version="${version}"
manifest="abfab3d_core.mf"
includes="
abfab3d/core/*
abfab3d/math/*
abfab3d/symmetry/*
abfab3d/transforms/*
abfab3d/datasources/*
abfab3d/geom/*
abfab3d/grid/*
abfab3d/grid/maker/*
abfab3d/grid/query/*
abfab3d/grid/op/*
abfab3d/grid/util/*
abfab3d/intersect/*
abfab3d/distance/*
abfab3d/mesh/*
abfab3d/shapejs/*
abfab3d/io/input/*
abfab3d/io/output/*
abfab3d/io/cli/*
abfab3d/opencl/*
abfab3d/path/*
abfab3d/util/*
abfab3d/random/*
abfab3d/sample/*
abfab3d/param/*
abfab3d/param/editor/*
abfab3d/geomutil/*
abfab3d/spatial/*
"
/>
<createjar name="abfab3d_upload"
version="${version}"
manifest="abfab3d_upload.mf"
includes="abfab3d/io/soap/*
abfab3d/io/soap/transport/*
abfab3d/io/soap/encoders/*
abfab3d/io/soap/envelope/*
abfab3d/io/shapeways/*
abfab3d/transform/*
abfab3d/util/*
abfab3d/geomutil/*
"
/>
<createjar name="abfab3d_creator"
version="${version}"
manifest="abfab3d_creator.mf"
includes="abfab3d/creator/*
abfab3d/creator/ui/*
abfab3d/creator/util/*
abfab3d/creator/geomutil/*
abfab3d/creator/shapeways/*
"
/>
<createjar name="abfab3d_creator_server"
version="${version}"
manifest="abfab3d_creator.mf"
includes="abfab3d/creator/*
abfab3d/creator/ui/*
abfab3d/creator/util/*
abfab3d/creator/geomutil/*
abfab3d/creator/shapeways/*
"
excludes="abfab3d/creator/shapeways/HostedKernel.class"
/>
<createjar name="abfab3d_shapeways_api"
version="${version}"
manifest="abfab3d_shapeways_api.mf"
includes="shapeways/api/*
shapeways/api/models/*
shapeways/api/models/reservation/*
shapeways/api/price/*
"
/>
</target>
<!-- Normal test without any code coverage -->
<target name="test" depends="compileTest">
<junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="yes" showoutput="true">
<jvmarg line="${jvmrunargs}"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes">
<fileset dir="${test.dir}">
<include name="**/Test*.java"/>
<exclude name="**/*Performance*.java"/>
<exclude name="**/*Suite*.java"/>
<!-- Non working ones -->
<!-- <exclude name="**/TestTriangleModelCreator.java"/> -->
<exclude name="**/TestCanMoveMaterialTargetedBoundsMT.java"/>
<!--
<exclude name="**/TestParametricSurfaceMaker.java" />
<exclude name="**/TestTriangulatedModels.java" />
-->
<exclude name="**/TestRegionFinder.java"/>
<!-- <exclude name="**/TestDilationShapeMT.java" /> -->
<exclude name="**/TestShellFinder.java"/>
</fileset>
</batchtest>
<classpath>
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</classpath>
</junit>
</target>
<!-- Begin Emma code coverage tasks -->
<!-- Call: ant emma runEmma -->
<target name="emma">
<property name="emma.enabled" value="true"/>
<mkdir dir="${emma.coverage.dir}"/>
<!-- EMMA instr class output directory (it is important to create
this property only when EMMA is enabled:
-->
<property name="out.emma.instr.dir" value="${emma.instr.dir}"/>
<mkdir dir="${out.emma.instr.dir}"/>
<!-- this property, if overriden via -Demma.filter=<list of filter specs>
on ANT's command line, will set the coverage filter; by default,
all classes found in 'run.classpath' pathref will be instrumented:
-->
<property name="emma.filter" value=""/>
</target>
<target name="runEmma" depends="compileTest">
<emma enabled="${emma.enabled}">
<instr instrpathref="run.classpath"
destdir="${out.emma.instr.dir}"
metadatafile="${emma.coverage.dir}/metadata.emma"
merge="true"
>
<!-- always exclude every class with a "Test" in the name -->
<filter excludes="*Test*"/>
<!-- note that coverage filters can be set through nested <filter>
elements as well: many of EMMA setting are 'mergeable' in the
sense that they can be specified multiple times and the result
is a union of all such values. Here we are not merging several
filters together but merely demonstrating that it is possible:
-->
<filter value="${emma.filter}"/>
</instr>
</emma>
<junit printsummary="yes" haltonerror="no" haltonfailure="yes" fork="yes" showoutput="true">
<jvmarg line="${jvmrunargs}"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes">
<fileset dir="${test.dir}">
<!-- <include name="**/*Test.java"/> -->
<!--
<include name="**/Test*Suite.java"/>
<exclude name="**/Test*PerformanceSuite.java"/>
-->
<include name="**/Test*.java"/>
<exclude name="**/*Performance*.java"/>
<exclude name="**/*Suite*.java"/>
<!-- Non working ones -->
<exclude name="**/TestTriangleModelCreator.java"/>
<exclude name="**/TestCanMoveMaterialTargetedBoundsMT.java"/>
<exclude name="**/TestRegionFinder.java"/>
<!-- <exclude name="**/TestDilationShapeMT.java" /> -->
<exclude name="**/TestShellFinder.java"/>
</fileset>
</batchtest>
<classpath>
<!-- instrumented classes must be first in the classpath: -->
<pathelement location="${out.emma.instr.dir}"/>
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<!-- the forked JVM must have jact.jar in the classpath: -->
<path refid="emma.lib"/>
</classpath>
<!-- to be certain, tell EMMA runtime where to dump the runtime
coverage data (otherwise the filename is relative to the JVM's
current directory and it is easy to get confused about what
that is):
-->
<jvmarg value="-Demma.coverage.out.file=${emma.coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
</junit>
<!-- if enabled, generate coverage report(s): -->
<emma enabled="${emma.enabled}">
<report sourcepath="${src.dir}/java"
sort="+block,+name,+method,+class"
metrics="method:70,block:80,line:80,class:100"
>
<!-- collect all EMMA data dumps (metadata and runtime)
[this can be done via nested <fileset> fileset elements
or <file> elements pointing to a single file]:
-->
<fileset dir="${emma.coverage.dir}">
<include name="*.emma"/>
</fileset>
<!-- for every type of report desired, configure a nested
element; various report parameters
can be inherited from the parent <report>
and individually overridden for each report type:
-->
<txt outfile="${emma.coverage.dir}/coverage.txt"
depth="package"
columns="class,method,block,line,name"
/>
<xml outfile="${emma.coverage.dir}/coverage.xml"
depth="package"
/>
<html outfile="${emma.coverage.dir}/coverage.html"
depth="method"
columns="name,class,method,block,line"
/>
</report>
</emma>
</target>
<!-- Begin Cobertura code coverage tasks -->
<!-- Call: ant runCobertura -->
<target name="-cobertura">
<mkdir dir="${cobertura.instrumented.dir}"/>
<mkdir dir="${cobertura.reports.xml.dir}"/>
<mkdir dir="${cobertura.reports.html.dir}"/>
<mkdir dir="${cobertura.coverage.xml.dir}"/>
<mkdir dir="${cobertura.coverage.summaryxml.dir}"/>
<mkdir dir="${cobertura.coverage.html.dir}"/>
</target>
<target name="-coberturaInstr">
<!-- Remove the coverage data file and any old instrumentation. -->
<delete file="cobertura.ser"/>
<delete dir="${cobertura.instrumented.dir}"/>
<!--
Instrument the application classes, writing the
instrumented classes into ${build.cobertura.instrumented.dir}.
-->
<cobertura-instrument todir="${cobertura.instrumented.dir}">
<!--
The following line causes instrument to ignore any
source line containing a reference to log4j, for the
purposes of coverage reporting.
-->
<ignore regex="org.apache.log4j.*"/>
<fileset dir="${classes.dir}">
<!--
Instrument all the application classes, but
don't instrument the test classes.
-->
<include name="**/*.class"/>
<exclude name="**/*Test.class"/>
<exclude name="**/Test*.class"/>
</fileset>
</cobertura-instrument>
</target>
<target name="runCobertura" depends="compileTest">
<antcall target="-cobertura"/>
<antcall target="-coberturaInstr"/>
<junit printsummary="yes" haltonerror="no" haltonfailure="yes" fork="yes" showoutput="true">
<jvmarg line="${jvmrunargs}"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="${cobertura.reports.xml.dir}">
<fileset dir="${test.dir}">
<!-- <include name="**/*Test.java"/> -->
<include name="**/Test*Suite.java"/>
</fileset>
</batchtest>
<classpath>
<pathelement path="${cobertura.instrumented.dir}"/>
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</classpath>
<classpath refid="cobertura.classpath"/>
</junit>
<junitreport todir="${cobertura.reports.xml.dir}">
<fileset dir="${cobertura.reports.xml.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${cobertura.reports.html.dir}"/>
</junitreport>
<antcall target="-coverage"/>
</target>
<target name="coverage-check">
<cobertura-check branchrate="34" totallinerate="100"/>
</target>
<target name="-coverage">
<!--
Generate a series of HTML files containing the coverage
data in a user-readable form using nested source filesets.
-->
<cobertura-report destdir="${cobertura.coverage.html.dir}">
<fileset dir="${src.dir}/java">
<include name="**/*.java"/>
</fileset>
</cobertura-report>
</target>
<target name="-xmlCoverage">
<!--
Generate an XML file containing the coverage data using
the "srcdir" attribute.
-->
<cobertura-report srcdir="${src.dir}" destdir="${cobertura.coverage.xml.dir}" format="xml"/>
</target>
<target name="-xmlSummaryCoverage">
<!--
Generate an summary XML file containing the coverage data using
the "srcdir" attribute.
-->
<cobertura-report srcdir="${src.dir}" destdir="${cobertura.coverage.summaryxml.dir}" format="summaryXml"/>
</target>
<!-- End code coverage tasks -->
<!-- Begin Jacoco code coverage tasks -->
<target name="jacoco" depends="compileTest">
<mkdir dir="${jacoco.reports.dir}"/>
<!-- Import the JaCoCo Ant Task -->
<taskdef uri="org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath>
<path refid="jacoco.classpath"/>
</classpath>
</taskdef>
<!-- Run your unit tests, adding the JaCoCo agent -->
<jacoco:coverage destfile="${test.coverage.dir}/jacoco.exec" xmlns:jacoco="org.jacoco.ant">
<junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="yes" showoutput="true">
<jvmarg line="${jvmrunargs}"/>
<classpath>
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="support/japex/*.jar"/>
</classpath>
<classpath refid="jacoco.classpath"/>
<formatter type="xml"/>
<batchtest todir="${jacoco.reports.dir}">
<fileset dir="${test.dir}">
<include name="**/Test*.java"/>
<exclude name="**/*Performance*.java"/>
<exclude name="**/*Suite*.java"/>
<!-- Non working ones -->
<!-- <exclude name="**/TestTriangleModelCreator.java"/> -->
<exclude name="**/TestCanMoveMaterialTargetedBoundsMT.java"/>
<!--
<exclude name="**/TestParametricSurfaceMaker.java" />
<exclude name="**/TestTriangulatedModels.java" />
-->
<exclude name="**/TestRegionFinder.java"/>
<!-- <exclude name="**/TestDilationShapeMT.java" /> -->
<exclude name="**/TestShellFinder.java"/>
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
<jacoco:report xmlns:jacoco="org.jacoco.ant">
<executiondata>
<file file="${test.coverage.dir}/jacoco.exec"/>
</executiondata>
<structure name="Jacoco">
<classfiles>
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<!-- Exclude classes necessary for testing only from the code coverage report-->
<exclude name="test/**/*.class"/>
<!-- Exclude inner classes -->
<exclude name="**/*$*.class"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src.dir}/java"/>
</sourcefiles>
</structure>
<html destdir="${jacoco.out.dir}"/>
</jacoco:report>
</target>
<!-- End Jacoco code coverage tasks -->
<target name="compileTest" depends="init" description="Compile all Test source files">
<mkdir dir="${test.classes.dir}"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/opencl" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/random" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/param" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/param/editor" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/path" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/grid" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/grid/util" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/grid/op" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/grid/query" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/io/output" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/io/input" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/io/cli" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/util" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/symmetry" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/random" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/geomutil" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/geom" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/datasources" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/transforms" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/mesh" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/shapejs" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/core" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="abfab3d/intersect" jars="**/*.jar"/>
<compilejava destdir="${test.classes.dir}" srcdir="${test.dir}" package="" jars="**/*.jar"/>
</target>
<target name="testSpecific" depends="compile,compileTest">
<echo message="running testSpecific ${test} jvmargs: ${jvmrunargs}"/>
<junit printsummary="yes" haltonerror="no" haltonfailure="yes" fork="yes" showoutput="yes">
<jvmarg line="${jvmrunargs}"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes">
<fileset dir="${test.dir}">
<include name="**/${test}.java"/>
</fileset>
</batchtest>
<classpath>
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</classpath>
</junit>
</target>
<target name="runMain" depends="compile,compileTest" description="Run the application">
<echo message="jvmargs: ${jvmrunargs}"/>
<java classname="${class}" fork="true">
<jvmarg line="${jvmrunargs}"/>
<classpath>
<pathelement path="${classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes=""/>
<pathelement path="${test.classes.dir}"/>
<!-- <fileset dir="natives/${os.name}/${os.arch}" includes="**/*.jar" /> -->
</classpath>
</java>
</target>
<target name="runEditors" depends="compile" description="Run the editors">
<echo message="jvmargs: ${jvmrunargs}"/>
<java classname="abfab3d.param.editor.DevTestEditors" fork="true">
<jvmarg line="${jvmrunargs}"/>
<classpath>
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes=""/>
</classpath>
</java>
</target>
<!-- Begin Japex Tasks -->
<target name="runJapex" depends="compile,compileJapex">
<java dir="." fork="true" classname="com.sun.japex.Japex">
<classpath>
<pathelement path="${classes.dir}"/>
<pathelement path="${japex.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</classpath>
<arg line="test/japex/speed-config.xml"/>
<jvmarg value="-Xmx4000M"/>
</java>
</target>
<target name="runJapexMemory" depends="compile,compileJapex">
<java dir="." fork="true" classname="com.sun.japex.Japex">
<classpath>
<pathelement path="${classes.dir}"/>
<pathelement path="${japex.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</classpath>
<arg line="test/japex/memory-config.xml"/>
<jvmarg value="-Xmx5000M"/>
</java>
</target>
<target name="compileJapex" depends="init" description="Compile all Japex source files">
<mkdir dir="${japex.classes.dir}"/>
<compilejava destdir="${japex.classes.dir}" srcdir="${japex.dir}" package="abfab3d/grid"
jars="j3d-org-all_2.0.0.jar support/japex/*.jar"/>
</target>
<!-- End Japex Tests -->
<target name="clean" description="Deletes all the generated artifacts.">
<delete dir="${jar.dir}"/>
<delete dir="${javadocs.dir}"/>
<delete dir="${classes.dir}"/>
<delete dir="${emma.out.dir}"/>
<delete dir="${cobertura.out.dir}"/>
</target>
<target name="updateXj3D">
<copy todir="${lib.dir}" includeEmptyDirs="false">
<fileset dir="${xj3d.dir}/jars" excludes="org.* xj3d-all*.jar xj3d-imm*.jar xj3d-int*.jar">
<depth max="0"/>
</fileset>
</copy>
</target>
<target name="updateShapeways">
<copy todir="apps/shapeways_licensed/lib" includeEmptyDirs="false">
<fileset dir="${shapeways.dir}/jars" excludes="">
<depth max="0"/>
</fileset>
</copy>
</target>
<target name="stageSource">
<tstamp>
<format property="DATE" pattern="yyyy-MM-dd" locale="en,US"/>
</tstamp>
<tar destfile="release/abfab3d_source_${version}_${DATE}.tar.gz" compression="gzip" basedir="${basedir}"
includes="**" excludes="release/** **/*.war **/wttest/*"/>
</target>
<target name="stageApps">
<tstamp>
<format property="DATE" pattern="yyyy-MM-dd" locale="en,US"/>
</tstamp>
<tar destfile="release/abfab3d_source_${version}_${DATE}.tar.gz" compression="gzip" basedir="${basedir}"
includes="**" excludes="release/**"/>
</target>
<target name="stageLib">
<tstamp>
<format property="DATE" pattern="yyyy-MM-dd" locale="en,US"/>
</tstamp>
<mkdir dir="${release.dir}/bin"/>
<copy todir="${release.dir}/bin">
<fileset dir="${jar.dir}" includes="**.jar"/>
<fileset dir="${lib.dir}" includes="**.jar"/>
</copy>
<tar destfile="release/abfab3d_lib_${version}_${DATE}.tar.gz" compression="gzip" basedir="${release.dir}/bin"
includes="**"/>
</target>
<target name="release" depends="build">
<tstamp>
<format property="DATE" pattern="yyyy-MM-dd" locale="en,US"/>
</tstamp>
<delete dir="${release.dir}" failonerror="false"/>
<mkdir dir="${release.dir}"/>
<ant target="stageLib"/>
<ant target="stageSource"/>
</target>
<target name="runSpeed" depends="" description="Run the application">
<java classname="abfab3d.grid.TestMultiThreaded" fork="true">
<jvmarg line="${jvmrunargs}"/>
<classpath>
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes=""/>
</classpath>
</java>
</target>
<target name="kernels">
<!-- <delete dir="/tmp/openCL_cache" /> -->
<copy todir="${classes.dir}">
<fileset dir="${src.dir}/opencl"/>
</copy>
</target>
</project>