-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
219 lines (185 loc) · 4.91 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<project name="guice-util" default="jar" xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
Guice utilities
</description>
<!--
! Common properties defined before importing the Ivy
! initialization build file.
!-->
<property file="build.properties"/>
<!--
! Define "resolve", "clean-lib", and "clean-ivy-cache" targets,
! downloading the Apache Ivy jar, if necessary.
!-->
<import file="ivy/build-ivy.xml"/>
<!--
! Common paths
!-->
<path id="compile.classpath">
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<path id="runtime.classpath">
<path refid="compile.classpath" />
<path location="${classes.dir}" />
</path>
<path id="test.classpath">
<path refid="runtime.classpath" />
<path location="${test.classes.dir}" />
</path>
<path id="errorprone.classpath">
<fileset dir="${lib.dir}" includes="com.google.errorprone-error_prone_*.jar"/>
</path>
<!--
! Compilation
!-->
<target name="compile"
depends="resolve"
>
<mkdir dir="${classes.dir}" />
<javac
srcdir="${src.dir}"
destdir="${classes.dir}"
classpathref="compile.classpath"
compiler="${errorprone.adapter}"
encoding="UTF-8"
debug="${build.debug}"
includeAntRuntime="false"
verbose="${build.verbose}"
>
<compilerclasspath refid="errorprone.classpath"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xep:RemoveUnusedImports"/>
<compilerarg value="-Xep:ComparisonContractViolated"/>
<exclude name="**/package-info.java" />
</javac>
</target>
<!--
! Testing
!-->
<target name="test"
depends="run-test-reports"
>
<echo>Finished tests</echo>
</target>
<target name="compile-tests"
depends="compile"
>
<mkdir dir="${test.classes.dir}" />
<javac
srcdir="${test.src.dir}"
destdir="${test.classes.dir}"
classpathref="runtime.classpath"
compiler="${errorprone.adapter}"
encoding="UTF-8"
debug="true"
includeAntRuntime="false"
verbose="${build.verbose}"
>
<compilerclasspath refid="errorprone.classpath"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xep:RemoveUnusedImports"/>
<exclude name="**/package-info.java" />
</javac>
</target>
<target name="run-tests"
depends="compile-tests"
>
<mkdir dir="${tests.dir}" />
<junit
printsummary="true"
showoutput="false"
fork="true"
haltonfailure="false"
errorProperty="tests.errors"
failureProperty="tests.failed"
>
<assertions>
<enable />
</assertions>
<classpath refid="test.classpath"/>
<formatter type="xml"/>
<batchtest todir="${tests.dir}">
<fileset dir="${test.classes.dir}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="run-test-reports"
depends="run-tests"
>
<mkdir dir="${reports.dir}" />
<junitreport todir="${tests.dir}">
<fileset dir="${tests.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${reports.dir}"/>
</junitreport>
<fail if="tests.errors" message="Test(s) had errors, see ${reports.dir}/index.html for details." />
<fail if="tests.failed" message="Test(s) failed, see ${reports.dir}/index.html for details." />
</target>
<!--
! Run a sample program (given by the main.class.name property)
!-->
<target name="run"
depends="compile-tests"
description="compile and run program named by main.class.name property"
>
<java
classpathref="test.classpath"
classname="${main.class.name}"
fork="true"
>
<assertions>
<enable />
</assertions>
</java>
</target>
<!--
! Package as Jar
!-->
<target name="jar"
depends="test"
>
<jar destfile="${module.jar}">
<fileset dir="${classes.dir}" />
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Version" value="${module.version}" />
</manifest>
</jar>
</target>
<!--
! Javadocs
!-->
<target name="doc"
depends="resolve"
>
<mkdir dir="${javadoc.dir}"/>
<javadoc
destdir="${javadoc.dir}"
classpathref="compile.classpath"
windowtitle="${doc.windowtitle}"
access="protected"
breakiterator="yes"
linksource="yes"
>
<tag name="impl.note" description="Implementation note:" />
<arg value="-Xdoclint:-missing"/>
<arg value="-notimestamp"/>
<packageset dir="${src.dir}" />
<link href="https://docs.oracle.com/javase/8/docs/api/" />
</javadoc>
</target>
<!--
! Cleanup
!-->
<target name="clean"
description="clean build artifacts"
>
<delete dir="${build.dir}"/>
</target>
<target name="clean-all" depends="clean, clean-lib" />
</project>