-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.xml
392 lines (344 loc) · 13.2 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
<project name="HMMWeka" default="compile" basedir=".">
<!--
===========================================================================
Ant build file for weka a weka package.
Type ant -projecthelp for targets and descriptions.
$Revision: 6663 $
===========================================================================
-->
<!-- set global properties for this build -->
<property name="src" value="src/main/java"/>
<property name="src-test" value="src/test"/>
<property name="lib" value="lib" />
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="doc" value="doc"/>
<property name="web" value="web"/>
<property name="javac_max_memory" value="256m"/>
<property name="debug" value="on" />
<property name="package" value="HMM" />
<property name="project.name" value="HMMWeka" />
<property name="project.packagename" value="HMM" />
<property name="project.version" value="0.1.1" />
<property name="project.copyright" value="(c) 2010" />
<property name="project.dependencies" value="none" />
<property name="project.keywords" value="machine learning, sequence learning, hidden markov model, gesture recognition" />
<property name="author.name" value="Marco Gillies" />
<property name="author.url" value="http://doc.gold.ac.uk/~mas02mg" />
<property name="tested.platform" value="osx" />
<property name="tested.wekaversion" value="3.7.3" />
<property name="source.host" value="github" />
<property name="source.url" value="https://github.com/marcogillies/HMMWeka" />
<property name="source.repository" value="https://github.com/marcogillies/HMMWeka" />
<target name="init_all">
<!-- Create the time stamp -->
<tstamp/>
</target>
<!-- general classpath definition, incl. CLASSPATH env. variable,
// but jars in lib directory have precedence over the CLASSPATH variable -->
<path id="project.class.path">
<fileset dir="${lib}">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
<pathelement location="${build}/classes"/>
<pathelement location="${build}/testcases"/>
<pathelement path="${java.class.path}" />
</path>
<!-- Create the time stamp -->
<tstamp>
<format property="date" pattern="MM/dd/yyyy" offset="0" unit="hour"/>
</tstamp>
<!--
============================================================================
Compilation and documentation making stuff
============================================================================
-->
<target name="init_compile" depends="init_all">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}/classes"/>
</target>
<!-- Compile the java code from ${src}/weka into ${build}/classes -->
<target name="compile" depends="init_compile"
description="Compile package and deposit class files in build/classes">
<javac srcdir="${src}"
fork="yes" memoryMaximumSize="${javac_max_memory}"
destdir="${build}/classes"
optimize="${optimization}"
debug="${debug}"
deprecation="${deprecation}"
source="1.6" target="1.6">
<classpath refid="project.class.path" />
</javac>
<copy todir="${build}/classes" >
<fileset dir="${src}">
<include name="**/*.gif"/>
<include name="**/*.png"/>
<include name="**/*.jpeg"/>
<include name="**/*.jpg"/>
<include name="**/*.props"/>
<include name="**/*.txt"/>
<include name="**/*.xml"/>
<include name="**/*.cup"/>
<include name="**/*.flex"/>
<include name="**/*.jflex"/>
<include name="**/*.properties"/>
<include name="**/*.default"/>
</fileset>
</copy>
</target>
<!-- Make the javadocs -->
<target name="docs"
depends="init_all"
description="Make javadocs into ./doc">
<mkdir dir="${doc}"/>
<javadoc sourcepath="${src}"
classpathref="project.class.path"
destdir="${doc}"
Author="yes"
Public="yes"
link="http://weka.sourceforge.net/doc.dev/"
maxmemory="256m"/>
</target>
<!--
===========================================================================
Unit testing stuff
===========================================================================
-->
<!-- Junit testing initialization -->
<target name="init_tests" depends="init_all">
<available property="junit.present" classname="junit.framework.TestCase"/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}/testcases"/>
<!-- make this if it doesn't exist so that the compile_test task doesn't faile for
stuff that doesn't have test cases -->
<mkdir dir="${src-test}"/>
</target>
<!-- compile the testcases -->
<target name="compile_tests" depends="init_tests, compile"
description="Compile unit tests into build/testcases">
<javac srcdir="${src-test}"
fork="yes" memoryMaximumSize="${javac_max_memory}"
destdir="${build}/testcases"
optimize="${optimization}"
debug="${debug}"
deprecation="${deprecation}"
source="1.6" target="1.6">
<classpath refid="project.class.path" />
</javac>
<copy todir="${build}/testcases" >
<fileset dir="${src-test}">
<include name="**/*.arff"/>
<include name="**/*.cost"/>
<include name="**/*.xml"/>
<include name="**/*.matrix"/>
</fileset>
</copy>
</target>
<!-- Put everything in ${build}/testcases into the ${package}-tests.jar file -->
<target name="jar_tests" depends="compile_tests, init_dist"
description="Creates a jar file with the test cases in ./dist. Run with -Dpackage=[package name]">
<jar jarfile="${dist}/${package}-tests.jar"
basedir="${build}/testcases">
</jar>
</target>
<target name="run_tests" depends="jar_tests"
description="runs the junit tests">
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<fileset dir="${lib}">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
<pathelement location="${build}/classes"/>
<pathelement location="${build}/testcases"/>
<pathelement path="${java.class.path}" />
</classpath>
<test name="weka.estimators.TestDiscreteHMMEstimator"
haltonfailure="no" outfile="TestDiscreteHMMEstimator.result">
<formatter type="plain"/>
</test>
<test name="weka.classifiers.bayes.TestHMMClassifiers"
haltonfailure="no" outfile="TestHMMClassifiers.result">
<formatter type="plain"/>
</test>
<test name="weka.estimators.TestMultivariateNormalEstimator"
haltonfailure="no" outfile="TestMultivariateNormalEstimator.result">
<formatter type="plain"/>
</test>
<!--test name="weka.estimators.TestMultivariateNormalHMMEstimator"
haltonfailure="no" outfile="TestMultivariateNormalHMMEstimator.result">
<formatter type="plain"/>
</test-->
</junit>
</target>
<!--
===========================================================================
Release making stuff
===========================================================================
-->
<target name = "init_dist" depends="init_all">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
</target>
<!-- Put everything in ${build}/classes into the ${package}.jar file -->
<target name="exejar" depends="compile, docs, init_dist"
description="Create a binary jar file in ./dist">
<jar jarfile="${dist}/${package}.jar"
basedir="${build}/classes">
</jar>
</target>
<target name="make_package" depends="exejar" description="Make the package zip file. Run with -Dpackage=[package name]">
<mkdir dir="${dist}/${package}"/>
<copy todir="${dist}/${package}">
<fileset dir="${dist}">
<include name="*.jar"/>
</fileset>
</copy>
<delete>
<fileset dir="${dist}">
<include name="*.jar"/>
</fileset>
</delete>
<copy file="Description.props"
todir="${dist}/${package}"/>
<mkdir dir="${dist}/${package}/lib"/>
<copy todir="${dist}/${package}/lib" >
<fileset dir="${lib}">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
</copy>
<mkdir dir="${dist}/${package}/doc"/>
<copy todir="${dist}/${package}/doc" >
<fileset dir="${doc}">
<include name="**/*"/>
</fileset>
</copy>
<mkdir dir="${dist}/${package}/src"/>
<copy todir="${dist}" >
<fileset dir="${web}">
<include name="**/*"/>
</fileset>
</copy>
<replaceregexp file="${dist}/index.html"
match="##project.name##"
replace="${project.name}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##project.packagename##"
replace="${project.packagename}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##author.name##"
replace="${author.name}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##project.version##"
replace="${project.version}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##author.url##"
replace="${author.url}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##date##"
replace="${date}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##project.keywords##"
replace="${project.keywords}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##tested.platform##"
replace="${tested.platform}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##tested.wekaversion##"
replace="${tested.wekaversion}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##project.dependencies##"
replace="${project.dependencies}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##source.host##"
replace="${source.host}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##source.url##"
replace="${source.url}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##source.repository##"
replace="${source.repository}"
flags="g" />
<replaceregexp file="${dist}/index.html"
match="##project.copyright##"
replace="${project.copyright}"
flags="g" />
<copy todir="${dist}/${package}" >
<fileset dir=".">
<include name="*.xml"/>
<include name="src/**/*.excludes"/>
<include name="src/**/*.gif"/>
<include name="src/**/*.java"/>
<include name="src/**/*.jpeg"/>
<include name="src/**/*.jpg"/>
<include name="src/**/*.props"/>
<include name="src/**/*.txt"/>
<include name="src/**/*.xml"/>
<include name="src/**/*.cup"/>
<include name="src/**/*.flex"/>
<include name="src/**/*.jflex"/>
<include name="src/**/*.properties"/>
<include name="src/**/*.default"/>
<include name="src/**/*.cost"/>
<include name="src/**/*.arff"/>
<include name="src/**/*.matrix"/>
</fileset>
</copy>
<zip destfile="${dist}/${package}.zip"
basedir="${dist}/${package}">
</zip>
</target>
<!-- Put all .java, and .props files into ${dist}/${package}-src.jar-->
<target name="srcjar" depends="init_dist, init_all"
description="Create a jar file containing weka source in ./dist. Run with -Dpackage=[package name]">
<!-- jar up the source -->
<jar jarfile="${dist}/${package}-src.jar"
basedir=".">
<include name="*.xml"/>
<include name="src/**/*.excludes"/>
<include name="src/**/*.gif"/>
<include name="src/**/*.java"/>
<include name="src/**/*.jpeg"/>
<include name="src/**/*.jpg"/>
<include name="src/**/*.props"/>
<include name="src/**/*.txt"/>
<include name="src/**/*.xml"/>
<include name="src/**/*.cup"/>
<include name="src/**/*.flex"/>
<include name="src/**/*.jflex"/>
<include name="src/**/*.properties"/>
<include name="src/**/*.default"/>
<include name="src/**/*.cost"/>
<include name="src/**/*.arff"/>
<include name="src/**/*.matrix"/>
<include name="lib/**/*.jar"/>
</jar>
</target>
<!-- Clean -->
<target name="clean" depends="init_all"
description="Removes the build, dist and reports directories">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="superclean" depends="clean"
description="Clean plus removes source trees! and doc directories">
<!-- WARNING, this deletes the source and doc directories -->
<delete dir="${src}"/>
<delete dir="${doc}"/>
</target>
</project>