-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
84 lines (69 loc) · 2.71 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
<project name="AntJavaProject" default="main" basedir=".">
<description>
Implement the popular pattern matching game named Set.
</description>
<property name="projectName" value="GameOfSet" />
<property name="src.dir" location="src" />
<property name="build.dir" location="bin" />
<property name="dist.dir" location="dist" />
<property name="test.src.dir" value="test/src" />
<property name="test.build.dir" value="test/build" />
<property name="resources.dir" value="resources" />
<path id="classpath.test">
<pathelement location="lib/junit-4.12.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
<pathelement location="${build.dir}"/>
<pathelement location="${test.build.dir}"/>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}" />
</target>
<target name="compile" depends="init" description="compile the source ">
<!-- Compile the java code from ${src.dir} into ${build.dir} -->
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}"
debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="test-compile" depends="compile">
<mkdir dir="${test.build.dir}"/>
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" includeantruntime="false"
debug="true" debuglevel="lines,vars,source">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="dist" depends="compile" description="package, output to JAR">
<!-- Create the distribution directory -->
<mkdir dir="${dist.dir}" />
<!-- Put everything in ${build} into the {$projectName}-${DSTAMP}.jar file -->
<jar jarfile="${dist.dir}/${projectName}-${DSTAMP}.jar" basedir="${build.dir}" >
<manifest>
<!-- create an executable Jar -->
<attribute name="Main-Class" value="com.mlpinit.set.MainFrame" />
</manifest>
<fileset dir="${resources.dir}">
<include name="*.png" />
</fileset>
</jar>
</target>
<target name="test" depends="test-compile">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.build.dir}"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.src.dir}" includes="**/*Test.java" />
</batchtest>
</junit>
</target>
<target name="clean" description="clean up">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${test.build.dir}" />
</target>
<!-- Default, run this -->
<target name="main" depends="clean, compile, dist" />
</project>