-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
986 lines (858 loc) · 40.5 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
<?xml version="1.0" encoding="utf-8"?>
<!-- <!DOCTYPE project PUBLIC "-//ANT//DTD project//EN" "project.dtd"> -->
<!-- Note that "project.dtd" will be generated by the first call to ant -->
<!-- Hence, if the dtd does not yet exist, removing the doctype temporarily -->
<!-- will fix the problem -->
<!-- $Id$ -->
<!-- This file is an ANT build script. ANT is a Java based build tool. -->
<!-- It is availale from http://jakarta.apache.org/ant/ -->
<project name="Orbital" default="compile" basedir=".">
<description>
Build file for building Orbital library Project.
This script should be started with the following command line :
ant [target]
Run "ant -projecthelp" to get a list of available targets.
The default target is "compile".
Requirements:
In order to build all parts of the Orbital library, examples, tests
and additional files, you need the following software.
Dependencies:
Full compilation and testing of this project requires:
JDK 1.4+ from http://java.sun.com/
Ant from http://jakarta.apache.org/ant/
JavaCC from https://javacc.dev.java.net/
junit.jar from http://www.junit.org/
Optional:
Mathematica and JLink from http://wolfram.com/
JDepend from http://www.clarkware.com/software/JDepend.html
Checkstyle from http://checkstyle.sourceforge.net/
</description>
<property name="build.compiler" value="modern"/>
<property name="build.sysclasspath" value="last"/>
<target name="init">
<antstructure output="project.dtd"/>
<property name="version" value="1.3.0"/>
<property name="version_brief" value="1.3"/>
<tstamp>
<format property="timestamp" pattern="dd MMM yyyy" locale="en,uk"/>
<format property="VERSION_DATE" pattern="MMMMM d'th,' yyyy" locale="en,uk"/>
<format property="TODAY" pattern="MM/dd/yyyy" locale="en,uk"/>
</tstamp>
<!-- distribution information -->
<property name="ftp.target" value=""/>
<property name="ftp.user" value=""/>
<property name="ftp.dir" value=""/>
<!-- basedir will be set to parent directory of this file -->
<!-- source directories -->
<property name="lib" value="${basedir}/lib"/>
<property name="resources" value="${basedir}/resources"/>
<property name="sources" value="${basedir}/src"/>
<property name="sources.tests" value="${basedir}/test"/>
<property name="examples" value="${basedir}/examples"/>
<property name="doc" value="${basedir}/doc"/>
<!-- destination directories -->
<property name="sources.generics" value="${basedir}/src-gen"/>
<property name="classes" value="${basedir}/classes"/>
<property name="dist" value="${basedir}/dist"/>
<property name="bin" value="${basedir}/bin"/>
<property name="taglet" value="${lib}/build"/>
<property name="doc.dest" value="${dist}/doc"/>
<property name="doc.api.dest" value="${doc.dest}/api"/>
<property name="build.tests" value="${basedir}/test"/>
<property name="reports" value="${basedir}/report"/>
<property name="reports.tests" value="${reports}/test"/>
<property name="reports.style" value="${reports}"/>
<property name="reports.jdepend" value="${reports}"/>
<property name="build.coverage" value="${basedir}/test/coverage"/>
<property name="reports.coverage" value="${reports}/coverage"/>
<available property="checkstyle.present" resource="checkstyletask.properties"/>
<!-- allow user to override the following attributes without editing this
file, by creating a file 'build.properties'
User cannot override properties above, but only the properties below.
-->
<property file="build.properties"/>
<!-- default value, may be overwritten by 'build.properties',
has to be relative to basedir! -->
<!-- default values, may be overwritten by 'build.properties' -->
<property name="javadoc.link.jdk" value="http://java.sun.com/javase/6/docs/api/"/>
<property name="javadoc.link.jdk.offline" value="false"/>
<property name="env.javacchome" value="/usr/share/java"/>
<property name="javac.source" value="1.4"/>
<property name="run.tests.jvmarg" value="-ea"/>
<property name="lib.jcoverage" value="${lib}"/>
<property name="lib.checkstyle" value="${lib}"/>
<property name="lib.jdepend" value="${lib}"/>
<!-- the Mathematica kernel binary -->
<property name="com.wolfram.jlink.kernel" value="math -mathlink"/>
<!-- the Mathematica jlink.jar file -->
<property name="com.wolfram.jlink.jar" value="JLink.jar"/>
<!-- the Mathematica jlink.jar file -->
<property name="junit.framework.jar" value="junit.jar"/>
<mkdir dir="${lib}"/>
<!-- reusable classpaths -->
<path id="project.classpath">
<pathelement location="${classes}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<pathelement location="${resources}"/>
</path>
<path id="tests.classpath">
<pathelement location="${examples}/Algorithms"/>
<pathelement location="${examples}/math"/>
<pathelement location="${examples}/SChess"/>
<pathelement path="${build.tests}" />
<pathelement location="${com.wolfram.jlink.jar}"/>
<pathelement location="${junit.framework.jar}"/>
<!-- refid="project.classpath" -->
<pathelement location="${classes}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<pathelement location="${resources}"/>
<pathelement path="${java.class.path}" />
</path>
<path id="jcoverage">
<fileset dir="${lib.jcoverage}">
<include name="jcoverage.jar"/>
</fileset>
</path>
<path id="checkstyle">
<fileset dir="${lib.checkstyle}">
<include name="*.jar"/>
</fileset>
</path>
<taskdef classpathref="jcoverage" resource="tasks.properties"/>
<condition property="signe.isUpToDate">
<and>
<uptodate srcfile="${sources}/orbital/signe.java"
targetfile="${classes}/orbital/signe.class"/>
<uptodate srcfile="build.xml"
targetfile="${classes}/orbital/signe.class"/>
</and>
</condition>
</target>
<!-- fix urls
<target name="fetch-libs" depends="init" >
<extension id="ext.lib.junit" extensionName="junit.jar" />
<jarlib-resolve property="lib.junit">
<extension refid="ext.lib.junit"/>
<location location="${lib}/junit.jar"/>
<url url="http://superb-east.dl.sourceforge.net/sourceforge/junit/junit-4.5.jar"
destfile="${lib}/junit.jar"/>
</jarlib-resolve>
<extension id="ext.lib.jlink"
extensionName="com.wolfram.jlink"
specificationVersion="3.1"
specificationVendor="Wolfram Research, Inc."/>
<jarlib-resolve property="lib.jlink">
<extension refid="ext.lib.jlink"/>
<location location="${com.wolfram.jlink.jar}"/>
<url url=""
destfile="${lib}/jlink.jar"/>
</jarlib-resolve>
</target>
-->
<target name="prepareEnvironment" depends="init"
description="prepare system for compiling">
<javac srcdir="${taglet}"
destdir="${taglet}"
debug="yes"
source="${javac.source}">
</javac>
</target>
<target name="all" depends="init, clean, fixCRLF, compile, doc, compile.tests"
description="clean + fixCRLF + compile.* + doc">
</target>
<!-- compilation -->
<target name="compile" depends="init, parser, stamp"
description="compile *.java (=> ./classes)">
<mkdir dir="${classes}"/>
<!-- @todo on parameter, use GetRidOfAssert.sed instead of source="1.4" -->
<javac srcdir="${sources}"
destdir="${classes}"
debug="yes"
source="${javac.source}"
excludes="orbital/moon/aspects/**,orbital/moon/deprecated/*,orbital/*">
<classpath refid="project.classpath"/>
</javac>
<!-- cleanup temporary files from stamp -->
<delete dir="${sources}/transmogrify" failonerror="false"/>
</target>
<!-- @todo stamp and parser as well -->
<target name="compile.generics" depends="init"
description="compile enabling generics *.java (=> ./classes)">
<mkdir dir="${classes}"/>
<mkdir dir="${sources.generics}"/>
<copy todir="${sources.generics}">
<fileset dir="${sources}"/>
<!-- incarnate generics -->
<filterchain>
<tokenfilter>
<replaceregex pattern="/\*<" replace="<" flags="g"/>
<replaceregex pattern=">\*/" replace=">" flags="g"/>
<!-- replace Object/*>A<*/ by A -->
<replaceregex pattern="([a-zA-Z.]+)/\*\>([a-zA-Z0-9<,>.]+)\<\*/" replace="\2" flags="g"/>
</tokenfilter>
</filterchain>
</copy>
<javac srcdir="${sources.generics}"
destdir="${classes}"
debug="yes"
source="1.5"
nowarn="yes"
excludes="orbital/moon/aspects/**,orbital/moon/deprecated/*,orbital/*">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="parser" depends="init"
description="compile *.jj (=> ./classes)">
<javacc target="${sources}/orbital/moon/logic/LogicParser.jj"
javacchome="${env.javacchome}"/>
</target>
<target name="stamp" depends="init" unless="signe.isUpToDate"
description="prepare files for compile">
<mkdir dir="${sources}/transmogrify"/>
<!-- @internal due to signe.isUpToDate predication, buildnumber -->
<!-- will only increase during clean compilation/jar/dist etc. -->
<buildnumber/>
<exec executable="svnversion" outputproperty="revision" failifexecutionfails="false"/>
<!-- introduce version information -->
<copy file="${sources}/orbital/signe.java" todir="${sources}/transmogrify"/>
<replace file="${sources}/transmogrify/signe.java"
propertyfile="${basedir}/build.number">
<replacefilter token="@VERSION@" value="${version}"/>
<replacefilter token="@REVISION@" value="${revision}"/>
<replacefilter token="@BUILD@" property="build.number"/>
</replace>
</target>
<target name="compile.tests" depends="init, compile.examples"
description="compile test/*.java (=> ./classes)">
<javac srcdir="${sources.tests}"
destdir="${build.tests}"
debug="yes"
source="${javac.source}">
<classpath refid="tests.classpath"/>
</javac>
</target>
<target name="compile.examples" depends="init, compile"
description="compile examples/*.java (=> ./classes)">
<javac srcdir="${examples}"
debug="yes"
source="${javac.source}"
excludes="SimpleDemos/SpecDemo.java">
<classpath refid="tests.classpath"/>
</javac>
</target>
<!-- dynamic code quality testing -->
<target name="run.tests.internal" depends="init, compile.tests"
description="run test/*Test*.java">
<echo>
With assertions turned on, this test suite runs about 7 hours. (or 1 hour without ModalLogicTest?)
With assertions turned off, this test suite runs about 30 min
(but only without orbital.moon.logic.ModalLogicTest).
Assertions are set to "${run.tests.jvmarg}"
</echo>
<mkdir dir="${reports.tests}"/>
<junit printsummary="yes" haltonfailure="yes" fork="yes" showoutput="true">
<classpath location="${run.tests.classpath}"/>
<classpath refid="jcoverage"/>
<classpath refid="tests.classpath"/>
<jvmarg value="${run.tests.jvmarg}"/>
<sysproperty key="com.wolfram.jlink.kernel" value="${com.wolfram.jlink.kernel}"/>
<formatter type="plain" />
<formatter type="xml" />
<batchtest fork="yes" haltonfailure="no" todir="${reports.tests}">
<fileset dir="${sources.tests}">
<include name="**/*Test*.java" />
<exclude name="**/AllTests.java" />
<exclude name="check/TestCase.java" />
<!-- special handling since SearchTest has no package (because of examples/Algorithms/SimpleGSP does not) -->
<include name="SearchTest.class" />
<!-- special handling since MarkovDecisionProcessTest has no package (because of examples/Algorithms/RobotNavigation does not) -->
<include name="MarkovDecisionProcessTest.class" />
<exclude name="orbital/algorithm/template/*" />
<!-- special handling since it has no package (because of examples/math/* does not) -->
<include name="DiverseMathTest.class" />
<exclude name="orbital/math/DiverseMathTest*" />
</fileset>
</batchtest>
</junit>
</target>
<target name="run.tests" depends="init, run.tests.internal"
description="run and report test result">
<mkdir dir="${reports.tests}"/>
<junitreport todir="${reports.tests}">
<fileset dir="${reports.tests}">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${reports.tests}"/>
</junitreport>
</target>
<target name="test" depends="init, run.tests"
description="run and report test result (synonym)">
</target>
<target name="compile.coverage" depends="init, compile.tests"
description="compile coverage tests">
<!-- @internal Unfortunately we have to split instrumentation to prevent CreateProcess error of instrument call -->
<instrument todir="${build.coverage}">
<fileset dir="${classes}">
<include name="orbital/logic/**/*.class"/>
</fileset>
</instrument>
<instrument todir="${build.coverage}">
<fileset dir="${classes}">
<include name="orbital/math/**/*.class"/>
</fileset>
</instrument>
<instrument todir="${build.coverage}">
<fileset dir="${classes}">
<include name="orbital/algorithm/**/*.class"/>
</fileset>
</instrument>
<instrument todir="${build.coverage}">
<fileset dir="${classes}">
<include name="orbital/moon/**/*.class"/>
</fileset>
</instrument>
<instrument todir="${build.coverage}">
<fileset dir="${classes}">
<include name="**/*.class"/>
<exclude name="orbital/logic/**/*.class"/>
<exclude name="orbital/math/**/*.class"/>
<exclude name="orbital/algorithm/**/*.class"/>
<exclude name="orbital/moon/**/*.class"/>
</fileset>
</instrument>
</target>
<target name="run.coverage" depends="init, compile.coverage"
description="run and report coverage tests">
<echo>
With assertions turned on, this test suite runs about 30 min.
With assertions turned off, this test suite runs about .... min.
Assertions are set to "${run.tests.jvmarg}"
</echo>
<antcall target="run.tests">
<!-- prefer any existing instrumented classes, only for run.coverage -->
<param name="run.tests.classpath" value="${build.coverage}"/>
</antcall>
<report srcdir="${sources}" destdir="${reports.coverage}"/>
</target>
<!-- documentation -->
<target name="doc" depends="init, prepareEnvironment, parser"
description="generate javadoc (=> ./doc/api/)">
<mkdir dir="${doc.dest}"/>
<mkdir dir="${doc.api.dest}"/>
<delete includeEmptyDirs="true">
<fileset dir="${doc.api.dest}"/>
<fileset dir="${doc.dest}"/>
</delete>
<mkdir dir="${doc.dest}"/>
<mkdir dir="${doc.api.dest}"/>
<xslt basedir="${doc}" destdir="${doc.dest}" style="${doc}/main.xsl">
<include name="**/*.xml"/>
<exclude name="**/menupunkte.xml"/>
</xslt>
<javadoc maxmemory="256M"
failonerror="true"
destdir="${doc.api.dest}"
author="true"
version="false"
use="true"
additionalparam="-source 1.4 -docfilessubdirs -excludedocfilessubdir **/.svn -keywords"
encoding="utf-8"
docencoding="utf-8"
windowtitle="Orbital"
doctitle="Orbital library<br>API Specification"
header="<b>Orbital library</b>"
footer="<b>Orbital library</b><br />${version}: ${timestamp}"
overview="${doc}/overview.html"
Private="${doc.internal}">
<bottom><![CDATA[<span style='font-size: smaller; font-style: italic;'>Copyright © 1996-2009 André Platzer<br />All Rights Reserved.</span>]]></bottom>
<packageset dir="${sources}" defaultexcludes="no"
excludes="orbital,orbital/util/graph,orbital/moon,orbital/moon/aspects,orbital/moon/deprecated,orbital/moon/math/**,orbital/moon/logic/bridge,orbital/moon/logic/sign/type,orbital/util/logging">
<include name="orbital/**"/>
</packageset>
<!--
<fileset dir="${sources}" defaultexcludes="no"
excludes="orbital/*.java,orbital/robotic/strategy/*.java,orbital/util/graph/*.java,orbital/moon/*.java,orbital/moon/aspects/*.java,orbital/moon/deprecated/*.java,orbital/moon/math/*.java,orbital/moon/logic/bridge/*.java,orbital/moon/logic/imp/*.java,orbital/moon/awt/virtual/*.java,orbital/util/logging/*.java">
<include name="orbital/**/*.java"/>
<exclude name="**/*BeanInfo.java"/>
</fileset>
-->
<!-- @xxx the following line unfortunately does not fix the problem that filesets won't link themselves -->
<!-- <link href="${doc.api.dest}"/> -->
<!-- -tag param -tag pre:mc:"Preconditions:" -tag post:mc:"Postconditions:" -tag return -tag throws -tag stereotype:a:"Stereotype:" -tag structure:t:"Structure:" -tag invariant:t:"Invariants:" -tag attribute:a:"Attributes:" -tag version -tag author -tag see -->
<tag name="preconditions" scope="methods,constructors" description="Preconditions:"/>
<tag name="postconditions" scope="methods,constructors" description="Postconditions:"/>
<tag name="invariants" scope="types,fields" description="Invariants:"/>
<tag name="structure" scope="types,methods" description="Structure:"/>
<tag name="stereotype" scope="all" description="Stereotype:"/>
<tag name="attribute" scope="all" description="Attributes:"/>
<tag name="events" scope="types,methods" description="Events:"/>
<tag name="note" scope="all" description="Note:" enabled="true"/>
<tag name="internal" scope="all" description="Internal:" enabled="false"/>
<tag name="todo" scope="all" description="Todo:" enabled="false"/>
<!-- @todo rename xxx to todo 1y. Rename fixme to todo 0y. -->
<tag name="xxx" scope="all" description="Todo:" enabled="false"/>
<tag name="fixme" scope="all" description="Fixme:" enabled="false"/>
<!-- <taglet name="taglet.StereotypeTaglet" path="${taglet}"/>
xxx this does not work anymore
-->
<group title="Core Packages" packages="orbital.logic*:orbital.math:orbital.math*:orbital.util"/>
<group title="Extension Packages" packages="orbital.algorithm*:orbital.awt"/>
<group title="Implementation Packages" packages="orbital.moon*"/>
<link href="${javadoc.link.jdk}" offline="${javadoc.link.jdk.offline}" packagelistLoc="${javadoc.link.jdk}"/>
</javadoc>
<copy todir="${doc.api.dest}/Patterns">
<fileset dir="${doc}/Patterns"/>
</copy>
<copy todir="${doc.api.dest}">
<fileset dir="${doc}"
includes="*.css, *.*html"/>
</copy>
<delete>
<!-- @xxx does not remove CVS subdirs -->
<fileset dir="${doc.api.dest}" includes="**/CVS/*"/>
</delete>
<echo file="${doc.api.dest}/stylesheet.css" append="true">
@media screen { a:link, a:visited {color:blue} }
@import url("http://symbolaris.com/stylist.css");
</echo>
<antcall target="jjdoc"/>
</target>
<target name="doc.dist" depends="init"
description="generate javadoc (distrribution version)">
<antcall target="doc">
<param name="javadoc.link.jdk" value="http://java.sun.com/products/jdk/1.4.2/docs/api/"/>
<param name="javadoc.link.jdk.offline" value="true"/>
</antcall>
</target>
<target name="jjdoc" depends="init"
description="generate jjdoc (=> ./doc/api/)">
<mkdir dir="${doc.api.dest}/orbital/moon/logic/doc-files"/>
<jjdoc target="${sources}/orbital/moon/logic/LogicParser.jj"
outputfile="${doc.api.dest}/orbital/moon/logic/doc-files/LogicParser_grammar.html"
javacchome="${env.javacchome}" />
<concat destfile="${doc.api.dest}/orbital/moon/logic/doc-files/LogicParser_grammar.html"
append="true">
<filelist dir="${sources}" files="orbital/moon/logic/doc-files/LogicParser_lexical.html"/>
</concat>
</target>
<target name="doc.internal" depends="init"
description="generate internal javadoc with all classes and members, incl. private (=> ./doc/api/)">
<antcall target="doc">
<param name="doc.internal" value="true"/>
</antcall>
</target>
<!-- static code quality checking -->
<target name="fixCRLF" depends="init"
description="fix DOS linefeeds (CRLF) and remove tabs">
<fixcrlf srcdir="${sources}"
eol="lf" eof="remove" tab="remove" javafiles="yes"
includes="**/*.java, **/*.jj"/>
<fixcrlf srcdir="${examples}" tab="remove" javafiles="yes"
eol="lf" eof="remove"
includes="**/*.java, **/*.jj"/>
<fixcrlf srcdir="${sources.tests}" tab="remove" javafiles="yes"
eol="lf" eof="remove"
includes="**/*.java, **/*.jj"/>
</target>
<target name="style" depends="init"
description="generate design quality metrics report (=> ${reports}/jdepend.xml)" >
<mkdir dir="${reports.jdepend}"/>
<jdepend outputfile="${reports.jdepend}/jdepend.xml" fork="yes" format="xml"
classpathref="project.classpath">
<exclude name="java.*"/>
<exclude name="javax.*"/>
<classespath>
<pathelement location="${classes}"/>
</classespath>
<classpath>
<pathelement location="${lib.jdepend}/jdepend.jar"/>
</classpath>
</jdepend>
<style basedir="${reports.jdepend}" destdir="${reports.jdepend}"
includes="jdepend.xml"
style="${ant.home}/etc/jdepend.xsl" />
</target>
<target name="checkstyle.available" depends="init"
unless="checkstyle.present">
<echo message="Checkstyle http://checkstyle.sourceforge.net/ not (correctly) installed!"/>
</target>
<target name="checkstyle" depends="init, checkstyle.available"
if="checkstyle.present"
description="generate Checkstyle (http://checkstyle.sourceforge.net/) report (=> ./checkstyle_errors.txt, ./checkstyle_errors.xml)" >
<taskdef classpathref="checkstyle" resource="checkstyletask.properties"/>
<mkdir dir="${reports.style}"/>
<checkstyle config="style_checks.xml">
<fileset dir="${sources}" includes="**/*.java">
<exclude name="orbital/moon/logic/SimpleCharStream.java, orbital/moon/logic/Token.java, orbital/moon/logic/TokenManager.java, orbital/moon/logic/TokenMgrError.java, orbital/moon/logic/ParseException.java, orbital/moon/logic/LogicParser.java, orbital/moon/logic/LogicParserTokenManager.java, orbital/moon/logic/LogicParserConstants.java"/>
<exclude name="**/*BeanInfo*"/>
</fileset>
<formatter type="plain"/>
<formatter type="plain" toFile="${reports.style}/checkstyle_errors.txt"/>
<formatter type="xml" toFile="${reports.style}/checkstyle_errors.xml"/>
</checkstyle>
</target>
<!-- packaging and distribution -->
<target name="jar" depends="init, clean, compile"
description="build all dist/*.jar">
<mkdir dir="${dist}"/>
<mkdir dir="${dist}/lib"/>
<delete file="${dist}/lib/orbital-core.jar"/>
<delete file="${dist}/lib/orbital-ext.jar"/>
<jar destfile="${dist}/lib/orbital-core.jar">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Extension-Name" value="orbital-core"/>
<attribute name="Specification-Title" value="Orbital library specification" />
<attribute name="Specification-Vendor" value="Andre Platzer" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Implementation-Title" value="Orbital library core" />
<attribute name="Implementation-Vendor" value="Andre Platzer" />
<attribute name="Implementation-Vendor-Id" value="symbolaris.com" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<attribute name="Package-Title" value="orbital-core" />
<attribute name="Package-Vendor" value="Andre Platzer" />
<attribute name="Package-Version" value="${version} ${TODAY}" />
<attribute name="Sealed" value="true"/>
</manifest>
<fileset dir="${basedir}" includes="COPYRIGHT.*"/>
<fileset dir="${classes}">
<include name="orbital/logic/**/*.class"/>
<include name="orbital/math/**/*.class"/>
<include name="orbital/util/**/*.class"/>
<include name="orbital/*.class"/>
<exclude name="**/*$Debug.class"/>
</fileset>
</jar>
<jar destfile="${dist}/lib/orbital-ext.jar">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Extension-Name" value="orbital-ext"/>
<attribute name="Specification-Title" value="Orbital library specification" />
<attribute name="Specification-Vendor" value="Andre Platzer" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Implementation-Title" value="Orbital library extension" />
<attribute name="Implementation-Vendor" value="Andre Platzer" />
<attribute name="Implementation-Vendor-Id" value="symbolaris.com" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<attribute name="Package-Title" value="orbital-ext" />
<attribute name="Package-Vendor" value="Andre Platzer" />
<attribute name="Package-Version" value="${version} ${TODAY}" />
<attribute name="Class-Path" value="orbital-core.jar" />
<attribute name="Sealed" value="true"/>
<!-- <attribute name="Main-Class" value="orbital.moon.setup"/> -->
<attribute name="Main-Icon" value="orbital/moon/orbital.gif"/>
<section name="orbital/awt/ChartModel.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/NumberInput.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/Plot2D.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/virtual/v_Canvas.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/virtual/v_View.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/algorithm/evolutionary/GeneticAlgorithm.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/algorithm/evolutionary/Population.class">
<attribute name="Java-Bean" value="True"/>
</section>
<!-- section name="orbital/algorithm/evolutionary/Chromosome.class">
<attribute name="Java-Bean" value="True"/>
</section -->
</manifest>
<fileset dir="${basedir}" includes="COPYRIGHT.*"/>
<fileset dir="${classes}">
<include name="orbital/algorithm/**/*.class"/>
<include name="orbital/awt/**/*.class"/>
<include name="orbital/game/**/*.class"/>
<include name="orbital/moon/**/*.class"/>
<exclude name="**/*$Debug.class"/>
</fileset>
<fileset dir="${sources}">
<include name="orbital/awt/*.gif"/>
</fileset>
<fileset dir="${resources}">
<exclude name="java/**"/>
</fileset>
<zipfileset dir="${doc}" prefix="orbital/moon">
<include name="orbital.gif"/>
</zipfileset>
<fileset dir="${sources}/orbital">
<include name="META-INF/services/*"/>
</fileset>
</jar>
<!-- all-in-one jar version: union of orbital-core.jar and orbital-ext.jar -->
<jar destfile="${dist}/lib/orbital${version_brief}.jar">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Extension-Name" value="orbital"/>
<attribute name="Specification-Title" value="Orbital library specification" />
<attribute name="Specification-Vendor" value="Andre Platzer" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Implementation-Title" value="Orbital library all" />
<attribute name="Implementation-Vendor" value="Andre Platzer" />
<attribute name="Implementation-Vendor-Id" value="symbolaris.com" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<attribute name="Package-Title" value="orbital" />
<attribute name="Package-Vendor" value="Andre Platzer" />
<attribute name="Package-Version" value="${version} ${TODAY}" />
<attribute name="Sealed" value="true"/>
<!-- <attribute name="Main-Class" value="orbital.moon.setup"/> -->
<attribute name="Main-Icon" value="orbital/moon/orbital.gif"/>
<section name="orbital/awt/ChartModel.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/NumberInput.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/Plot2D.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/virtual/v_Canvas.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/awt/virtual/v_View.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/algorithm/evolutionary/GeneticAlgorithm.class">
<attribute name="Java-Bean" value="True"/>
</section>
<section name="orbital/algorithm/evolutionary/Population.class">
<attribute name="Java-Bean" value="True"/>
</section>
<!-- section name="orbital/algorithm/evolutionary/Chromosome.class">
<attribute name="Java-Bean" value="True"/>
</section -->
</manifest>
<fileset dir="${basedir}" includes="COPYRIGHT.*"/>
<fileset dir="${classes}">
<include name="orbital/logic/**/*.class"/>
<include name="orbital/math/**/*.class"/>
<include name="orbital/util/**/*.class"/>
<include name="orbital/*.class"/>
<exclude name="**/*$Debug.class"/>
</fileset>
<fileset dir="${classes}">
<include name="orbital/algorithm/**/*.class"/>
<include name="orbital/awt/**/*.class"/>
<include name="orbital/game/**/*.class"/>
<include name="orbital/moon/**/*.class"/>
<exclude name="**/*$Debug.class"/>
</fileset>
<fileset dir="${sources}">
<include name="orbital/awt/*.gif"/>
</fileset>
<fileset dir="${resources}">
<exclude name="java/**"/>
</fileset>
<zipfileset dir="${doc}" prefix="orbital/moon">
<include name="orbital.gif"/>
</zipfileset>
<fileset dir="${sources}/orbital">
<include name="META-INF/services/*"/>
</fileset>
</jar>
<input message="Enter Passphrase for keystore: "
addproperty="pass"/>
<condition property="signing">
<not><equals arg1="${pass}" arg2=""/></not>
</condition>
<antcall target="jar.sign" />
<touch datetime="${TODAY} 1:20 am">
<fileset dir="${dist}/lib">
<include name="*.jar"/>
</fileset>
</touch>
</target>
<target name="jar.sign" depends="init"
if="signing">
<signjar jar="${dist}/lib/orbital-core.jar" alias="Andre" storepass="${pass}"/>
<signjar jar="${dist}/lib/orbital-ext.jar" alias="Andre" storepass="${pass}"/>
<signjar jar="${dist}/lib/orbital${version_brief}.jar" alias="Andre" storepass="${pass}"/>
</target>
<target name="dist" depends="init, clean, run.tests, dist.notests"
description="create all distributions (=> ./dist/*.zip)">
</target>
<target name="dist.notests" depends="init, doc.dist"
description="create all distributions (=> ./dist/*.zip), but do not run tests">
<antcall target="dist.nodoc.notests">
</antcall>
</target>
<target name="dist.nodoc.notests" depends="init, fixCRLF, jar, compile.examples"
description="create all distributions (=> ./dist/*.zip), but do not run tests">
<!-- <mkdir dir="${doc.dest}"/>
<mkdir dir="${doc.api.dest}"/> -->
<mkdir dir="${dist}"/>
<delete file="${dist}/ap_orbital_rt${version_brief}.zip"/>
<delete file="${dist}/ap_orbital_doc${version_brief}.zip"/>
<!-- generate version date into readme -->
<copy file="${doc}/readme.html" todir="${dist}"/>
<replace file="${dist}/readme.html" token="@VERSION_DATE@" value="${VERSION_DATE}"/>
<!-- make zip-file -->
<zip destfile="${dist}/ap_orbital${version_brief}.zip" duplicate="fail">
<zipfileset dir="${basedir}" includes="COPYRIGHT.*" prefix="Orbital"/>
<zipfileset dir="${dist}" prefix="Orbital">
<include name="readme.html"/>
</zipfileset>
<zipfileset dir="${doc}" prefix="Orbital">
<include name="orbital.gif"/>
<include name="overview.html"/>
<include name="recommendations.html"/>
</zipfileset>
<zipfileset dir="${dist}" includes="lib/*.jar" prefix="Orbital">
<exclude name="lib/orbital${version_brief}.jar"/>
<exclude name="lib/orbital1.*.jar"/>
</zipfileset>
<zipfileset dir="${bin}" prefix="Orbital/bin">
<include name="**/*.bat"/>
<include name="**/*.sh"/>
<include name="**/*.html"/>
<include name="policy.all"/>
</zipfileset>
<!-- documentation part -->
<zipfileset dir="${basedir}" includes="COPYRIGHT.*" prefix="Orbital/api"/>
<zipfileset dir="${doc.dest}" prefix="Orbital">
<exclude name="**/CVS/*"/>
</zipfileset>
<zipfileset dir="${examples}" prefix="Orbital/examples">
<exclude name="**/CVS/*"/>
<exclude name="**/*.jpx*"/>
<exclude name="Algorithms/RubiksCube.patterndb"/>
<exclude name="ReCompileAll.bat"/>
</zipfileset>
</zip>
<touch datetime="${TODAY} 1:20 am">
<fileset dir="${dist}">
<include name="*.zip"/>
</fileset>
</touch>
<!-- cleanup temporary files -->
<delete file="${dist}/readme.html"/>
</target>
<!-- cleanup -->
<target name="clean" depends="init"
description="remove all *.class">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${sources}/">
<include name="**/*.class"/>
</fileset>
<fileset dir="${classes}"/>
<fileset dir="${build.tests}/">
<include name="**/*.class"/>
</fileset>
<fileset dir="${build.coverage}"/>
<!-- <fileset dir="${dist}">
<exclude name="${doc.api.dest}"/>
<exclude name="${doc.dest}"/>
</fileset>
-->
<fileset dir="${examples}">
<include name="**/*.class"/>
<exclude name="Algorithms/MapView.class"/>
<exclude name="Algorithms/util/*"/>
<exclude name="Algorithms/orbital/**/*"/>
</fileset>
<fileset dir="${sources}/orbital/moon/logic"
includes="SimpleCharStream.java, Token.java, TokenManager.java, TokenMgrError.java, ParseException.java, LogicParser.java, LogicParserTokenManager.java, LogicParserConstants.java"/>
</delete>
</target>
<target name="realclean" depends="init, clean"
description="remove all generated files">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${dist}"/>
<fileset dir="${doc.api.dest}"/>
<fileset dir="${doc.dest}"/>
<fileset dir="${reports.tests}"/>
<fileset dir="${reports.coverage}"/>
<fileset dir="${reports.jdepend}"/>
<!-- <fileset dir="${basedir}" name="jcoverage.ser"/> -->
</delete>
</target>
<target name="cleanup" depends="realclean"
description="also remove all backup files *.bak, *~, .#*">
<delete>
<fileset dir="${sources}/" defaultexcludes="no">
<include name="**/*.bak"/>
<include name="**/*~"/>
<include name="**/.#*"/>
</fileset>
<fileset dir="${sources.tests}/" defaultexcludes="no">
<include name="**/*.bak"/>
<include name="**/*~"/>
<include name="**/.#*"/>
</fileset>
<fileset dir="${examples}/" defaultexcludes="no">
<include name="**/*.bak"/>
<include name="**/*~"/>
<include name="**/.#*"/>
</fileset>
</delete>
</target>
<!-- automatic distribution upload -->
<target name="upload" depends="init, dist.notests"
description="upload to web site">
<echo>Uploading</echo>
<input message="Enter password for ${ftp.target}: "
addproperty="pass"/>
<ftp server="${ftp.target}"
userid="${ftp.user}"
remotedir="${ftp.dir}"
password="${pass}"
verbose="yes"
depends="yes">
<!-- umask="" -->
<fileset dir="${dist}">
<include name="ap_orbital_rt${version_brief}.zip" />
<include name="ap_orbital_doc${version_brief}.zip" />
</fileset>
</ftp>
<echo>Success</echo>
</target>
<!--
<target name="upload-homepage">
<mkdir dir="build/web/homepage" />
<copy todir="build/web/homepage">
<fileset dir="src/web" includes="**/*.html,**/*.css"/>
</copy>
<replace dir="build/web/homepage">
<replacefilter token="%VERSION%" value="${version}" />
<replacefilter token="%RELEASE_VERSION%" value="${release-version}" />
</replace>
<exec dir="build/web/homepage" executable="scp" failonerror="true">
<arg value="-r" />
<arg value="." />
<arg value="${sourceforge.www.target}" />
</exec>
</target>
-->
<target name="env" depends="init"
description="print out some properties for debugging build.xml">
<echoproperties />
<echo>
basedir = ${basedir}
sources = ${sources}
lib = ${lib}
resources = ${resources}
doc = ${doc}
bin = ${bin}
classes = ${classes}
dist = ${dist}
examples = ${examples}
sources.tests = ${sources.tests}
build.tests = ${build.tests}
reports.tests = ${reports.tests}
</echo>
</target>
</project>