-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
80 lines (71 loc) · 2.14 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
<project name="TraceDFA" default="run" basedir=".">
<!-- Settings -->
<property name="debugging" value="false"/>
<property name="doc-level" value="protected"/>
<!-- Names -->
<property name="train" location="traces/train"/>
<property name="test" location="traces/test"/>
<property name="src.dir" location="src"/>
<property name="build.dir" location="build"/>
<property name="lib.dir" location="lib"/>
<property name="doc.dir" value="doc"/>
<property name="main-class" value="Main"/>
<property name="jar-name" value="${ant.project.name}.jar"/>
<path id="libs.path">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Targets -->
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${doc.dir}"/>
</target>
<target name="doc">
<javadoc sourcepath="${src.dir}"
sourcefiles="${src.dir}/${main-class}.java" destdir="${doc.dir}"
access="${doc-level}" use="true">
<classpath refid="libs.path"/>
</javadoc>
</target>
<target name="build">
<mkdir dir="${build.dir}/classes"/>
<javac srcdir="${src.dir}" destdir="${build.dir}/classes"
includeantruntime="false" debug="${debugging}"
debuglevel="lines,vars,source">
<classpath refid="libs.path"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="run" depends="build">
<java classname="${main-class}">
<classpath>
<pathelement path="${build.dir}/classes"/>
<path refid="libs.path"/>
</classpath>
<arg value="${train}"/>
<arg value="${test}"/>
</java>
</target>
<!-- Creates a jar with the compiled code and all downloaded libraries -->
<target name="release-jar" depends="build">
<mkdir dir="${build.dir}/lib-jars"/>
<unjar dest="${build.dir}/lib-jars">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</unjar>
<jar destfile="${build.dir}/${jar-name}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<fileset dir="${build.dir}/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="${build.dir}/lib-jars">
<include name="**/*.class"/>
<depth min="1"/>
</fileset>
</jar>
</target>
</project>