1 |
|
<project name="jsr166" default="jar"> |
2 |
|
|
3 |
|
<description> |
4 |
+ |
|
5 |
|
Build file for JSR-166 |
6 |
+ |
|
7 |
+ |
Note that junit.jar must be in ${ant.home}/lib for the |
8 |
+ |
test target to work. [FIXME: This should be automatically |
9 |
+ |
enforced by this build file by failing with a message if |
10 |
+ |
junit.jar is not in the right place.] |
11 |
+ |
|
12 |
|
</description> |
13 |
|
|
14 |
|
<!-- Compilation options --> |
15 |
+ |
<property name="build.sourcelevel" value="1.5"/> |
16 |
|
<property name="build.debug" value="true"/> |
17 |
|
<property name="build.debuglevel" value="source,lines,vars"/> |
18 |
|
<property name="build.deprecation" value="false"/> |
19 |
< |
<property name="build.sourcelevel" value="1.4"/> |
19 |
> |
<!-- |
20 |
> |
<property name="build.warnings" value="true"/> |
21 |
> |
--> |
22 |
|
|
23 |
|
<!-- Build locations --> |
24 |
|
<property name="build.dir" location="build"/> |
36 |
|
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
37 |
|
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
38 |
|
<property name="lib.dir" location="${basedir}/lib"/> |
39 |
+ |
<property name="dist.dir" location="${basedir}/dist"/> |
40 |
+ |
|
41 |
+ |
<!-- Distribution locations --> |
42 |
+ |
<property name="dist.javadocs.dir" location="${dist.dir}/docs"/> |
43 |
|
|
44 |
|
<!-- Jar locations --> |
45 |
|
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
48 |
|
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
49 |
|
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
50 |
|
|
51 |
< |
<property name="gj.compiler.args" |
38 |
< |
value='-J-Xbootclasspath/p:${javac.jar} -gj' |
39 |
< |
/> |
51 |
> |
<property name="javac.args" value='-J-Xbootclasspath/p:${javac.jar}'/> |
52 |
|
|
53 |
< |
<path id="gj.compiler.bootclasspath"> |
53 |
> |
<path id="javac.bootclasspath"> |
54 |
|
<pathelement location="${collect.jar}"/> |
55 |
|
<pathelement location="${rt.jar}"/> |
56 |
|
</path> |
57 |
|
|
58 |
|
<path id="test.classpath"> |
59 |
|
<pathelement location="${product.jar}"/> |
48 |
– |
<pathelement location="${junit.jar}"/> |
60 |
|
</path> |
61 |
|
|
62 |
|
|
63 |
< |
<target name="compile"> |
63 |
> |
<!-- Main targets --> |
64 |
> |
|
65 |
> |
<target name="compile" depends="init" |
66 |
> |
description="Compiles all sources to build folder"> |
67 |
|
<mkdir dir="${build.classes.dir}"/> |
68 |
|
<javac srcdir="${src.dir}" |
69 |
|
destdir="${build.classes.dir}" |
73 |
|
source="${build.sourcelevel}" |
74 |
|
fork="true"> |
75 |
|
|
76 |
< |
<bootclasspath refid="gj.compiler.bootclasspath"/> |
77 |
< |
<compilerarg line="${gj.compiler.args}"/> |
76 |
> |
<bootclasspath refid="javac.bootclasspath"/> |
77 |
> |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
78 |
|
|
79 |
|
<!-- need this because srcdir is basedir! --> |
80 |
|
<include name="java/**/*.java"/> |
83 |
|
</target> |
84 |
|
|
85 |
|
|
86 |
< |
<target name="jar" depends="compile"> |
86 |
> |
<target name="jar" depends="compile" |
87 |
> |
description="Builds library jar from compiled sources"> |
88 |
|
<mkdir dir="${build.lib.dir}"/> |
89 |
|
<jar basedir="${build.classes.dir}" |
90 |
|
destfile="${product.jar}" |
92 |
|
</target> |
93 |
|
|
94 |
|
|
95 |
< |
<target name="test" depends="report-tests"/> |
95 |
> |
<target name="test" depends="init, report-tests" |
96 |
> |
description="Runs all tests"/> |
97 |
|
|
98 |
|
|
99 |
< |
<target name="docs" depends="filter-src"> |
99 |
> |
<target name="docs" depends="init, clean-filtered-src, filter-src" |
100 |
> |
description="Builds javadocs with custom tags to build folder"> |
101 |
|
<delete dir="${build.javadocs.dir}"/> |
102 |
|
<mkdir dir="${build.javadocs.dir}"/> |
103 |
|
<javadoc destdir="${build.javadocs.dir}" |
107 |
|
|
108 |
|
<tag name="revised" description="Last revised:"/> |
109 |
|
<tag name="spec" description="Specified by:"/> |
110 |
< |
|
110 |
> |
<tag name="editor" description="Last edited by:"/> |
111 |
> |
<tag name="fixme" description="FIX ME:"/> |
112 |
|
<packageset dir="${build.filter.src.dir}"> |
113 |
|
<include name="java/**"/> |
114 |
|
</packageset> |
117 |
|
</target> |
118 |
|
|
119 |
|
|
120 |
< |
<target name="clean"> |
120 |
> |
<target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/> |
121 |
> |
|
122 |
> |
|
123 |
> |
<target name="clean" |
124 |
> |
description="Removes all build products"> |
125 |
|
<delete dir="${build.dir}"/> |
126 |
|
<delete dir="${build.classes.dir}"/> |
127 |
|
<delete dir="${build.lib.dir}"/> |
106 |
– |
<delete dir="${build.javadocs.dir}"/> |
128 |
|
</target> |
129 |
|
|
130 |
|
|
131 |
< |
<!-- Internal targets used by docs target --> |
131 |
> |
<target name="dist-clean" |
132 |
> |
description="Removes all build and distribution products"> |
133 |
> |
<delete dir="${dist.dir}"/> |
134 |
> |
</target> |
135 |
> |
|
136 |
> |
|
137 |
> |
<!-- Anthill targets --> |
138 |
> |
|
139 |
> |
<!-- Should really run the tests instead of just the jar target --> |
140 |
> |
<target name="anthill-build" depends="jar, docs, dist-docs" |
141 |
> |
description="Build the jar and both the external and internal docs"/> |
142 |
> |
|
143 |
> |
<target name="anthill-publish"> |
144 |
> |
<copy todir="${deployDir}/docs/private"> |
145 |
> |
<fileset dir="${build.javadocs.dir}"/> |
146 |
> |
</copy> |
147 |
> |
<copy todir="${deployDir}/docs/public"> |
148 |
> |
<fileset dir="${dist.javadocs.dir}"/> |
149 |
> |
</copy> |
150 |
> |
</target> |
151 |
> |
|
152 |
> |
|
153 |
> |
<!-- Internal targets --> |
154 |
> |
|
155 |
> |
<target name="set-warnings-if" if="build.warnings"> |
156 |
> |
<property name="build.warnings.option" value="-warnunchecked"/> |
157 |
> |
</target> |
158 |
> |
|
159 |
> |
<target name="set-warnings-unless" unless="build.warnings"> |
160 |
> |
<property name="build.warnings.option" value=""/> |
161 |
> |
</target> |
162 |
> |
|
163 |
> |
<target name="init" depends="set-warnings-if, set-warnings-unless"> |
164 |
> |
<!-- Version is kept in a separate file --> |
165 |
> |
<loadfile property="version" srcFile="version.properties"/> |
166 |
> |
<echo>Building JSR-166 version ${version}</echo> |
167 |
> |
</target> |
168 |
> |
|
169 |
> |
|
170 |
> |
<target name="clean-filtered-src"> |
171 |
> |
<delete dir="${build.filter.src.dir}"/> |
172 |
> |
</target> |
173 |
> |
|
174 |
> |
|
175 |
> |
<target name="dist-jar" depends="clean, jar"> |
176 |
> |
<copy file="${product.jar}" todir="${dist.dir}"/> |
177 |
> |
</target> |
178 |
> |
|
179 |
> |
|
180 |
> |
<target name="dist-docs" depends="clean-filtered-src, filter-src" |
181 |
> |
description="Builds javadocs without custom tags to dist folder"> |
182 |
> |
<delete dir="${dist.javadocs.dir}"/> |
183 |
> |
<mkdir dir="${dist.javadocs.dir}"/> |
184 |
> |
<javadoc destdir="${dist.javadocs.dir}" |
185 |
> |
link="http://java.sun.com/j2se/1.4.1/docs/api" |
186 |
> |
overview="${src.dir}/intro.html" |
187 |
> |
source="${build.sourcelevel}"> |
188 |
|
|
189 |
< |
<target name="compile-ant"> |
189 |
> |
<packageset dir="${build.filter.src.dir}"> |
190 |
> |
<include name="java/**"/> |
191 |
> |
</packageset> |
192 |
> |
|
193 |
> |
</javadoc> |
194 |
> |
</target> |
195 |
> |
|
196 |
> |
|
197 |
> |
<target name="compile-ant-filter"> |
198 |
|
<mkdir dir="${build.ant.dir}"/> |
199 |
|
<javac srcdir="${ant.src.dir}" |
200 |
|
destdir="${build.ant.dir}" |
203 |
|
</target> |
204 |
|
|
205 |
|
|
206 |
< |
<target name="filter-src" depends="compile-ant"> |
206 |
> |
<target name="filter-src" depends="compile-ant-filter"> |
207 |
|
<mkdir dir="${build.filter.src.dir}"/> |
208 |
|
<copy todir="${build.filter.src.dir}"> |
209 |
|
<fileset dir="${src.dir}"> |
244 |
|
</target> |
245 |
|
|
246 |
|
|
162 |
– |
<!-- Internal targets used by test target --> |
163 |
– |
|
247 |
|
<target name="compile-tests" depends="jar"> |
248 |
|
<mkdir dir="${build.testcases.dir}"/> |
249 |
|
<javac srcdir="${test.src.dir}" |
254 |
|
source="${build.sourcelevel}" |
255 |
|
fork="true"> |
256 |
|
|
257 |
< |
<bootclasspath refid="gj.compiler.bootclasspath"/> |
258 |
< |
<compilerarg line="${gj.compiler.args}"/> |
257 |
> |
<bootclasspath refid="javac.bootclasspath"/> |
258 |
> |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
259 |
|
<classpath refid="test.classpath"/> |
260 |
|
<include name="**/*Test.java"/> |
261 |
|
|
262 |
|
</javac> |
263 |
|
</target> |
264 |
|
|
265 |
+ |
|
266 |
|
<target name="run-tests" depends="compile-tests"> |
267 |
|
<mkdir dir="${build.reports.dir}"/> |
268 |
|
<junit printsummary="true" |
269 |
|
showoutput="true" |
270 |
|
errorProperty="junit.failed" |
271 |
|
failureProperty="junit.failed" |
272 |
< |
dir="${build.reports.dir}"> |
272 |
> |
dir="${build.reports.dir}" |
273 |
> |
fork="true"> |
274 |
> |
|
275 |
> |
<jvmarg value="-Xbootclasspath/p:${product.jar}"/> |
276 |
|
|
277 |
|
<classpath> |
278 |
< |
<path refid="test.classpath"/> |
278 |
> |
<!-- <path refid="test.classpath"/> --> |
279 |
|
<pathelement location="${build.testcases.dir}"/> |
280 |
|
</classpath> |
281 |
|
|