-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
109 lines (89 loc) · 3.49 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
104
105
106
107
108
109
<project name="solr-spatial-light" default="jar">
<property name="version.num" value="0.0.5" />
<property name="src.dir" value="src" />
<property name="build.dir" value="build" />
<property name="dist.dir" value="dist" />
<property name="lib.dir" value="lib" />
<property name="jar.name" value="${ant.project.name}-${version.num}.jar" />
<property name="test.src.dir" value="test/src" />
<property name="test.build.dir" value="test/build" />
<property name="test.lib.dir" value="test/lib" />
<property name="benchmark.src.dir" value="perf/src" />
<property name="benchmark.build.dir" value="perf/build" />
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<path id="classpath-test">
<path refid="classpath" />
<fileset dir="${dist.dir}" includes="*.jar" />
<fileset dir="${test.lib.dir}" includes="**/*.jar" />
</path>
<path id="classpath-benchmark">
<path refid="classpath-test" />
<path location="${test.build.dir}" />
</path>
<path id="library" location="${dist.dir}/${ant.project.name}.jar" />
<taskdef resource="checkstyletask.properties" classpath="extra/checkstyle-all-5.0.jar" />
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<target name="clean-test">
<delete dir="${test.build.dir}" />
</target>
<target name="clean-benchmark">
<delete dir="${benchmark.build.dir}" />
</target>
<target name="clean-all" depends="clean,clean-test,clean-benchmark" />
<target name="checkstyle">
<checkstyle config="extra/sun_checks.xml">
<fileset dir="${src.dir}" includes="**/*.java" />
<classpath>
<path refid="classpath" />
</classpath>
</checkstyle>
</target>
<target name="compile" depends="checkstyle">
<mkdir dir="${build.dir}" />
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="classpath" debug="on" target="1.5">
<compilerarg value="-Xlint" />
</javac>
</target>
<target name="compile-test" depends="jar">
<mkdir dir="${test.build.dir}" />
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" classpathref="classpath-test" target="1.5"/>
</target>
<target name="compile-benchmark" depends="compile-test">
<mkdir dir="${benchmark.build.dir}" />
<javac srcdir="${benchmark.src.dir}" destdir="${benchmark.build.dir}" classpathref="classpath-benchmark" target="1.5"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${dist.dir}" />
<manifest file="MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Implementation-Version" value="${version.num}" />
</manifest>
<jar destfile="${dist.dir}/${jar.name}" basedir="${build.dir}" manifest="MANIFEST.MF" />
</target>
<target name="test" depends="compile-test">
<junit printsummary="yes" outputtoformatters="false">
<classpath>
<path refid="classpath-test" />
<path refid="library" />
<pathelement location="${test.build.dir}" />
</classpath>
<batchtest fork="yes">
<fileset dir="${test.src.dir}" includes="**/*Test.java"/>
<formatter type="plain" usefile="false" />
</batchtest>
</junit>
</target>
<target name="benchmark" depends="compile-benchmark">
<java fork="true" classname="me.outofti.solrspatiallight.BenchmarkRunner">
<classpath>
<path refid="classpath-benchmark" />
<path location="${benchmark.build.dir}" />
</classpath>
</java>
</target>
</project>