-
Notifications
You must be signed in to change notification settings - Fork 57
/
build.xml
266 lines (234 loc) · 9.24 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
<?xml version="1.0" ?>
<project name="javaplex" default="default" basedir=".">
<property name="version.num" value="4.3.4" />
<property name="build.dir" value="build" />
<property name="bin.dir" value="${build.dir}/bin" />
<property name="temp.dir" value="temp" />
<property name="src_test.dir" value="src_test" />
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="doc.dir" value="doc" />
<property name="dist.dir" value="dist" />
<property name="matlab.lib.dir" value="src/matlab/for_distribution/lib" />
<property name="test.dir" value="${build.dir}/test" />
<property name="project.name" value="javaplex" />
<property name="runnable.jar" value="${dist.dir}/${project.name}-${version.num}.jar" />
<property name="basic.jar" value="${temp.dir}/${project.name}.jar" />
<property name="tests.jar" value="${temp.dir}/tests.jar" />
<property name="source.tarball" value="${dist.dir}/${project.name}-src-${version.num}.tar.gz" />
<property name="source.zipball" value="${dist.dir}/${project.name}-src-${version.num}.zip" />
<property name="doc.tarball" value="${dist.dir}/${project.name}-doc-${version.num}.tar.gz" />
<property name="doc.zipball" value="${dist.dir}/${project.name}-doc-${version.num}.zip" />
<property name="matlab.tarball" value="${dist.dir}/matlab-examples-${version.num}.tar.gz" />
<property name="matlab.zipball" value="${dist.dir}/matlab-examples-${version.num}.zip" />
<property name="processing.src.dir" value="src/processing/javaplex" />
<property name="processing.demo.src.dir" value="src/processing/javaplexDemo" />
<property name="processing.build.dir" value="build/processing/javaplex" />
<property name="processing.dist.dir" value="dist/processing" />
<property name="processing.jar" value="${processing.build.dir}/library/javaplex.jar" />
<property name="processing.zipball" value="${dist.dir}/${project.name}-processing-lib-${version.num}.zip" />
<property name="processing.demo.zipball" value="${dist.dir}/${project.name}-processing-demo-${version.num}.zip" />
<property name="ant.build.javac.source" value="1.6" />
<property name="ant.build.javac.target" value="1.6" />
<buildnumber />
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<property name="debug.flag" value="off" />
<!--Default target-->
<target name="default" depends="clean,dist" />
<!--All targets-->
<target name="all" depends="clean,dist,test" />
<!--Clean targets-->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${temp.dir}" />
<delete>
<fileset dir="." includes="TEST*.txt" />
</delete>
</target>
<target name="clean_dist" depends="clean">
<delete dir="${dist.dir}" />
</target>
<target name="clean_all" depends="clean,clean_dist" />
<!--Initialization targets-->
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${bin.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${test.dir}" />
<mkdir dir="${temp.dir}" />
</target>
<!--Documentation targets-->
<target name="doc" depends="javadoc" />
<target name="javadoc">
<javadoc destdir="${doc.dir}" classpathref="classpath" Overview="doc_includes/overview.htm" sourcepath="${src.dir}">
<package name="edu.stanford.math.plex4" />
<fileset dir="${src.dir}" />
</javadoc>
<copy file="doc_includes/update_mime_types.sh" tofile="${doc.dir}/update_mime_types.sh" />
</target>
<!--Bin targets-->
<target name="classes" depends="init">
<javac destdir="${bin.dir}" classpathref="classpath" debug="${debug.flag}" includeAntRuntime="false" source="1.6" target="1.6">
<compilerarg value="-Xlint" />
<src>
<pathelement path="${src.dir}" />
</src>
</javac>
</target>
<!--Distribution targets-->
<target name="dist" depends="clean_dist,runnable_jar,doc_tar,source_dist,matlab_dist,processing_dist" />
<target name="doc_tar">
<tar destfile="${doc.tarball}" compression="gzip">
<tarfileset dir="doc" prefix="javadoc">
<include name="bshmanual.pdf" />
<include name="stylesheet.css" />
<include name="*.html" />
<include name="**/*.html" />
</tarfileset>
</tar>
<zip destfile="${doc.zipball}">
<zipfileset dir="doc" prefix="javadoc">
<include name="bshmanual.pdf" />
<include name="stylesheet.css" />
<include name="*.html" />
<include name="**/*.html" />
</zipfileset>
</zip>
</target>
<target name="source_dist">
<tar destfile="${source.tarball}" compression="gzip">
<tarfileset dir="${src.dir}/java" prefix="src/java">
<include name="**" />
<exclude name="**.svn/**" />
</tarfileset>
</tar>
<zip destfile="${source.zipball}">
<zipfileset dir="${src.dir}/java" prefix="src/java">
<include name="**" />
<exclude name="**.svn/**" />
</zipfileset>
</zip>
</target>
<!--Runnable jar file-->
<target name="runnable_jar" depends="classes">
<jar destfile="${runnable.jar}" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="edu.stanford.math.plex4.api.Plex4" />
<attribute name="Class-Path" value="." />
</manifest>
<fileset dir="${bin.dir}" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/bsh-2.0b4.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/colt.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jai_codec.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/trove-2.1.0.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/primitive-lib.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/velocity-1.6.4-dep.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/commons-math-2.1.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/junit-4.9b1.jar" />
</jar>
</target>
<target name="matlab_dist" depends="runnable_jar">
<copy file="${runnable.jar}" tofile="${matlab.lib.dir}/javaplex.jar" />
<tar destfile="${matlab.tarball}" compression="gzip">
<tarfileset dir="src/matlab/for_distribution" prefix="matlab_examples" preserveLeadingSlashes="true">
<include name="**" />
</tarfileset>
</tar>
<zip destfile="${matlab.zipball}">
<zipfileset dir="src/matlab/for_distribution" prefix="matlab_examples">
<include name="**" />
</zipfileset>
</zip>
</target>
<target name="processing_dist" depends="runnable_jar">
<mkdir dir="${processing.build.dir}" />
<copy file="${runnable.jar}" tofile="${processing.jar}" />
<copy todir="${processing.build.dir}">
<fileset dir="${processing.src.dir}" />
<filterset>
<filter token="VERSION" value="${build.number}" />
<filter token="PRETTYVERSION" value="${version.num}" />
</filterset>
</copy>
<zip destfile="${processing.zipball}">
<zipfileset dir="${processing.build.dir}" prefix="javaplex">
<include name="**" />
</zipfileset>
</zip>
<zip destfile="${processing.demo.zipball}">
<zipfileset dir="${processing.demo.src.dir}" prefix="javaplexDemo">
<include name="**" />
</zipfileset>
</zip>
</target>
<!--Basic Jar file-->
<target name="basic_jar" depends="classes">
<jar destfile="${basic.jar}" basedir="${bin.dir}">
</jar>
</target>
<!--Test targets-->
<target name="test.jar" depends="basic_jar">
<javac destdir="${test.dir}" srcdir="${src_test.dir}" debug="${debug.flag}" includeantruntime="false">
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${basic.jar}" />
</classpath>
<compilerarg value="-Xlint" />
</javac>
<jar destfile="${tests.jar}" basedir="${test.dir}" />
</target>
<target name="test" depends="test.jar">
<delete>
<fileset dir="." includes="TEST*.txt" />
</delete>
<junit fork="yes" timeout="1200000" tempdir="${temp.dir}">
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${tests.jar}" />
<pathelement location="${basic.jar}" />
</classpath>
<formatter type="brief" />
<batchtest todir="${temp.dir}">
<fileset dir="${test.dir}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<!-- Build visualization apps (uses Processing) -->
<target name="homviz_build" depends="runnable_jar" description="Builds a jar for the Homologty Visualizer applet">
<property name="app.dir" value="${src.dir}/homviz" />
<property name="app.lib.dir" value="${app.dir}/lib" />
<delete dir="${app.dir}" />
<mkdir dir="${app.dir}" />
<mkdir dir="${app.lib.dir}" />
<copy file="${lib.dir}/core.jar" todir="${app.lib.dir}" />
<copy file="${runnable.jar}" tofile="${app.lib.dir}/javaplex.jar" />
<jar destfile="${app.dir}/homviz.jar">
<fileset dir="bin/edu/stanford/math/plex4/visualization">
<include name="**/*.class" />
</fileset>
<manifest>
<attribute name="Main-Class" value="edu.stanford.math.plex4.visualization.HomologyVisualizer" />
<attribute name="Class-Path" value="lib/core.jar lib/javaplex.jar" />
</manifest>
</jar>
<jar destfile="${app.dir}/homgenviz.jar">
<fileset dir="bin/edu/stanford/math/plex4/visualization">
<include name="**/*.class" />
</fileset>
<manifest>
<attribute name="Main-Class" value="edu.stanford.math.plex4.visualization.HomologyGeneratorVisualizer" />
<attribute name="Class-Path" value="lib/core.jar lib/javaplex.jar" />
</manifest>
</jar>
</target>
</project>