/
build.xml
85 lines (64 loc) · 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
<?xml version="1.0"?>
<!-- Build file for Joshua. Last changed: $LastChangedDate$ -->
<project name="JHU Decoder" default="compile" basedir=".">
<property name="src" value="./src" />
<property name="test" value="./test" />
<property name="build" value="./bin" />
<property name="doc" value="./javadoc" />
<property name="testng" value="./lib/testng-5.8-jdk15.jar"/>
<!-- Define the unit testing task -->
<taskdef resource="testngtasks" classpath="${testng}"/>
<!-- Create the build directory for compiled class files -->
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>
<!-- Compile the Java code -->
<target name="compile" depends="init">
<javac compiler="javac1.5" srcdir="${src}" destdir="${build}" debug="on"/>
</target>
<!-- Compile the Javadocs into web pages -->
<target name="javadoc">
<mkdir dir="${doc}"/>
<javadoc packagenames="edu.*"
sourcepath="${src}"
destdir="${doc}"
author="true"
version="true"
/>
</target>
<!-- Delete the compiled files -->
<target name="clean">
<delete verbose="true">
<fileset dir="${build}">
<include name="**/*.class"/>
</fileset>
</delete>
</target>
<!-- Create a JAR file of the compiled classes -->
<target name="jar" depends="compile">
<jar destfile="${build}/joshua.jar">
<fileset dir="${build}">
<include name="**/*.class"/>
</fileset>
</jar>
</target>
<!-- Create a JAR file of the source code -->
<target name="source-jar">
<jar destfile="${build}/joshua-src.jar">
<fileset dir="${build}">
<include name="**/*.java"/>
</fileset>
</jar>
</target>
<!-- Compile the unit test code -->
<target name="compile-tests" depends="init">
<javac compiler="javac1.5" srcdir="${test}" destdir="${build}" classpath="${testng}" debug="on"/>
</target>
<!-- Run the unit tests -->
<target name="test" depends="compile,compile-tests">
<testng classpath="bin" sourcedir="test">
<xmlfileset dir="." includes="testng.xml"/>
</testng>
</target>
</project>