-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
72 lines (63 loc) · 2.23 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
<project name="hello" default="test" basedir=".">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<!--<property name="dist.dir" value="dist"/>-->
<property name="junit.dir" value="junit-results"/>
<property name="lib.dir" value="lib"/>
<property name="junit.jar" location="lib/junit-4.10.jar"/>
<path id="classpath">
<pathelement location="${build.dir}" />
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="init">
<mkdir dir="${build.dir}"/>
<!--<mkdir dir="${dist.dir}"/>-->
<mkdir dir="${junit.dir}"/>
</target>
<target name="build" depends="init" description="build everything under ${src.dir}" >
<!-- includeantruntime included to get around ant 1.8 misfeature -->
<javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false">
<classpath refid="classpath"/>
</javac>
</target>
<target name="test" description="unit test" >
<dirname property="junit.raw" file="${junit.dir}/raw/"/>
<mkdir dir="${junit.raw}" />
<junit errorProperty="test.failed" failureProperty="test.failed">
<batchtest fork="yes" todir="${junit.raw}">
<formatter type="xml"/>
<fileset dir="${src.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<classpath refid="classpath" />
</junit>
<fail message="Tests failed: check test reports." if="test.failed" />
</target>
<!--
<target name="dist" depends="build" description="generate the distribution" >
<jar jarfile="${dist.dir}/${jar.name}" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="{$main-class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="dist">
<java fork="true" classname="${main-class}">
<classpath>
<path refid="classpath"/>
<path id="application" location="${dist.dir}/${jar.name}"/>
</classpath>
</java>
</target>
-->
<target name="clean" description="clean up" >
<delete dir="${build.dir}"/>
<!--<delete dir="${dist.dir}"/>-->
<delete dir="${junit.dir}"/>
</target>
</project>