-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·205 lines (189 loc) · 7.71 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
<?xml version="1.0"?>
<project name="meka" default="compile" basedir=".">
<!-- directories -->
<property name="src" value="src/main/java"/>
<property name="src-tests" value="src/test/java"/>
<property name="src-latex" value="src/main/latex"/>
<property name="resources" value="src/main/resources"/>
<property name="resources-tests" value="src/test/resources"/>
<property name="build" value="target/classes"/>
<property name="build-tests" value="target/test-classes"/>
<property name="javadoc" value="doc/api"/>
<property name="target" value="target"/>
<property name="lib" value="lib"/>
<property name="all" value="."/>
<property name="scripts" value="scripts"/>
<property name="release" value="target"/>
<property name="mainclass" value="meka.gui.explorer.Explorer"/>
<property name="memory" value="512m"/>
<property name="version" value="1.7.6"/>
<!-- CLASSPATH -->
<path id="project.class.path">
<pathelement location="." />
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean" description="Removes the build directory, generated jars and temp files.">
<delete dir="${build}" failonerror="false"/>
<delete dir="${javadoc}"/>
<delete>
<fileset dir="${basedir}" includes="*.jar"/>
<fileset dir="${basedir}" includes="*.zip"/>
</delete>
<delete defaultexcludes="no">
<fileset dir="${basedir}" includes="**/*~" defaultexcludes="no"/>
<fileset dir="${basedir}" includes="**/.DS_Store" defaultexcludes="no"/>
<fileset dir="${basedir}" includes="hs_err_pid*"/>
</delete>
<delete>
<fileset dir="${basedir}" includes="temp_Testdata_*.arff"/>
</delete>
<delete>
<fileset dir="${src-latex}" includes="**/*.aux"/>
<fileset dir="${src-latex}" includes="**/*.blg"/>
<fileset dir="${src-latex}" includes="**/*.dvi"/>
<fileset dir="${src-latex}" includes="**/*.out"/>
<fileset dir="${src-latex}" includes="**/*.log"/>
<fileset dir="${src-latex}" includes="**/*.pdf"/>
<fileset dir="${src-latex}" includes="**/*.toc"/>
</delete>
</target>
<target name="init">
<mkdir dir="${build}"/>
<copy todir="${build}" >
<fileset dir="${resources}">
<include name="**/*.*"/>
</fileset>
</copy>
<mkdir dir="${build-tests}"/>
<copy todir="${build-tests}" >
<fileset dir="${resources-tests}">
<include name="**/*.*"/>
</fileset>
</copy>
</target>
<target name="compile" depends="init" description="Compiles the source code.">
<javac srcdir="${src}"
destdir="${build}"
debug="true"
debuglevel="lines,vars,source"
classpathref="project.class.path"
source="1.6" target="1.6">
</javac>
<javac srcdir="${src-tests}"
destdir="${build-tests}"
debug="true"
debuglevel="lines,vars,source"
source="1.6" target="1.6">
<classpath>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<pathelement path="${build}"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<jar destfile="${target}/meka-${version}.jar"
basedir="${build}/"
includes="weka/** meka/** moa/** rbms/**">
<manifest>
<attribute name="Main-Class" value="meka.gui.explorer.Explorer"/>
</manifest>
</jar>
<jar destfile="${target}/meka-${version}-tests.jar"
basedir="${build-tests}/"
includes="weka/** meka/** moa/** rbms/**">
</jar>
</target>
<target name="tests" depends="compile" description="Executes the tests.">
<java fork="yes" dir="."
classname="junit.textui.TestRunner"
taskname="junit" failonerror="true">
<arg value="meka.MekaTests"/>
<classpath>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<pathelement path="${build}"/>
<pathelement path="${build-tests}"/>
</classpath>
<jvmarg value="-Duser.timezone=Pacific/Auckland"/>
</java>
<delete>
<fileset dir="${basedir}" includes="temp_Testdata_*.arff"/>
</delete>
</target>
<target name="src-jar" description="Creates a source archive.">
<jar destfile="${target}/meka-src-${version}.jar">
<zipfileset dir="${src}" prefix="src/main/java"/>
<zipfileset dir="${resources}" prefix="src/main/resources"/>
<zipfileset dir="${src-tests}" prefix="src/test/java"/>
<zipfileset dir="${resources-tests}" prefix="src/test/resources"/>
<fileset file="build.xml"/>
<fileset file="LICENSE.txt"/>
<fileset file="README.txt"/>
</jar>
</target>
<target name="full-jar" description="Creates full archive.">
<jar destfile="${target}/meka-full-${version}.jar" basedir="${all}/"/>
</target>
<target name="javadoc" description="Generate Javadoc documentation.">
<javadoc
classpathref = "project.class.path"
access = "public"
defaultexcludes = "yes"
excludepackagenames = "weka, moa, rbms"
use = "yes"
header = "MEKA ${version}"
doctitle = "MEKA - Multi-label Extension to weKA"
nodeprecatedlist = "yes"
sourcepath = "${src}"
destdir = "${javadoc}"
/>
</target>
<target name="javadoc-jar" depends="javadoc" description="Creates an archive from the Javadoc.">
<zip destfile="${target}/meka-javadoc-${version}.zip" basedir="${javadoc}/"/>
</target>
<target name="all" depends="jar, src-jar, javadoc-jar" description="Generates all jars."/>
<target name="latex" depends="init" description="Generates the LaTeX documentation.">
<!-- tutorial -->
<exec executable="pdflatex" dir="${src-latex}/tutorial">
<arg value="Tutorial.tex"/>
</exec>
<exec executable="pdflatex" dir="${src-latex}/tutorial">
<arg value="Tutorial.tex"/>
</exec>
<copy todir="${target}" >
<fileset dir="${src-latex}/tutorial">
<include name="Tutorial.pdf"/>
</fileset>
</copy>
</target>
<target name="release" depends="clean, all, tests, latex" description="Generates a release archive.">
<delete file="${release}/meka-release-${version}.zip"/>
<zip destfile="${release}/meka-release-${version}.zip">
<zipfileset dir="${basedir}" includes="README.txt" prefix="meka-${version}"/>
<zipfileset dir="${basedir}" includes="LICENSE.txt" prefix="meka-${version}"/>
<zipfileset dir="${target}" includes="*.pdf" prefix="meka-${version}"/>
<zipfileset dir="${target}" includes="meka-src-${version}.jar" prefix="meka-${version}"/>
<zipfileset dir="${target}" includes="meka-${version}.jar" prefix="meka-${version}/lib"/>
<zipfileset dir="${basedir}" includes="lib/*.jar" prefix="meka-${version}"/>
<zipfileset dir="${basedir}" includes="lib/README.txt" prefix="meka-${version}"/>
<zipfileset dir="${basedir}" includes="data/*.*" prefix="meka-${version}"/>
<zipfileset dir="${javadoc}" prefix="meka-${version}/api"/>
<zipfileset dir="${scripts}" prefix="meka-${version}" filemode="755"/>
</zip>
</target>
<target name="run" depends="compile" description="Starts the GUI.">
<java classname="${mainclass}" fork="true" maxmemory="${memory}">
<classpath>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<pathelement path="${build}"/>
</classpath>
</java>
</target>
</project>