-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
103 lines (91 loc) · 3.74 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<project name="Auction Sniper" default="build">
<property name="build.dir" location="build"/>
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="lib.dir" value="lib"/>
<property name="app.classes.dir" location="${build.dir}/classes/app"/>
<property name="test.classes.dir" location="${build.dir}/classes/test"/>
<path id="app.lib.path">
<fileset dir="${lib.dir}/deploy" includes="*.jar"/>
<fileset dir="${lib.dir}/develop" includes="*.jar" excludes="*-src.jar"/>
</path>
<path id="test.lib.path">
<fileset dir="${lib.dir}/develop" includes="*.jar" excludes="*-src.jar"/>
<path location="${app.classes.dir}"/>
<path refid="app.lib.path"/>
</path>
<target name="clean">
<delete dir="${build.dir}" quiet="true"/>
</target>
<target name="app.compile">
<property name="app.src.dir" location="${src.dir}"/>
<mkdir dir="${app.classes.dir}"/>
<javac destdir="${app.classes.dir}"
srcdir="${app.src.dir}"
classpathref="app.lib.path"
debug="on"/>
</target>
<target name="test.compile.endtoend"
depends="app.compile">
<property name="test.src.dir" location="${test.dir}/end-to-end"/>
<mkdir dir="${test.classes.dir}"/>
<javac destdir="${test.classes.dir}"
srcdir="${test.src.dir}"
classpathref="test.lib.path"
debug="on"/>
</target>
<target name="test.compile.unit"
depends="app.compile">
<property name="test.src.dir" location="${test.dir}/unit"/>
<mkdir dir="${test.classes.dir}"/>
<javac destdir="${test.classes.dir}"
srcdir="${test.src.dir}"
classpathref="test.lib.path"
debug="on"/>
</target>
<target name="openfire.check">
<waitfor checkevery="1" checkeveryunit="second" maxwait="20" timeoutproperty="openfire.is.down">
<http url="http://localhost:9090"/>
</waitfor>
<fail message="OpenFire is not running" if="openfire.is.down"/>
</target>
<target name="test.run.all"
description="Run the tests"
depends="test.run.unit, test.run.endtoend">
</target>
<target name="test.run.endtoend"
description="Run the tests"
depends="openfire.check, test.compile.endtoend">
<property name="test.reports.dir" location="${build.dir}/testreports"/>
<mkdir dir="${test.reports.dir}"/>
<junit>
<batchtest todir="${test.reports.dir}" haltonfailure="true" haltonerror="true">
<formatter type="plain"/>
<fileset dir="${test.dir}/end-to-end" includes="**/*Test.java"/>
</batchtest>
<classpath>
<path refid="test.lib.path"/>
<path location="${test.classes.dir}"/>
</classpath>
</junit>
</target>
<target name="test.run.unit"
description="Run the tests"
depends="test.compile.unit">
<property name="test.reports.dir" location="${build.dir}/testreports"/>
<mkdir dir="${test.reports.dir}"/>
<junit>
<batchtest todir="${test.reports.dir}" haltonfailure="true" haltonerror="true">
<formatter type="plain"/>
<fileset dir="${test.dir}/unit" includes="**/*Test.java"/>
</batchtest>
<classpath>
<path refid="test.lib.path"/>
<path location="${test.classes.dir}"/>
</classpath>
</junit>
</target>
<target name="build"
description="Clean, build, and full test"
depends="clean, test.run.all"/>
</project>