-
Notifications
You must be signed in to change notification settings - Fork 481
/
build.xml
78 lines (67 loc) · 2.3 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
<project name="Computer Science I - GitHub Assignment" basedir="." default="run-demo">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="report.dir" value="report"/>
<property name="demo" value="unl.cse.kaprekar.KaprekarDemo"/>
<property name="test.junit" value="unl.cse.kaprekar.TestKaprekarUtils"/>
<property name="test.adhoc" value="unl.cse.kaprekar.AutomatedAdHocTest"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<path id="junit-libs">
<fileset dir="lib">
<include name="junit-4.12.jar" />
<include name="hamcrest-core-1.3.jar" />
</fileset>
</path>
<!-- executable and fork properties added as a workaround for CSE's ant configuration -->
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac includeantruntime="false"
executable="/usr/bin/javac"
fork="true"
srcdir="${src.dir}"
destdir="${classes.dir}">
<classpath refid="junit-libs"/>
</javac>
</target>
<path id="run.path">
<pathelement path="${classes.dir}"/>
</path>
<target name="run-demo">
<input
message="Enter n:"
addproperty="demo.value"
defaultvalue="1"
/>
<java classname="${demo}"
fork="false">
<classpath refid="run.path"/>
<arg value="${demo.value}"/>
</java>
</target>
<target name="run-adhoc">
<java classname="${test.adhoc}"
fork="false">
<classpath refid="run.path"/>
</java>
</target>
<!-- This appears not to work on CSE; ant is using an old (version 3.8)
system-wide junit JAR and does not respect the JARs in junit-libs.
As a consequence, the Parameterized JUnit tests will not run properly.
-->
<target name="junit" depends="compile">
<junit printsummary="yes" haltonfailure="no">
<classpath location="${classes.dir}">
<path refid="junit-libs"/>
</classpath>
<test name="unl.cse.kaprekar.TestKaprekarUtils"
haltonfailure="no"
todir="${report.dir}">
<formatter type="plain" />
<formatter type="xml" />
</test>
</junit>
</target>
</project>