-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
64 lines (51 loc) · 1.75 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
<project name="TravelingSalesman" default="help" basedir=".">
<property name="sourceDirectory" value="src"/>
<property name="testSourceDirectory" value="test"/>
<property name="buildDirectory" value="build"/>
<property name="junit-jar" value="lib/junit-4.11.jar"/>
<property name="hamcrest-jar" value="lib/hamcrest-core-1.1.jar"/>
<path id="classPath">
<pathelement location="${buildDirectory}"/>
<pathelement location="${junit-jar}"/>
<pathelement location="${hamcrest-jar}"/>
</path>
<target name="help">
<echo>
Targets:
clean: delete compiled files
build: compiles all code
runTests: runs the tests
run: runs the program
</echo>
</target>
<target name="clean">
<delete dir="${buildDirectory}"/>
</target>
<target name="prepare">
<mkdir dir="${buildDirectory}"/>
</target>
<target name="buildSource" depends="prepare">
<javac srcdir="${sourceDirectory}" destdir="${buildDirectory}" includeantruntime="false">
<classpath refid="classPath"/>
</javac>
</target>
<target name="buildTest" depends="buildSource">
<javac srcdir="${testSourceDirectory}" destdir="${buildDirectory}" includeantruntime="false">
<classpath refid="classPath"/>
</javac>
</target>
<target name="build" depends="buildSource,buildTest"/>
<target name="runTests" depends="build">
<java classname="org.junit.runner.JUnitCore">
<arg value="travelingSalesman.TestMachine"/>
<classpath refid="classPath"/>
</java>
</target>
<target name="run" depends="build">
<java fork="true" classname="travelingSalesman.Machine">
<classpath>
<path refid="classPath"/>
</classpath>
</java>
</target>
</project>