forked from jonalv/cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
1250 lines (1167 loc) · 66 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<project name="CDK" default="dist-all" basedir=".">
<property file="build.props"/>
<!-- compile options -->
<property name="build.sysclasspath" value="ignore" />
<property name="build.compiler" value="modern" />
<property name="compile.target.version" value="1.5"/>
<property name="debug" value="on" />
<property name="deprecation" value="on" />
<property name="optimization" value="off" />
<property name="threadCount" value="4" />
<property name="parallel" value="false"/>
<!-- patches to apply -->
<!-- directories -->
<property name="build" value="build" />
<property name="build.src" value="${build}/src" />
<property name="sourcedist" value="sourcedist" />
<property name="dist" value="dist" />
<property name="doc" value="doc" />
<property name="src" value="src" />
<property name="lib" value="jar" />
<property name="devellib" value="develjar" />
<property name="src.tests" value="${src}/test/org/openscience/cdk/test" />
<property name="reports.tests" value="reports" />
<property name="appjars.dir" value="${dist}/appjars" />
<property name="metainf" value="${src}/META-INF" />
<!-- class to run for testing-->
<property name="testclass" value="CDKTests" />
<property name="arg1" value="" />
<property name="arg2" value="" />
<property name="arg3" value="" />
<property name="arg4" value="" />
<!-- jvm arguments -->
<property name="jvmarg.cdk.debugging" value="true"
description="print debug logging statements"/>
<property name="jvmarg.cdk.stdout" value="true"/>
<!-- jar file names for libraries used for compiling -->
<property name="javaccjar" value="javacc.jar" />
<property name="antcontribjar" value="ant-contrib-1.0b3.jar" />
<property name="vecmathjar" value="vecmath1.2-1.14.jar" />
<property name="log4jjar" value="log4j.jar" />
<property name="jgraphtjar" value="jgrapht-0.6.0.jar" />
<property name="junitjar" value="junit-4.11.jar" />
<property environment="env" />
<!-- Include the ant-contrib goodies -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${devellib}/${antcontribjar}"/>
</classpath>
</taskdef>
<!--
<shellscript shell="bash" outputproperty="svn.output">
svn info
</shellscript>
<propertyregex property="svn.rev" input="${svn.output}" regexp="Revision: ([0-9]*)" select="\1" />
-->
<target id="info" name="info" depends="check">
<!-- Gives information about the building process. -->
<echo message="Platform:" />
<echo message=" OS: ${os.name}" />
<echo message=" Architecture: ${os.arch}" />
<echo message=" Version: ${os.version}" />
<echo message=" Mac OS/X found: ${isMacOsX}" />
<echo message="" />
<echo message="Java/Ant Environment:" />
<echo message=" Java version: ${java.version}" />
<echo message=" Java vendor: ${java.vendor}" />
<echo message=" Java dir: ${java.home}" />
<echo message=" Java ext dir: ${java.ext.dirs}" />
<echo message=" Ant version: ${ant.version}" />
<echo message=" ${ANT_HOME}: ${ant.home}" />
<echo message=" hasAnt17: ${hasAnt17}" />
<echo message="" />
<echo message="CDK Environment:" />
<echo message=" CDK version: ${version}" />
<echo message=" build.xml: $Id$" />
<echo message=" Junit found: ${junit.present}" />
<echo message=" --- required libraries ---" />
<echo message=" Vecmath found: ${vecmath.present}" />
<echo message=" Log4j found: ${log4j.present}" />
<echo message=" JGraphT found: ${jgrapht.present}" />
<echo message=" --- distributed (but optional) libraries ---" />
<echo message=" CMLDOM found: ${cmllibs.present}" />
<echo message=" --- optional libraries ---" />
<echo message="" />
<echo message="Compiling:" />
<echo message=" for: ${build.compiler}" />
<echo message=" target: ${compile.target.version}" />
<echo message=" debug: ${debug}" />
<echo message=" deprecation: ${deprecation}" />
<echo message=" optimization: ${optimization}" />
<echo message=" parallel: ${parallel}" />
<echo message=" threads: ${threadCount}" />
<echo message="" />
<echo message="Available Targets" />
<echo message=" clean: Remove class files and any temporary files" />
<echo message=" dist-all: Compile all modules" />
<echo message=" test-all: Performs a full JUnit test for all modules" />
<echo message=" dist-large: Create the comprehensive jar, with all modules" />
<echo message=" test-dist-all: Compile all test modules" />
<echo message="test-dist-large: Create a single jar file with all test modules" />
<echo message=" jarTestdata: Create the jar file with all test data. Used in testing" />
<echo message="" />
</target>
<!-- See what platform were on -->
<target id="checkPlatforms" name="checkPlatforms">
<condition property="isMacOsX">
<and>
<os family="mac"/>
<os family="unix"/>
</and>
</condition>
</target>
<target id="check" name="check" depends="checkPlatforms">
<!-- Check wether Doclets are compiled and output is generated -->
<uptodate property="dotjavafiles.uptodate"
targetfile="${build}/core.javafiles">
<srcfiles dir="${src}" includes="**/*.java" />
</uptodate>
<condition property="dotjjfiles.uptodate">
<and>
<uptodate property="NomParserJavafiles.uptodate"
targetfile="${src}/main/org/openscience/cdk/iupac/parser/NomParser.java">
<srcfiles dir="${src}/main/" includes="org/openscience/cdk/iupac/parser/NomParser.jj" />
</uptodate>
<uptodate property="SMARTSParserJJTJavafiles.uptodate"
targetfile="${src}/main/org/openscience/cdk/smiles/smarts/parser/SMARTSParser.java">
<srcfiles dir="${src}/main/" includes="org/openscience/cdk/smiles/smarts/parser/SMARTSParser.jj" />
</uptodate>
</and>
</condition>
<!-- Checks which parts of CDK can be build. -->
<!-- test for optional jars -->
<available property="vecmath.present"
file="${lib}/${vecmathjar}"/>
<available property="log4j.present"
file="${lib}/${log4jjar}"/>
<available property="jgrapht.present"
file="${lib}/${jgraphtjar}"/>
<!-- test for optional jars -->
<condition property="cmllibs.present">
<or>
<available file="${lib}/jumbo-with-fix-by-jonalv.jar"/>
</or>
</condition>
<condition property="junit.present">
<or>
<available file="${ant.home}/lib/junit.jar"/>
<available file="${devellib}/${junitjar}"/>
</or>
</condition>
<!-- test Ant version -->
<condition property="hasAnt17">
<or>
<contains string="${ant.version}" substring="1.7.1"/>
<contains string="${ant.version}" substring="1.8"/>
<contains string="${ant.version}" substring="1.9"/>
</or>
</condition>
<!-- test Java version -->
<condition property="isJava13">
<contains string="${java.version}" substring="1.3"/>
</condition>
<condition property="isJava14">
<contains string="${java.version}" substring="1.4"/>
</condition>
<condition property="isJava15">
<contains string="${java.version}" substring="1.5"/>
</condition>
<condition property="isJava16">
<contains string="${java.version}" substring="1.6."/>
</condition>
<condition property="isJava17">
<contains string="${java.version}" substring="1.7."/>
</condition>
<condition property="isJava14+">
<or>
<contains string="${java.version}" substring="1.4"/>
<contains string="${java.version}" substring="1.5"/>
<contains string="${java.version}" substring="1.6"/>
<contains string="${java.version}" substring="1.7"/>
</or>
</condition>
<condition property="isJava15+">
<or>
<contains string="${java.version}" substring="1.5"/>
<contains string="${java.version}" substring="1.6"/>
<contains string="${java.version}" substring="1.7"/>
</or>
</condition>
<condition property="isNotJava15+">
<not>
<or>
<contains string="${java.version}" substring="1.5"/>
<contains string="${java.version}" substring="1.6"/>
<contains string="${java.version}" substring="1.7"/>
</or>
</not>
</condition>
<fail if="isNotJava15+" message="This CDK release requires Java5 or better."/>
<fail unless="hasAnt17" message="This CDK release requires Ant 1.7.1 or better."/>
</target>
<target id="init" name="init" depends="check, setupBuildDir"/>
<target id="customize" name="customize" depends="javacc"/>
<target id="setupBuildDir" name="setupBuildDir">
<tstamp />
<mkdir dir="${build}" />
<mkdir dir="${sourcedist}" />
<mkdir dir="${dist}" />
<mkdir dir="${reports.tests}" />
</target>
<target id="clean" name="clean" description="Removes autogenerated files.">
<delete>
<fileset dir="." includes="**/*~" />
<fileset dir="." includes="*.tar.gz" />
<fileset dir="." includes="*.zip" />
<fileset dir="." includes="*.rda" />
<fileset dir="${src}" includes="*.entitylist" />
<!-- remove java files generated with JavaCC -->
<fileset dir="${src}/main/org/openscience/cdk/smiles/smarts" includes="*.java">
<exclude name="SMARTSQueryTool.java" />
</fileset>
<fileset dir="${src}/main/org/openscience/cdk/smiles/smarts/parser"
includes="SMARTSParser*.java,SMARTSParser.jj,JJT*,ParseException.java,SimpleCharStream.java,Token*.java" />
<fileset dir="${src}/main/org/openscience/cdk/iupac/parser" includes="*.java">
<!-- the next are from CVS -->
<exclude name="AttachedGroup.java" />
<exclude name="MoleculeBuilder.java" />
</fileset>
<fileset dir="${src}/main/">
<include name="net/sf/cdk/tools/*.class" />
<include name="net/sf/cdk/tools/**/*.class" />
</fileset>
</delete>
<delete dir="${build}" />
<delete dir="${sourcedist}" />
<delete dir="${dist}" />
<delete dir="${reports.tests}" />
</target>
<target name="runDoclet" id="runDoclet" depends="check, customize">
<echo>Not skipping doclet run...</echo>
<mkdir dir="${build}" />
<javac includes="net/sf/cdk/tools/MakeJavafilesFiles.java"
srcdir="${src}/main/" destdir="${build}" optimize="${optimization}"
debug="${debug}" deprecation="${deprecation}" source="${compile.target.version}" target="${compile.target.version}"/>
<java classpath="${build}" classname="net.sf.cdk.tools.MakeJavafilesFiles">
<arg value="${src}/META-INF"/>
<arg value="${src}/main"/>
<arg value="${build}"/>
</java>
<java classpath="${build}" classname="net.sf.cdk.tools.MakeJavafilesFiles">
<arg value="${src}/META-INF"/>
<arg value="${src}/test"/>
<arg value="${build}"/>
</java>
</target>
<target id="compile-needed-test" name="compile-needed-test">
<if>
<matches string="${module}" pattern="^test"/>
<then>
<property name="source" value="src/test"/>
</then>
<else>
<property name="source" value="src/main"/>
</else>
</if>
<uptodate property="module-uptodate" targetfile="${dist}/jar/cdk-${module}.jar">
<srcfiles dir="${source}">
<includesfile name="${build}/${module}.javafiles"/>
</srcfiles>
</uptodate>
</target>
<target id="compile-init" name="compile-init"
depends="init, check, runDoclet"/>
<target id="qa-module" name="qa-module"
depends="check, dist.init">
<echo message="Running QA for CDK's ${module} module" />
<antcall target="test-module">
<param name="module" value="${module}"/>
</antcall>
<ant antfile="javadoc.xml" target="compileDocTests"/>
<ant antfile="javadoc.xml" target="ojdcheck-module">
<property name="module" value="${module}"/>
</ant>
<ant antfile="pmd.xml" target="test-module">
<property name="pmd.test" value="custom"/>
<property name="module" value="${module}"/>
<property name="lib" value="develjar" />
</ant>
<ant antfile="pmd-unused.xml" target="test-module">
<property name="pmd.test" value="custom"/>
<property name="module" value="${module}"/>
<property name="lib" value="develjar" />
</ant>
<ant antfile="pmd-migrating.xml" target="test-module">
<property name="pmd.test" value="migrating"/>
<property name="module" value="${module}"/>
<property name="lib" value="develjar" />
</ant>
</target>
<target id="compile-module" name="compile-module"
depends="check, dist.init, compile-needed-test"
unless="module-uptodate">
<if>
<matches string="${module}" pattern="^test"/>
<then>
<property name="source" value="src/test"/>
</then>
<else>
<property name="source" value="src/main"/>
</else>
</if>
<echo message="Compiling classes for CDK's ${module} module from ${source}..." />
<!-- check for availability for meta info files -->
<available file="${metainf}/${module}.datafiles" property="module.datafiles.present"/>
<available file="${metainf}/${module}.extrafiles" property="module.extrafiles.present"/>
<available file="${metainf}/${module}.buildfiles" property="module.buildfiles.present"/>
<available file="${metainf}/${module}.cdkdepends" property="module.cdkdepends.present"/>
<available file="${metainf}/${module}.libdepends" property="module.libdepends.present"/>
<available file="${metainf}/${module}.devellibdepends" property="module.devellibdepends.present"/>
<available file="${metainf}/${module}.autogenerated" property="module.autogenerated.present"/>
<!-- be somewhat informative -->
<echo message="Datafiles defined: ${module.datafiles.present}"/>
<echo message="Extra files defined: ${module.extrafiles.present}"/>
<echo message="CDK dependencies defined: ${module.cdkdepends.present}"/>
<echo message="Library dependencies defined: ${module.libdepends.present}"/>
<echo message="Developer Library dependencies defined: ${module.devellibdepends.present}"/>
<echo message="Autogenerated files specified: ${module.autogenerated.present}"/>
<!-- normally javac compiles not just the given files, but also missing
classes that are in the same src/ directory. By making a copy first,
we explicitely make it impossible to compile files that are not
marked for a specific module -->
<mkdir dir="${build.src}/${module}"/>
<mkdir dir="${build}/${module}"/>
<copy todir="${build.src}/${module}">
<fileset dir="${source}">
<excludesfile name="${build}/java1.4+.javafiles" if="isJava13"/>
<!-- excludesfile name="${build}/java1.4.javafiles" unless="isJava14"/ -->
<!-- excludesfile name="${build}/java1.5.javafiles" unless="isJava15"/ -->
<excludesfile name="${build}/java1.5+.javafiles" if="isNotJava15"/>
<excludesfile name="${build}/ant1.6.javafiles" unless="hasAnt17"/>
<includesfile name="${build}/${module}.javafiles"/>
<includesfile name="${metainf}/${module}.autogenerated" if="module.autogenerated.present"/>
</fileset>
</copy>
<copy todir="${build}" file="build.props" />
<!-- ok, now that we have a copy, compile this copy -->
<javac srcdir="${build.src}/${module}" destdir="${build}/${module}" optimize="${optimization}"
debug="${debug}" deprecation="${deprecation}" source="${compile.target.version}" target="${compile.target.version}">
<classpath>
<fileset dir="${lib}" >
<exclude name="**/*" unless="module.libdepends.present" />
<includesfile name="${metainf}/${module}.libdepends" if="module.libdepends.present" />
</fileset>
<fileset dir="${devellib}">
<exclude name="**/*" unless="module.devellibdepends.present" />
<includesfile name="${metainf}/${module}.devellibdepends" if="module.devellibdepends.present" />
</fileset>
<fileset dir="${dist}/jar">
<exclude name="**/*" unless="module.cdkdepends.present" />
<includesfile name="${metainf}/${module}.cdkdepends" if="module.cdkdepends.present" />
</fileset>
</classpath>
<excludesfile name="${build}/java1.4+.javafiles" if="isJava13"/>
<!-- excludesfile name="${build}/java1.4.javafiles" unless="isJava14"/ -->
<!-- excludesfile name="${build}/java1.5.javafiles" unless="isJava15"/ -->
<excludesfile name="${build}/java1.5+.javafiles" if="isNotJava15"/>
<excludesfile name="${build}/ant1.6.javafiles" unless="hasAnt17"/>
<includesfile name="${build}/${module}.javafiles"/>
<includesfile name="${metainf}/${module}.autogenerated" if="module.autogenerated.present"/>
</javac>
<!-- create a autogenerated.classes file, if applicable, so that these files can be included in the jar -->
<if>
<istrue value="${module.autogenerated.present}"/>
<then>
<copy file="${metainf}/${module}.autogenerated" tofile="${build}/${module}.autogenerated.classes"
failonerror="false"/>
<replace dir="${build}" token=".java" value="*.class">
<include name="*.autogenerated.classes"/>
</replace>
</then>
</if>
<!-- and then jar things up into the module jar -->
<jar jarfile="${dist}/jar/cdk-${module}.jar">
<fileset dir="${build}/${module}">
<includesfile name="${build}/${module}.classes" />
<includesfile name="${build}/${module}.autogenerated.classes" if="module.autogenerated.present"/>
<excludesfile name="${build}/java1.4+.classes" if="isJava13"/>
<!-- excludesfile name="${build}/java1.4.classes" unless="isJava14"/ -->
<!-- excludesfile name="${build}/java1.5.javafiles" unless="isJava15"/ -->
<excludesfile name="${build}/java1.5+.javafiles" if="isNotJava15"/>
<excludesfile name="${build}/ant1.6.classes" unless="hasAnt17"/>
</fileset>
<fileset dir="${build}">
<include name="${module}.javafiles" />
</fileset>
<fileset dir="${source}">
<exclude name="**/*" unless="module.datafiles.present"/>
<includesfile name="${metainf}/${module}.datafiles" if="module.datafiles.present" />
</fileset>
<fileset dir="${src}">
<exclude name="**/*" unless="module.extrafiles.present"/>
<includesfile name="${metainf}/${module}.extrafiles" if="module.extrafiles.present" />
</fileset>
<fileset dir="${build}">
<exclude name="**/*" unless="module.buildfiles.present"/>
<includesfile name="${metainf}/${module}.buildfiles" if="module.buildfiles.present" />
</fileset>
</jar>
<jar jarfile="${dist}/jar/cdk-${module}-sources.jar">
<fileset dir="${build.src}/${module}">
<include name="**/*.java" />
</fileset>
</jar>
<!-- clean up afterwards -->
<!-- delete dir="${build.src}/${module}"/>
<delete dir="${build}/${module}"/ -->
</target>
<!-- Convert the JavaCC .jj file to the correct .java files for the IUPAC parser -->
<target id="javacc" name="javacc" depends="init, check" if="hasAnt17" unless="dotjjfiles.uptodate">
<echo message="Compiling Ant 1.6 depending classes." />
<!-- the IUPAC name parser -->
<delete>
<fileset id="javacc-generated"
dir="${src}/main/org/openscience/cdk/iupac/parser/"
includes="NomParser*.java,ParseException.java,SimpleCharStream.java,Token.java,TokenMgrError.java"/>
</delete>
<javacc target="${src}/main/org/openscience/cdk/iupac/parser/NomParser.jj"
outputdirectory="${src}/main/org/openscience/cdk/iupac/parser/"
javacchome="${lib}"/>
<delete>
<fileset id="javacc-generated"
dir="${src}/main/org/openscience/cdk/smiles/smarts/parser/"
includes="SMARTSParser*.java,SMARTSParser.jj,JJT*,ParseException.java,SimpleCharStream.java,Token*.java"/>
</delete>
<jjtree target="${src}/main/org/openscience/cdk/smiles/smarts/parser/SMARTSParser.jjt"
javacchome="${lib}"
outputdirectory="${src}/main/org/openscience/cdk/smiles/smarts/parser/"/>
<javacc target="${src}/main/org/openscience/cdk/smiles/smarts/parser/SMARTSParser.jj"
javacchome="${lib}"
outputdirectory="${src}/main/org/openscience/cdk/smiles/smarts/parser/"/>
<!-- OK, we now need to do some replacements such as
adding cdk.module tags and changing access modes
-->
<replace dir="${src}/main/org/openscience/cdk/smiles/smarts/parser"
excludes="AST*.java,SMARTSParser.jjt,SMARTSParser.jj,*Node.java"
token="package org.openscience.cdk.smiles.smarts.parser;" summary="true" >
<replacevalue>package org.openscience.cdk.smiles.smarts.parser;
/**
*
* @cdk.module smarts
*/</replacevalue>
</replace>
</target>
<target id="dist.init" name="dist.init">
<mkdir dir="${dist}/jar" />
</target>
<target id="dist-java3d" name="dist-java3d" depends="nocompile-java3d, compile-java3d"/>
<target id="nocompile-java3d" name="nocompile-java3d" unless="${java3d.present}">
<echo message="Java3d is not found. Removed depending functionality. Java3d can be downloaded from http://java.sun.com/."/>
</target>
<target id="compile-java3d" name="compile-java3d" if="${java3d.present}">
<antcall target="compile-module"><param name="module" value="java3d"/></antcall>
</target>
<target id="dist-optional" name="dist-optional" depends="dist-all"
description="Compile CDK modules that require optional libraries">
<antcall target="dist-java3d"/>
</target>
<target id="dist-all" name="dist-all" description="dist-all">
<antcall target="compile-init"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="interfaces,annotation,log4j"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="core,ioformats"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="silent,data,dict,diff,qm,standard"/>
<foreach target="compile-module" param="module" trim="yes"
parallel="${parallel}" maxthreads="${threadCount}"
list="datadebug,isomorphism,atomtype,render,valencycheck,
formula,cip"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="io,structgen"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="renderbasic"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="renderextra"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="pdb,smiles,sdg,inchi,libiocml"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="hash"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="control,extra,fragment,reaction,pdbcml,libiomd"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="charges,smarts,signature"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="qm,qsar,ionpot,fingerprint,pcore,smsd,tautomer"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="renderawt"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="forcefield"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="qsaratomic,qsarbond,qsarprotein,qsarcml,qsarmolecular"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="qsarionpot,iordf"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="builder3d,builder3dtools"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="group"/>
</target>
<target id="test-dist-all" name="test-dist-all" description="test-dist-all">
<antcall target="compile-init"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test"/>
<foreach target="compile-module" param="module" trim="true"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-interfaces,test-data,test-libiocml,test-qsar,test-io,test-core,
test-valencycheck,test-smarts,test-standard,test-reaction,
test-pcore,test-sdg,test-forcefield,test-fingerprint,
test-ionpot,test-qm,test-isomorphism,test-libiomd,test-dict,
test-diff,test-charges,test-inchi,
test-render,test-ioformats,test-log4j,test-cip"/>
<foreach target="compile-module" param="module" trim="true"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-formula,test-qsaratomic,test-qsarbond,test-qsarcml,
test-pdb,test-pdbcml,test-smiles,test-extra,test-fragment,test-atomtype,
test-structgen,test-iordf,test-silent"/>
<foreach target="compile-module" param="module" trim="true"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-qsarmolecular,test-builder3d,test-datadebug"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-qsarprotein,test-qsarionpot,test-smsd,test-tautomer"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-signature"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-renderbasic"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-renderawt"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-renderextra"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-group"/>
<foreach target="compile-module" param="module"
parallel="${parallel}" maxthreads="${threadCount}"
list="test-hash"/>
</target>
<target id="jarTestdata" name="jarTestdata" description="Creates jar files with test data.">
<mkdir dir="${dist}/jar"/>
<jar jarfile="${dist}/jar/cdk-testdata.jar">
<fileset dir="${src}/test">
<include name="data/**/*" />
</fileset>
</jar>
</target>
<target id="dist-large" name="dist-large" depends="dist-all"
description="Builds one big jar file for the CDK, including third-party libraries.">
<!-- first unjar the CDK and other jars we need -->
<mkdir dir="${appjars.dir}"/>
<unjar dest="${appjars.dir}">
<fileset dir="${lib}">
<includesfile name="${metainf}/builder3d.libdepends"/>
<includesfile name="${metainf}/builder3dtools.libdepends"/>
<includesfile name="${metainf}/charges.libdepends"/>
<includesfile name="${metainf}/log4j.libdepends"/>
<includesfile name="${metainf}/control.libdepends"/>
<includesfile name="${metainf}/datadebug.libdepends"/>
<includesfile name="${metainf}/data.libdepends"/>
<includesfile name="${metainf}/silent.libdepends"/>
<includesfile name="${metainf}/extra.libdepends"/>
<includesfile name="${metainf}/cip.libdepends"/>
<includesfile name="${metainf}/io.libdepends"/>
<includesfile name="${metainf}/libiocml.libdepends"/>
<includesfile name="${metainf}/pdbcml.libdepends"/>
<includesfile name="${metainf}/pdb.libdepends"/>
<includesfile name="${metainf}/qsar.libdepends"/>
<includesfile name="${metainf}/qsaratomic.libdepends"/>
<includesfile name="${metainf}/qsarbond.libdepends"/>
<includesfile name="${metainf}/qsarmolecular.libdepends"/>
<includesfile name="${metainf}/qsarprotein.libdepends"/>
<includesfile name="${metainf}/qsarcml.libdepends"/>
<includesfile name="${metainf}/reaction.libdepends"/>
<includesfile name="${metainf}/render.libdepends"/>
<includesfile name="${metainf}/renderbasic.libdepends"/>
<includesfile name="${metainf}/renderextra.libdepends"/>
<includesfile name="${metainf}/renderawt.libdepends"/>
<includesfile name="${metainf}/standard.libdepends"/>
<includesfile name="${metainf}/valencycheck.libdepends"/>
<includesfile name="${metainf}/sdg.libdepends"/>
<includesfile name="${metainf}/forcefield.libdepends"/>
<includesfile name="${metainf}/inchi.libdepends"/>
<includesfile name="${metainf}/smarts.libdepends"/>
<includesfile name="${metainf}/smsd.libdepends"/>
<includesfile name="${metainf}/pcore.libdepends"/>
<includesfile name="${metainf}/formula.libdepends"/>
<includesfile name="${metainf}/isomorphism.libdepends"/>
<includesfile name="${metainf}/qm.libdepends"/>
<includesfile name="${metainf}/iordf.libdepends"/>
<includesfile name="${metainf}/signature.libdepends"/>
<includesfile name="${metainf}/smiles.libdepends"/>
</fileset>
<fileset dir="${dist}/jar">
<include name="cdk-annotation.jar"/>
<include name="cdk-ioformats.jar"/>
<include name="cdk-atomtype.jar"/>
<include name="cdk-builder3d.jar"/>
<include name="cdk-builder3dtools.jar"/>
<include name="cdk-charges.jar"/>
<include name="cdk-core.jar"/>
<include name="cdk-cip.jar"/>
<include name="cdk-log4j.jar"/>
<include name="cdk-dict.jar"/>
<include name="cdk-diff.jar"/>
<include name="cdk-control.jar"/>
<include name="cdk-datadebug.jar"/>
<include name="cdk-data.jar"/>
<include name="cdk-silent.jar"/>
<include name="cdk-extra.jar"/>
<include name="cdk-fragment.jar"/>
<include name="cdk-interfaces.jar"/>
<include name="cdk-io.jar"/>
<include name="cdk-libiocml.jar"/>
<include name="cdk-libiomd.jar"/>
<include name="cdk-pdbcml.jar"/>
<include name="cdk-pdb.jar"/>
<include name="cdk-qsar.jar"/>
<include name="cdk-qsaratomic.jar"/>
<include name="cdk-qsarbond.jar"/>
<include name="cdk-qsarmolecular.jar"/>
<include name="cdk-qsarionpot.jar"/>
<include name="cdk-qsarprotein.jar"/>
<include name="cdk-qsarcml.jar"/>
<include name="cdk-reaction.jar"/>
<include name="cdk-render.jar"/>
<include name="cdk-renderbasic.jar"/>
<include name="cdk-renderextra.jar"/>
<include name="cdk-renderawt.jar"/>
<include name="cdk-standard.jar"/>
<include name="cdk-structgen.jar"/>
<include name="cdk-valencycheck.jar"/>
<include name="cdk-forcefield.jar"/>
<include name="cdk-smiles.jar"/>
<include name="cdk-smarts.jar"/>
<include name="cdk-fingerprint.jar"/>
<include name="cdk-sdg.jar"/>
<include name="cdk-inchi.jar"/>
<include name="cdk-pcore.jar"/>
<include name="cdk-formula.jar"/>
<include name="cdk-isomorphism.jar"/>
<include name="cdk-ionpot.jar"/>
<include name="cdk-smsd.jar"/>
<include name="cdk-iordf.jar"/>
<include name="cdk-signature.jar"/>
<include name="cdk-group.jar"/>
<include name="cdk-hash.jar"/>
<include name="cdk-qm.jar"/>
<include name="cdk-tautomer.jar"/>
</fileset>
</unjar>
<!-- then zip up things -->
<jar jarfile="${dist}/jar/cdk-${version}.jar">
<manifest>
<section name="org.openscience.cdk">
<attribute name="Specification-Title" value="The Chemistry Development Kit"/>
<attribute name="Specification-Version" value="1.4"/>
<attribute name="Specification-Vendor" value="The CDK Project"/>
<attribute name="Implementation-Title" value="org.openscience.cdk"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="The CDK Project"/>
<attribute name="X-Compile-Target-JDK" value="${compile.target.version}"/>
</section>
</manifest>
<fileset dir="${appjars.dir}">
<include name="**/*" />
</fileset>
</jar>
</target>
<target id="dist-pure" name="dist-pure" depends="dist-all"
description="Builds one big jar file for the CDK, excluding third party libraries.">
<!-- first unjar the CDK and other jars we need -->
<mkdir dir="${appjars.dir}"/>
<unjar dest="${appjars.dir}">
<fileset dir="${dist}/jar">
<include name="cdk-annotation.jar"/>
<include name="cdk-builder3d.jar"/>
<include name="cdk-builder3dtools.jar"/>
<include name="cdk-charges.jar"/>
<include name="cdk-log4j.jar"/>
<include name="cdk-core.jar"/>
<include name="cdk-cip.jar"/>
<include name="cdk-control.jar"/>
<include name="cdk-datadebug.jar"/>
<include name="cdk-data.jar"/>
<include name="cdk-silent.jar"/>
<include name="cdk-diff.jar"/>
<include name="cdk-extra.jar"/>
<include name="cdk-fragment.jar"/>
<include name="cdk-interfaces.jar"/>
<include name="cdk-io.jar"/>
<include name="cdk-ioformats.jar"/>
<include name="cdk-libiocml.jar"/>
<include name="cdk-libiomd.jar"/>
<include name="cdk-pdbcml.jar"/>
<include name="cdk-pdb.jar"/>
<include name="cdk-qsar.jar"/>
<include name="cdk-qsaratomic.jar"/>
<include name="cdk-qsarbond.jar"/>
<include name="cdk-qsarmolecular.jar"/>
<include name="cdk-qsarionpot.jar"/>
<include name="cdk-qsarprotein.jar"/>
<include name="cdk-qsarcml.jar"/>
<include name="cdk-reaction.jar"/>
<include name="cdk-render.jar"/>
<include name="cdk-renderbasic.jar"/>
<include name="cdk-renderextra.jar"/>
<include name="cdk-renderawt.jar"/>
<include name="cdk-standard.jar"/>
<include name="cdk-structgen.jar"/>
<include name="cdk-valencycheck.jar"/>
<include name="cdk-forcefield.jar"/>
<include name="cdk-smarts.jar"/>
<include name="cdk-fingerprint.jar"/>
<include name="cdk-smiles.jar"/>
<include name="cdk-sdg.jar"/>
<include name="cdk-inchi.jar"/>
<include name="cdk-pcore.jar"/>
<include name="cdk-formula.jar"/>
<include name="cdk-atomtype.jar"/>
<include name="cdk-signature.jar"/>
<include name="cdk-tautomer.jar"/>
<include name="cdk-group.jar"/>
<include name="cdk-hash.jar"/>
</fileset>
</unjar>
<!-- then zip up things -->
<jar jarfile="${dist}/jar/cdk-pure-${version}.jar">
<manifest>
<section name="org.openscience.cdk">
<attribute name="Specification-Title" value="The Chemistry Development Kit"/>
<attribute name="Specification-Version" value="1.0"/>
<attribute name="Specification-Vendor" value="The CDK Project"/>
<attribute name="Implementation-Title" value="org.openscience.cdk"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="The CDK Project"/>
<attribute name="X-Compile-Target-JDK" value="${compile.target.version}"/>
</section>
</manifest>
<fileset dir="${appjars.dir}">
<include name="**/*" />
</fileset>
</jar>
</target>
<target id="dist-test-large" name="dist-test-large" depends="test-dist-all, jarTestdata"
description="Builds on big jar file for the CDK test classes.">
<!-- first unjar the CDK and other jars we need -->
<mkdir dir="${appjars.dir}"/>
<unjar dest="${appjars.dir}">
<fileset dir="${lib}">
<includesfile name="${metainf}/test.libdepends"/>
<includesfile name="${metainf}/test-core.libdepends"/>
<includesfile name="${metainf}/test-data.libdepends"/>
<includesfile name="${metainf}/test-datadebug.libdepends"/>
<includesfile name="${metainf}/test-silent.libdepends"/>
<includesfile name="${metainf}/test-diff.libdepends"/>
<includesfile name="${metainf}/test-extra.libdepends"/>
<includesfile name="${metainf}/test-fragment.libdepends"/>
<includesfile name="${metainf}/test-builder3d.libdepends"/>
<includesfile name="${metainf}/test-forcefield.libdepends"/>
<includesfile name="${metainf}/test-inchi.libdepends"/>
<includesfile name="${metainf}/test-io.libdepends"/>
<includesfile name="${metainf}/test-pdb.libdepends"/>
<includesfile name="${metainf}/test-qsaratomic.libdepends"/>
<includesfile name="${metainf}/test-qsarbond.libdepends"/>
<includesfile name="${metainf}/test-qsarmolecular.libdepends"/>
<includesfile name="${metainf}/test-qsarionpot.libdepends"/>
<includesfile name="${metainf}/test-qsarprotein.libdepends"/>
<includesfile name="${metainf}/test-qsar.libdepends"/>
<includesfile name="${metainf}/test-reaction.libdepends"/>
<includesfile name="${metainf}/test-smarts.libdepends"/>
<includesfile name="${metainf}/test-smiles.libdepends"/>
<includesfile name="${metainf}/test-standard.libdepends"/>
<includesfile name="${metainf}/test-structgen.libdepends"/>
<includesfile name="${metainf}/test-valencycheck.libdepends"/>
<includesfile name="${metainf}/test-charges.libdepends"/>
<includesfile name="${metainf}/test-libiomd.libdepends"/>
<includesfile name="${metainf}/test-pcore.libdepends"/>
<includesfile name="${metainf}/test-formula.libdepends"/>
<includesfile name="${metainf}/test-render.libdepends"/>
<includesfile name="${metainf}/test-log4j.libdepends"/>
<includesfile name="${metainf}/test-signature.libdepends"/>
<includesfile name="${metainf}/test-cip.libdepends"/>
</fileset>
<fileset dir="${dist}/jar">
<include name="cdk-test.jar"/>
<include name="cdk-testdata.jar"/>
<include name="cdk-test-annotation.jar"/>
<include name="cdk-test-ioformats.jar"/>
<include name="cdk-test-core.jar"/>
<include name="cdk-test-data.jar"/>
<include name="cdk-test-datadebug.jar"/>
<include name="cdk-test-silent.jar"/>
<include name="cdk-test-diff.jar"/>
<include name="cdk-test-extra.jar"/>
<include name="cdk-test-fragment.jar"/>
<include name="cdk-test-builder3d.jar"/>
<include name="cdk-test-forcefield.jar"/>
<include name="cdk-test-inchi.jar"/>
<include name="cdk-test-io.jar"/>
<include name="cdk-test-pdb.jar"/>
<include name="cdk-test-qsaratomic.jar"/>
<include name="cdk-test-qsarbond.jar"/>
<include name="cdk-test-qsarmolecular.jar"/>
<include name="cdk-test-qsarionpot.jar"/>
<include name="cdk-test-qsarprotein.jar"/>
<include name="cdk-test-qsar.jar"/>
<include name="cdk-test-reaction.jar"/>
<include name="cdk-test-smarts.jar"/>
<include name="cdk-test-smiles.jar"/>
<include name="cdk-test-standard.jar"/>
<include name="cdk-test-structgen.jar"/>
<include name="cdk-test-valencycheck.jar"/>
<include name="cdk-test-charges.jar"/>
<include name="cdk-test-libiomd.jar"/>
<include name="cdk-test-pcore.jar"/>
<include name="cdk-test-formula.jar"/>
<include name="cdk-test-render.jar"/>
<include name="cdk-test-log4j.jar"/>
<include name="cdk-test-signature.jar"/>
<include name="cdk-test-cip.jar"/>
<include name="cdk-test-tautomer.jar"/>
<include name="cdk-test-group.jar"/>
<include name="cdk-test-hash.jar"/>
</fileset>
</unjar>
<!-- then zip up things -->
<jar jarfile="${dist}/jar/cdk-test-${version}.jar">
<manifest>
<attribute name="Main-Class" value="org.openscience.cdk.CDKTests"/>
<section name="org.openscience.cdk">
<attribute name="Specification-Title" value="The Chemistry Development Kit"/>
<attribute name="Specification-Version" value="1.4"/>
<attribute name="Specification-Vendor" value="The CDK Project"/>
<attribute name="Implementation-Title" value="org.openscience.cdk"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="The CDK Project"/>
<attribute name="X-Compile-Target-JDK" value="${compile.target.version}"/>
</section>
</manifest>
<fileset dir="${appjars.dir}">
<include name="**/*" />
</fileset>
</jar>
</target>
<target id="sourcedist" name="sourcedist"
description="Builds the source packages.">
<property name="package" value="cdk-src+libs-${version}"/>
<property name="sourcedist.dir" value="${sourcedist}/${package}"/>
<delete dir="${sourcedist.dir}"/>
<antcall target="sourcedist-common">
<param name="package" value="${package}"/>
<param name="sourcedist.dir" value="${sourcedist.dir}"/>
</antcall>
</target>
<target id="sourceandtestdist" name="sourceandtestdist"
description="Builds the source packages, including the test code.">
<property name="package" value="cdk-src+libs+tests-${version}"/>
<property name="sourcedist.dir" value="${sourcedist}/${package}"/>
<delete dir="${sourcedist.dir}"/>
<copy todir="${sourcedist.dir}/${src}/test/">
<fileset dir="${src}/test/" includes="**/*.java" />
</copy>
<mkdir dir="${sourcedist.dir}/${src}/test/data" />
<copy todir="${sourcedist.dir}/${src}/test/data/">
<fileset dir="${src}/test/data/"/>
</copy>
<copy todir="${sourcedist.dir}/develjar">
<fileset dir="develjar">
<exclude name="jumbo-5.4.2-b2.jar"/>
</fileset>
</copy>
<antcall target="sourcedist-common">
<param name="package" value="${package}"/>
<param name="sourcedist.dir" value="${sourcedist.dir}"/>
</antcall>
</target>
<target id="sourcedist-common" name="sourcedist-common">
<copy todir="${sourcedist.dir}/${src}/main/">
<fileset dir="${src}/main/" includes="**/*.java" />
<fileset dir="${src}/main/" includes="**/*.jj" />
<fileset dir="${src}/main/" includes="**/*.jjt" />
<fileset dir="${src}/main/" includes="org/openscience/cdk/io/cml/data/**" />
</copy>
<copy todir="${sourcedist.dir}">
<fileset dir="." includes="build.props" />
<fileset dir="." includes="build.xml" />
<fileset dir="." includes="javadoc.xml" />
<fileset dir="." includes="README" />
<fileset dir="." includes="changelog*" />
</copy>
<copy todir="${sourcedist.dir}/jar">
<fileset dir="jar">
<exclude name="*.so"/>
<exclude name="*.dll"/>
<exclude name="jumbo-5.4.2-b2.jar"/>
</fileset>
</copy>
<copy todir="${sourcedist.dir}/doc/refs">
<fileset dir="doc/refs">
<include name="*.*"/>
</fileset>
</copy>