-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.xml
73 lines (58 loc) · 2.35 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
<project name="json-mapreduce" default="jar">
<property name="build.dir" location="build" />
<property name="test.build.dir" value="${build.dir}/test"/>
<property name="test.build.data" value="${test.build.dir}/data"/>
<target name="clean">
<delete dir="build"/>
<delete dir="dist"/>
<delete dir="reports"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<path id="lib.path.ref">
<fileset dir="lib" includes="*.jar"/>
</path>
<javac debug="true" srcdir="src/main/java" destdir="build/classes">
<classpath refid="lib.path.ref"/>
</javac>
</target>
<target name="test" depends="compile">
<mkdir dir="build/test-classes"/>
<mkdir dir="${test.build.data}"/>
<mkdir dir="reports/junit/xml"/>
<mkdir dir="reports/junit/html"/>
<path id="lib.path.ref">
<fileset dir="lib" includes="*.jar"/>
<pathelement location="build/classes"/>
</path>
<javac debug="true" srcdir="src/test/java" destdir="build/test-classes">
<classpath refid="lib.path.ref"/>
</javac>
<junit fork="yes" printsummary="yes" haltonfailure="no" failureproperty="test.failure">
<sysproperty key="test.build.data" value="${test.build.data}"/>
<classpath>
<pathelement location="build/classes"/>
<pathelement location="build/test-classes"/>
<fileset dir="lib" includes="*.jar"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="reports/junit/xml">
<fileset dir="src/test/java">
<include name="**/*Test*.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="reports/junit/html">
<fileset dir="reports/junit/xml">
<include name="TEST-*.xml"/>
</fileset>
<report todir="reports/junit/html"/>
</junitreport>
<fail message="Tests failed" if="test.failure" />
</target>
<target name="jar" depends="compile, test">
<mkdir dir="dist/lib"/>
<jar destfile="dist/lib/json-mapreduce-1.0.jar" basedir="build/classes"/>
</target>
</project>