-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
145 lines (125 loc) · 5.18 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="AMG" default="package" basedir=".">
<property file="build.properties"/>
<property name="cdk_src_dir" value="${CDK_dir}/src/main"/>
<property name="cdk_bin_dir" value="${CDK_dir}/build"/>
<property name="module_list" value="core,standard,silent,annotation,io,ioformats,interfaces,signature,smiles,formula,valencycheck"/>
<target name="testgroovy">
<script language="groovy">
<classpath>
<fileset dir="lib" includes="*.jar"/>
</classpath>
for (m in module_list.split(",")) { println(m) }
</script>
</target>
<target name="cdk-ant" description="build cdk">
<echo>"Building CDK"</echo>
<property name="build" value="${CDK_dir}/build"/>
<property name="build.src" value="${CDK_dir}/build/src"/>
<property name="src" value="${CDK_dir}/src"/>
<ant target="dist-all" dir="${CDK_dir}">
</ant>
</target>
<target name="compile" depends="cdk-ant" description="compile both the CDK and the AMG classes">
<mkdir dir="build"/>
<!-- Copy the CDK classes -->
<script language="groovy">
<classpath>
<fileset dir="develjar" includes="*.jar"/>
</classpath>
dir = project.getProperty("cdk_bin_dir");
for (m in module_list.split(",")) {
copy = AMG.createTask("copy");
copy.setTodir(new java.io.File("build"));
fs = project.createDataType("fileset");
fs.setDir(new java.io.File(dir, m));
copy.addFileset(fs);
copy.perform();
}
</script>
<copy todir="build/org/openscience/cdk/config/data">
<fileset dir="${cdk_src_dir}/org/openscience/cdk/config/data" includes="**"/>
</copy>
<copy todir="build/org/openscience/cdk/dict/data">
<fileset dir="${cdk_src_dir}/org/openscience/cdk/dict/data" includes="**"/>
</copy>
<antcall target="compile-no-cdk"/>
</target>
<target name="compile-no-cdk" description="compile the AMG classes, without calling the CDK compile">
<!-- Compile the AMG classes -->
<javac srcdir="src" destdir="build" includeantruntime="false">
<classpath>
<pathelement path="build"/>
<pathelement path="lib/commons-cli-1.2.jar"/>
<pathelement path="develjar/junit-4.10.jar"/>
<pathelement path="${CDK_dir}/jar/signatures-1.0.jar"/>
</classpath>
</javac>
</target>
<target name="package" depends="compile" description="compile and package into a jar, then a zip">
<antcall target="package-no-compile"/>
</target>
<target name="package-no-compile" description="package without compiling">
<property name="store.jar.name" value="AMG"/>
<property name="store.dir" value="."/>
<tstamp>
<format property="TODAY" pattern="yyyyMMdd" />
</tstamp>
<property name="store.jar" value="${store.jar.name}${TODAY}.jar"/>
<property name="store.jar.path" value="${store.dir}/${store.jar}"/>
<jar destfile="${store.jar.path}" filesetmanifest="skip">
<fileset dir="build" includes="**"/>
<zipgroupfileset dir="lib" includes="*.jar"/>
<zipgroupfileset file="lib/commons-cli-1.2.jar"/>
<zipgroupfileset file="${CDK_dir}/jar/signatures-1.0.jar"/>
<zipgroupfileset file="${CDK_dir}/jar/cmlxom-*.jar"/>
<zipgroupfileset file="${CDK_dir}/jar/jgrapht-*.jar"/>
<zipgroupfileset file="${CDK_dir}/jar/vecmath*.jar"/>
<manifest>
<attribute name="Main-Class" value="app.AMG"/>
</manifest>
</jar>
<echo file="AMG">java -Xms500M -Xmx512M -cp ${store.jar} app.AMG $@</echo>
<chmod perm="a+x" file="AMG"/>
<echo file="AMG.bat">java -Xms500M -Xmx512M -cp ${store.jar} app.AMG %*</echo>
<chmod perm="a+x" file="AMG.bat"/>
<zip destfile="${store.jar.name}${TODAY}.zip">
<filelist files="${store.jar.path},AMG,AMG.bat,INSTRUCTIONS.txt"/>
</zip>
</target>
<target name="clean" description="remove build dir">
<delete dir="build"/>
</target>
<target name="test-atom" description="Run by atom junit tests">
<junit printsummary="yes">
<classpath>
<pathelement location="build"/>
<pathelement path="${CDK_dir}/jar/signatures-1.0.jar"/>
</classpath>
<formatter type="plain"/>
<test name="augment.atom.AlkaneTests"/>
<test name="augment.atom.AlkeneTests"/>
<test name="augment.atom.AlkyneTests"/>
<test name="augment.atom.CarbonNitrogenTests"/>
<test name="augment.atom.CarbonOnlyTests"/>
<test name="augment.atom.CarbonOxygenTests"/>
<test name="augment.atom.SubAlkyneTests"/>
</junit>
</target>
<target name="test-bond" description="Run by bond junit tests">
<junit printsummary="yes">
<classpath>
<pathelement location="build"/>
<pathelement path="${CDK_dir}/jar/signatures-1.0.jar"/>
</classpath>
<formatter type="plain"/>
<test name="augment.bond.AlkaneTests"/>
<test name="augment.bond.AlkeneTests"/>
<test name="augment.bond.AlkyneTests"/>
<test name="augment.bond.CarbonNitrogenTests"/>
<test name="augment.bond.CarbonOnlyTests"/>
<test name="augment.bond.CarbonOxygenTests"/>
<test name="augment.bond.SubAlkyneTests"/>
</junit>
</target>
</project>