-
Notifications
You must be signed in to change notification settings - Fork 105
/
build.xml
124 lines (113 loc) · 5.46 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
<project name="WekaWrapper">
<!-- Include user specified props -->
<property file="build.properties" />
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="class.dir" value="${build.dir}/classes" />
<property name="testclass.dir" value="${build.dir}/testclasses" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="dist.dir" value="${build.dir}/dist" />
<property name="doc.dir" value="doc" />
<property name="javadoc.dir" value="${doc.dir}/javadoc" />
<property name="man.dir" value="${doc.dir}/manual" />
<!-- Setup the classpath -->
<path id="classpath">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<path id="test.classpath">
<fileset dir="." includes="autoweka.jar"/>
<fileset dir="${lib.dir}" includes="weka.jar"/>
<fileset dir="${lib.dir}/test" includes="*.jar"/>
<pathelement path="${testclass.dir}" />
</path>
<!-- Clean target -->
<target name="clean" description="Removes all build files">
<delete dir="${build.dir}"/>
<delete file="autoweka.zip"/>
<delete file="autoweka.jar"/>
<delete>
<fileset dir="${man.dir}" includes="*.pdf"/>
<fileset dir="${man.dir}" includes="*.aux"/>
<fileset dir="${man.dir}" includes="*.log"/>
<fileset dir="${man.dir}" includes="*.out"/>
<fileset dir="${man.dir}" includes="*.toc"/>
</delete>
</target>
<target name="weka-package" depends='doc,manual,jar' description="Builds the Weka package">
<delete file="autoweka.zip"/>
<zip destfile="autoweka.zip"
basedir="."
excludes=".git/, .travis.yml, *.sh, wizardexperiments/, scripts/, *.tar.gz, lib/*.jar">
</zip>
</target>
<!-- Compile all the Autoweka code -->
<target name="compile" description="Compiles the source code">
<mkdir dir="${class.dir}"/>
<javac srcdir="src/java" destdir="${class.dir}" classpathref="classpath" includeantruntime="false" target="1.6" source="1.6" debug="true" />
<copy todir="${class.dir}">
<fileset dir="src/java" includes="**/*.yml"/>
<fileset dir="src/java" includes="**/*.png"/>
<fileset dir="src/java" includes="**/*.properties"/>
</copy>
</target>
<!-- Build some javadoc -->
<target name="doc" description="Generates the javadoc">
<mkdir dir="${javadoc.dir}"/>
<javadoc sourcepath="src/java" classpathref="classpath" destdir="${javadoc.dir}"/>
</target>
<!-- Build User guide from Tex sources -->
<target name="manual" description="Generate the user manual (LaTeX -> PDF)">
<exec executable="ruby" dir='${man.dir}' output="${man.dir}/params.tex">
<arg value="getParams.rb"/>
<arg value="../../params"/>
</exec>
<exec executable="dia" dir='${man.dir}'>
<arg value="--export"/>
<arg value="devel-overview-crop.pdf"/>
<arg value="devel-overview.dia"/>
</exec>
<exec executable="xelatex" dir='${man.dir}'>
<arg value="manual.tex"/>
</exec>
<exec executable="xelatex" dir='${man.dir}'>
<arg value="manual.tex"/>
</exec>
</target>
<!-- Build the actual jar -->
<target name="jar" depends='compile' description="Builds the jar file">
<jar destfile="autoweka.jar" basedir="${class.dir}">
<zipfileset dir="lib" includes="*.properties" />
<zipgroupfileset dir="lib" includes="*.jar" excludes="weka.jar"/>
</jar>
</target>
<target name="dist" depends="doc,manual,jar" description="Generates the distribution tar ball">
<tar destfile="autoweka-dist.tar.gz" compression="gzip">
<tarfileset dir="${jar.dir}" includes="*.jar" />
<tarfileset dir="${lib.dir}" includes="*.jar" prefix="lib" />
<tarfileset dir="params" includes="**/*" prefix="params" />
<tarfileset dir="scripts" includes="**/*" prefix="scripts" filemode="755" />
<tarfileset dir="src" includes="**/*" prefix="src" />
<tarfileset dir="." includes="build.xml" />
<tarfileset dir="." includes="autoweka.jar" />
<tarfileset dir="weka" includes="autoweka.patch" />
<!--<tarfileset dir="datasets/classification" includes="creditg.arff" prefix="datasets" />-->
<tarfileset dir="${doc.dir}/javadoc" includes="**/*" prefix="doc" />
<tarfileset dir="${man.dir}" includes="manual.pdf" />
<tarfileset dir="defaultprops" includes="*" prefix="" />
</tar>
</target>
<!-- Run some tests -->
<target name="compile-tests" depends="jar" description="Compiles the unit tests">
<mkdir dir="${testclass.dir}"/>
<javac srcdir="test/java" destdir="${testclass.dir}" classpathref="test.classpath" includeantruntime="false" target="1.8" source="1.8" debug="true"/>
</target>
<!-- Run some tests -->
<target name="test" depends="compile-tests" description="Executes the unit tests">
<junit haltonfailure="yes" fork="yes" showoutput="true">
<classpath refid="test.classpath"/>
<test name="autoweka.AutoWEKATestSuite"/>
<test name="weka.classifiers.meta.AutoWEKAClassifierTest"/>
<formatter type="plain" usefile="false"/>
</junit>
</target>
</project>