-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
98 lines (87 loc) · 3.01 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
<project name="s2-geometry-java" default="compile">
<property name="src.dir" value="${basedir}/src" />
<property name="tests.dir" value="${basedir}/tests" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="build.dir" value="${basedir}/build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="project-jarfile"
value="${build.dir}/${ant.project.name}.jar" />
<property name="testClasses.dir" value="${build.dir}/test" />
<path id="classpath.path">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<target name="clean"
description="removes all generated files">
<delete dir="${build.dir}" />
</target>
<target name="compile"
description="compiles Java files for the s2 library">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}"
destdir="${classes.dir}"
includeAntRuntime="false"
deprecation="on">
<compilerarg value="-Werror" />
<classpath refid="classpath.path" />
</javac>
</target>
<target name="jar"
depends="compile"
description="packages the class files as a jar">
<jar destfile="${project-jarfile}" update="true">
<fileset dir="${classes.dir}" />
</jar>
</target>
<target name="compile-tests"
depends="compile"
description="compile the JUnit tests">
<mkdir dir="${testClasses.dir}" />
<javac srcdir="${tests.dir}"
destdir="${testClasses.dir}"
deprecation="on">
<compilerarg value="-Werror" />
<classpath refid="classpath.path" />
<classpath>
<pathelement location="${classes.dir}" />
</classpath>
</javac>
</target>
<macrodef name="testing">
<attribute name="printsummary" default="off" />
<attribute name="fork" default="off" />
<attribute name="forkmode" default="perTest" />
<sequential>
<antcall target="compile-tests" />
<junit printsummary="@{printsummary}"
fork="@{fork}"
forkmode="@{forkmode}"
showoutput="true">
<classpath refid="classpath.path" />
<classpath>
<pathelement location="${classes.dir}" />
<pathelement location="${testClasses.dir}" />
</classpath>
<formatter type="plain" usefile="false" />
<batchtest haltonfailure="true">
<fileset dir="${testClasses.dir}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</sequential>
</macrodef>
<target name="test"
description="runs all of the tests">
<testing printsummary="on" fork="on" forkmode="once" />
</target>
<target name="test-forkless"
description="runs all of the tests without forking the process">
<testing />
</target>
<target name="all"
depends="compile,jar,compile-tests,test"
description="build all deliverables for the project"
/>
</project>