-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
88 lines (76 loc) · 2.83 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
<project name="cis501-homework" default="jar">
<property name="lib.dir" value="lib"/>
<property name="src.dir" value="src"/>
<property name="test.dir" value="test"/>
<property name="target.dir" value="target"/>
<property name="classes.dir" value="${target.dir}/classes"/>
<property name="jar.dir" value="${target.dir}/jar"/>
<property name="testreport.dir" value="junit-report"/>
<path id="libClasspath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<path id="appClasspath">
<pathelement location="${classes.dir}"/>
</path>
<!-- Some magic needed to get the junit task on SEAS machines -->
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath refid="libClasspath"/>
</taskdef>
<!-- Remove compiled code. -->
<target name="clean">
<delete dir="${target.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<!-- compile application -->
<javac srcdir="${src.dir}/" destdir="${classes.dir}"
classpathref="libClasspath"
includeAntRuntime="false"
debug="true" debuglevel="lines,vars,source"
source="1.8" target="1.8"/>
<!-- compile tests -->
<javac srcdir="${test.dir}/" destdir="${classes.dir}"
classpathref="libClasspath"
includeAntRuntime="false"
debug="true" debuglevel="lines,vars,source"
source="1.8" target="1.8"/>
</target>
<!-- Build a .jar file that contains source code and class files. -->
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/cis501-homework.jar" >
<fileset dir="${classes.dir}"/>
<fileset dir="${src.dir}"/>
<manifest>
<attribute name="Main-Class" value="cis501.submission.TraceRunner"/>
</manifest>
</jar>
</target>
<!-- You can use this target to run your simulator. -->
<target name="run" depends="compile">
<java classname="cis501.submission.TraceRunner" fork="true">
<classpath>
<path refid="libClasspath"/>
<path refid="appClasspath"/>
</classpath>
<jvmarg line="-enableassertions"/> <!-- turn on Java assertions for easier debugging -->
<arg value="/path/to/trace/file"/> <!-- TODO: set path to trace file -->
<arg value="-1"/> <!-- run on entire trace file -->
</java>
</target>
<!-- Run test cases. -->
<target name="test" depends="compile">
<mkdir dir="${testreport.dir}"/>
<junit printsummary="yes" haltonfailure="no">
<classpath>
<path refid="libClasspath"/>
<path refid="appClasspath"/>
</classpath>
<formatter type="plain"/>
<batchtest fork="yes" todir="${testreport.dir}">
<fileset dir="${test.dir}/" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
</project>