1 |
|
<project name="jsr166" default="usage"> |
2 |
|
|
3 |
|
<description> |
4 |
< |
Build file for JSR-166 |
4 |
> |
------------------------------------------------------------------------------ |
5 |
> |
Build file for JSR-166 |
6 |
|
|
7 |
< |
JUnit 3.8 or better must be in ${ant.home}/lib for the test target to work. |
7 |
< |
</description> |
7 |
> |
Usage: ant [target] |
8 |
|
|
9 |
+ |
User-specific settings are read from user.properties. |
10 |
+ |
See user.properties.sample for an explanation of some useful settings. |
11 |
+ |
------------------------------------------------------------------------------ |
12 |
+ |
</description> |
13 |
|
|
14 |
< |
<target name="usage" description="Prints this message"> |
15 |
< |
<echo> |
12 |
< |
ant [target], where target is one of: |
13 |
< |
|
14 |
< |
usage (default) Prints this message |
15 |
< |
compile Compiles all sources to build folder |
16 |
< |
jar Builds library jar from compiled sources |
17 |
< |
test Runs all tests (requires JUnit 1.8 in ${ant.home}/lib) |
18 |
< |
docs Builds javadocs with custom tags to build folder |
19 |
< |
dist-docs Builds javadocs without custom tags to dist folder |
20 |
< |
dist Puts all distributable products in single hierarchy |
21 |
< |
|
22 |
< |
clean Removes all build products |
23 |
< |
dist-clean Removes all build and distribution products |
24 |
< |
|
25 |
< |
checkstyle Reports on style errors in Java source (verbose, mostly chaff) |
26 |
< |
doccheck Reports on javadoc style errors (not working yet) |
27 |
< |
</echo> |
14 |
> |
<target name="usage" description="Advises user to run with -projecthelp"> |
15 |
> |
<echo>Run "ant -projecthelp" for full usage information.</echo> |
16 |
|
</target> |
17 |
|
|
18 |
+ |
|
19 |
|
<!-- User-specific settings --> |
20 |
|
<property file="user.properties"/> |
21 |
|
|
33 |
– |
<!-- Set build.warnings in user.properties to turn on -warnunchecked --> |
34 |
– |
<!-- <property name="build.warnings" value=""/> --> |
35 |
– |
|
22 |
|
|
23 |
|
<!-- Compilation options --> |
24 |
|
<property name="build.sourcelevel" value="1.5"/> |
39 |
– |
<property name="build.docsourcelevel" value="1.4"/> |
25 |
|
<property name="build.debug" value="true"/> |
26 |
|
<property name="build.debuglevel" value="source,lines,vars"/> |
27 |
|
<property name="build.deprecation" value="false"/> |
29 |
|
<!-- Build locations --> |
30 |
|
<property name="build.dir" location="build"/> |
31 |
|
<property name="build.classes.dir" location="${build.dir}/classes"/> |
47 |
– |
<property name="build.emulation.dir" location="${build.dir}/emulation"/> |
32 |
|
<property name="build.testcases.dir" location="${build.dir}/testcases"/> |
33 |
|
<property name="build.lib.dir" location="${build.dir}/lib"/> |
34 |
|
<property name="build.ant.dir" location="${build.dir}/ant"/> |
35 |
|
<property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
52 |
– |
<property name="build.stripped.dir" location="${build.dir}/stripped"/> |
36 |
|
<property name="build.reports.dir" location="${build.dir}/reports"/> |
37 |
+ |
<property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/> |
38 |
|
<property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
39 |
|
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
40 |
+ |
<property name="build.dc-filter.dir" location="${build.dir}/filterdocchk"/> |
41 |
|
|
42 |
|
<!-- Source locations --> |
43 |
|
<property name="src.dir" location="${basedir}/src/main"/> |
59 |
– |
<property name="emulation.src.dir" location="${basedir}/src/emulation"/> |
44 |
|
<property name="test.src.dir" location="${basedir}/src/test"/> |
45 |
+ |
<property name="tck.src.dir" location="${test.src.dir}/tck"/> |
46 |
+ |
<property name="jtreg.src.dir" location="${test.src.dir}/jtreg"/> |
47 |
|
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
48 |
|
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
49 |
|
<property name="lib.dir" location="${basedir}/lib"/> |
54 |
|
|
55 |
|
<!-- Jar locations --> |
56 |
|
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
71 |
– |
<property name="javac.jar" location="${lib.dir}/javac.jar"/> |
72 |
– |
<property name="collect.jar" location="${lib.dir}/collect.jar"/> |
57 |
|
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
58 |
< |
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
59 |
< |
|
60 |
< |
|
77 |
< |
<!-- |
78 |
< |
! Bootclasspath munging for source compilation. |
79 |
< |
--> |
80 |
< |
|
81 |
< |
<path id="javac.bootclasspath.prepend"> |
82 |
< |
<!-- <pathelement location="${src.dir}"/> --> |
83 |
< |
<pathelement location="${javac.jar}"/> |
84 |
< |
</path> |
85 |
< |
|
86 |
< |
<path id="javac.bootclasspath"> |
87 |
< |
<!-- <pathelement location="${src.dir}"/> --> |
88 |
< |
<pathelement location="${collect.jar}"/> |
89 |
< |
<pathelement location="${rt.jar}"/> |
90 |
< |
</path> |
91 |
< |
|
92 |
< |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
93 |
< |
<property name="javac.bootclasspath.prepend" refid="javac.bootclasspath.prepend"/> |
94 |
< |
|
95 |
< |
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
96 |
< |
<property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prepend}'/> |
97 |
< |
|
98 |
< |
|
99 |
< |
<!-- |
100 |
< |
! Bootclasspath munging for testing, so JUnit can test our local |
101 |
< |
! modifications to java.*. |
102 |
< |
--> |
58 |
> |
|
59 |
> |
<!-- Bootclasspath argument --> |
60 |
> |
<property name="bootclasspath.args" value="-Xbootclasspath/p:${product.jar}"/> |
61 |
|
|
62 |
+ |
<!-- Test classpath --> |
63 |
|
<path id="test.classpath"> |
105 |
– |
<pathelement location="${product.jar}"/> |
64 |
|
<pathelement location="${build.testcases.dir}"/> |
65 |
|
<pathelement location="${junit.jar}"/> |
66 |
|
</path> |
67 |
|
|
110 |
– |
<!-- Flatten test classpath into a platform-appropriate string --> |
111 |
– |
<property name="test.classpath" refid="test.classpath"/> |
112 |
– |
|
113 |
– |
<!-- Turn the flattened test classpath into a javac argument --> |
114 |
– |
<property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/> |
115 |
– |
|
116 |
– |
|
68 |
|
|
69 |
|
<!-- Main targets --> |
70 |
|
|
71 |
< |
<target name="compile" depends="init" |
71 |
> |
|
72 |
> |
<target name="compile" |
73 |
> |
depends="init, configure-compiler" |
74 |
|
description="Compiles main sources to build folder"> |
75 |
|
|
76 |
|
<mkdir dir="${build.classes.dir}"/> |
83 |
|
source="${build.sourcelevel}" |
84 |
|
fork="true"> |
85 |
|
|
86 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
134 |
< |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
86 |
> |
<compilerarg line="${build.args}"/> |
87 |
|
|
88 |
|
</javac> |
89 |
|
|
90 |
|
</target> |
91 |
|
|
92 |
|
|
141 |
– |
<target name="jar" depends="native-jar, emulation-jar"/> |
93 |
|
|
94 |
+ |
<target name="jar" |
95 |
+ |
depends="compile" |
96 |
+ |
description="Builds library jar from compiled sources"> |
97 |
|
|
98 |
< |
<target name="test" depends="init, check-junit, report-tests" |
145 |
< |
description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)" |
146 |
< |
/> |
147 |
< |
|
148 |
< |
|
149 |
< |
<target name="checkstyle" depends="filter-src" |
150 |
< |
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
151 |
< |
|
152 |
< |
<taskdef resource="checkstyletask.properties" |
153 |
< |
classpath="${lib.dir}/checkstyle-all-2.4.jar"/> |
98 |
> |
<mkdir dir="${build.lib.dir}"/> |
99 |
|
|
100 |
< |
<checkstyle> |
101 |
< |
<formatter type="plain"/> <!-- also available: type="xml" --> |
102 |
< |
<fileset dir="${build.filter.src.dir}" includes="**/*.java"/> |
158 |
< |
</checkstyle> |
100 |
> |
<jar destfile="${product.jar}"> |
101 |
> |
<fileset dir="${build.classes.dir}"/> |
102 |
> |
</jar> |
103 |
|
|
104 |
|
</target> |
105 |
|
|
106 |
|
|
163 |
– |
<target name="doccheck" depends="filter-src" |
164 |
– |
description="Reports on javadoc style errors (not working yet)"> |
107 |
|
|
108 |
< |
<delete dir="${build.doccheck.dir}"/> |
109 |
< |
<mkdir dir="${build.doccheck.dir}"/> |
110 |
< |
|
169 |
< |
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
170 |
< |
docletpath="${lib.dir}/doccheck.jar" |
171 |
< |
destdir="${build.doccheck.dir}"> |
172 |
< |
<packageset dir="${build.filter.src.dir}"/> |
173 |
< |
</javadoc> |
108 |
> |
<target name="test" |
109 |
> |
depends="init, configure-tests, report-tests" |
110 |
> |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
111 |
|
|
175 |
– |
</target> |
112 |
|
|
113 |
|
|
114 |
< |
<target name="docs" depends="filter-src" |
114 |
> |
<target name="docs" |
115 |
|
description="Builds javadocs with custom tags to build folder"> |
116 |
|
|
117 |
|
<delete dir="${build.javadocs.dir}"/> |
120 |
|
<javadoc destdir="${build.javadocs.dir}" |
121 |
|
link="http://java.sun.com/j2se/1.4.1/docs/api" |
122 |
|
overview="${src.dir}/intro.html" |
123 |
< |
source="${build.docsourcelevel}"> |
123 |
> |
source="${build.sourcelevel}"> |
124 |
|
|
125 |
|
<tag name="revised" description="Last revised:"/> |
126 |
< |
<tag name="spec" description="Specified by:"/> |
127 |
< |
<tag name="editor" description="Last edited by:"/> |
128 |
< |
<tag name="fixme" description="FIX ME:"/> |
193 |
< |
<packageset dir="${build.filter.src.dir}"/> |
126 |
> |
<tag name="spec" description="Specified by:"/> |
127 |
> |
|
128 |
> |
<packageset dir="${src.dir}"/> |
129 |
|
|
130 |
|
</javadoc> |
131 |
|
|
132 |
|
</target> |
133 |
|
|
134 |
|
|
200 |
– |
<!-- |
201 |
– |
# javac -s doesn't reliably generate compilable code. It generates |
202 |
– |
# bridge methods (marked as "synthetic") that can have identical |
203 |
– |
# signatures to existing methods except for the return value. |
204 |
– |
--> |
205 |
– |
<target name="strip" depends="init"> |
135 |
|
|
136 |
< |
<mkdir dir="${build.stripped.dir}"/> |
136 |
> |
<target name="doccheck" |
137 |
> |
depends="filter-doccheck" |
138 |
> |
description="Reports on javadoc style errors"> |
139 |
|
|
140 |
< |
<javac srcdir="${src.dir}" |
141 |
< |
destdir="${build.stripped.dir}" |
211 |
< |
debug="${build.debug}" |
212 |
< |
debuglevel="${build.debuglevel}" |
213 |
< |
deprecation="${build.deprecation}" |
214 |
< |
source="${build.sourcelevel}" |
215 |
< |
fork="true"> |
140 |
> |
<delete dir="${build.doccheck.dir}"/> |
141 |
> |
<mkdir dir="${build.doccheck.dir}"/> |
142 |
|
|
143 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
144 |
< |
<compilerarg line="${javac.args} ${build.warnings.option} -s"/> |
143 |
> |
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
144 |
> |
docletpath="${lib.dir}/doccheck.jar" |
145 |
> |
destdir="${build.doccheck.dir}"> |
146 |
> |
<packageset dir="${build.dc-filter.dir}"/> |
147 |
> |
</javadoc> |
148 |
|
|
149 |
< |
</javac> |
149 |
> |
<echo>DocCheck output is in ${build.doccheck.dir}</echo> |
150 |
|
|
151 |
|
</target> |
152 |
|
|
153 |
|
|
225 |
– |
<target name="dist" depends="init, dist-clean, dist-jar, dist-docs" |
226 |
– |
description="Puts all distributable products in single hierarchy"/> |
154 |
|
|
155 |
+ |
<target name="checkstyle" |
156 |
+ |
depends="filter-src" |
157 |
+ |
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
158 |
|
|
159 |
< |
<target name="clean" |
160 |
< |
description="Removes all build products"> |
159 |
> |
<taskdef resource="checkstyletask.properties" |
160 |
> |
classpath="${lib.dir}/checkstyle-all-3.1.jar"/> |
161 |
|
|
162 |
< |
<delete dir="${build.dir}"/> |
163 |
< |
<delete dir="${build.classes.dir}"/> |
164 |
< |
<delete dir="${build.lib.dir}"/> |
162 |
> |
<mkdir dir="${build.checkstyle.dir}"/> |
163 |
> |
|
164 |
> |
<checkstyle config="etc/checkstyle/sun_checks.xml" |
165 |
> |
failOnViolation="false"> |
166 |
> |
<formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/> |
167 |
> |
<fileset dir="${build.filter.src.dir}" includes="**/*.java"/> |
168 |
> |
</checkstyle> |
169 |
> |
|
170 |
> |
<style in="${build.checkstyle.dir}/checkstyle-report.xml" |
171 |
> |
out="${build.checkstyle.dir}/checkstyle-report.html" |
172 |
> |
style="${stylesheet.dir}/checkstyle-frames.xsl"/> |
173 |
|
|
174 |
|
</target> |
175 |
|
|
176 |
+ |
|
177 |
|
|
178 |
< |
<target name="dist-clean" |
179 |
< |
description="Removes all build and distribution products"> |
180 |
< |
|
242 |
< |
<delete dir="${dist.dir}"/> |
243 |
< |
|
244 |
< |
</target> |
178 |
> |
<target name="dist" |
179 |
> |
depends="init, dist-clean, dist-jar, dist-docs" |
180 |
> |
description="Puts all distributable products in single hierarchy"/> |
181 |
|
|
182 |
|
|
247 |
– |
<!-- Anthill targets --> |
183 |
|
|
184 |
< |
<!-- Should really run the tests instead of just the jar target --> |
185 |
< |
<target name="anthill-build" depends="jar, test, docs, dist-docs"/> |
184 |
> |
<target name="release" |
185 |
> |
depends="dist" |
186 |
> |
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
187 |
> |
|
188 |
> |
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
189 |
> |
|
190 |
> |
<jar basedir="${basedir}" destfile="${release.jar}"> |
191 |
> |
<!-- <exclude name="build/**"/> --> |
192 |
> |
<exclude name="${release.jar}"/> |
193 |
> |
<exclude name="user.properties"/> |
194 |
> |
<exclude name="etc/notes/**"/> |
195 |
> |
<exclude name="src/emulation/**"/> |
196 |
> |
<exclude name="**/SyntaxTest.java"/> |
197 |
> |
<exclude name="**/SuperfluousAbstract.java"/> |
198 |
> |
</jar> |
199 |
|
|
252 |
– |
<target name="anthill-publish"> |
253 |
– |
<copy todir="${deployDir}/docs/private"> |
254 |
– |
<fileset dir="${build.javadocs.dir}"/> |
255 |
– |
</copy> |
256 |
– |
<copy todir="${deployDir}/docs/public"> |
257 |
– |
<fileset dir="${dist.javadocs.dir}"/> |
258 |
– |
</copy> |
259 |
– |
<copy tofile="${deployDir}/index.html" |
260 |
– |
file="${basedir}/etc/anthill-index.html"/> |
261 |
– |
<copy todir="${deployDir}/notes"> |
262 |
– |
<fileset dir="${basedir}/etc/notes"/> |
263 |
– |
</copy> |
200 |
|
</target> |
201 |
|
|
202 |
|
|
267 |
– |
<!-- Internal targets --> |
203 |
|
|
204 |
< |
<target name="set-warnings-if" if="build.warnings"> |
204 |
> |
<target name="clean" |
205 |
> |
description="Removes all build products"> |
206 |
|
|
207 |
< |
<property name="build.warnings.option" value="-warnunchecked"/> |
207 |
> |
<delete dir="${build.dir}"/> |
208 |
> |
<delete dir="${build.classes.dir}"/> |
209 |
> |
<delete dir="${build.lib.dir}"/> |
210 |
|
|
211 |
|
</target> |
212 |
|
|
213 |
|
|
276 |
– |
<target name="set-warnings-unless" unless="build.warnings"> |
277 |
– |
|
278 |
– |
<property name="build.warnings.option" value=""/> |
214 |
|
|
215 |
< |
</target> |
216 |
< |
|
282 |
< |
|
283 |
< |
<target name="init" depends="set-warnings-if, set-warnings-unless"> |
215 |
> |
<target name="dist-clean" |
216 |
> |
description="Removes all build and distribution products"> |
217 |
|
|
218 |
< |
<!-- Version is kept in a separate file --> |
286 |
< |
<loadfile property="version" srcFile="version.properties"/> |
287 |
< |
<echo>Building JSR-166 version ${version}</echo> |
218 |
> |
<delete dir="${dist.dir}"/> |
219 |
|
|
220 |
|
</target> |
221 |
|
|
222 |
|
|
292 |
– |
<target name="native-jar" depends="compile" |
293 |
– |
description="Builds library jar from compiled sources"> |
294 |
– |
|
295 |
– |
<mkdir dir="${build.lib.dir}"/> |
296 |
– |
|
297 |
– |
<jar destfile="${product.jar}"> |
298 |
– |
<fileset dir="${build.classes.dir}"/> |
299 |
– |
</jar> |
300 |
– |
|
301 |
– |
</target> |
302 |
– |
|
223 |
|
|
224 |
< |
<target name="compile-emulation" depends="init" |
225 |
< |
if="build.emulation" |
306 |
< |
description="Compiles emulation sources to build folder"> |
224 |
> |
<target name="dist-docs" |
225 |
> |
description="Builds javadocs without custom tags to dist folder"> |
226 |
|
|
227 |
< |
<mkdir dir="${build.emulation.dir}"/> |
227 |
> |
<delete dir="${dist.javadocs.dir}"/> |
228 |
> |
<mkdir dir="${dist.javadocs.dir}"/> |
229 |
|
|
230 |
< |
<javac srcdir="${emulation.src.dir}" |
231 |
< |
destdir="${build.emulation.dir}" |
232 |
< |
debug="${build.debug}" |
233 |
< |
debuglevel="${build.debuglevel}" |
314 |
< |
deprecation="${build.deprecation}" |
315 |
< |
source="${build.sourcelevel}" |
316 |
< |
fork="true"> |
230 |
> |
<javadoc destdir="${dist.javadocs.dir}" |
231 |
> |
link="http://java.sun.com/j2se/1.4.2/docs/api" |
232 |
> |
overview="${src.dir}/intro.html" |
233 |
> |
source="${build.sourcelevel}"> |
234 |
|
|
235 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
319 |
< |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
235 |
> |
<packageset dir="${src.dir}"/> |
236 |
|
|
237 |
< |
</javac> |
237 |
> |
</javadoc> |
238 |
|
|
239 |
|
</target> |
240 |
|
|
241 |
|
|
326 |
– |
<target name="emulation-jar" depends="native-jar, compile-emulation" |
327 |
– |
if="build.emulation"> |
242 |
|
|
243 |
< |
<jar destfile="${product.jar}" update="true" duplicate="add"> |
330 |
< |
<fileset dir="${build.emulation.dir}"/> |
331 |
< |
</jar> |
332 |
< |
|
333 |
< |
</target> |
243 |
> |
<!-- Internal targets --> |
244 |
|
|
245 |
|
|
246 |
< |
<target name="dist-jar" depends="clean, jar"> |
246 |
> |
<target name="init"> |
247 |
|
|
248 |
< |
<copy file="${product.jar}" todir="${dist.dir}"/> |
248 |
> |
<!-- Version is kept in a separate file --> |
249 |
> |
<loadfile property="version" srcFile="version.properties"/> |
250 |
> |
<echo>Building JSR-166 version ${version}</echo> |
251 |
> |
<echo>java.home is ${java.home}</echo> |
252 |
|
|
253 |
|
</target> |
254 |
+ |
|
255 |
+ |
|
256 |
+ |
<target name="dist-jar" |
257 |
+ |
depends="clean, jar"> |
258 |
|
|
259 |
< |
|
343 |
< |
<target name="dist-docs" depends="filter-src" |
344 |
< |
description="Builds javadocs without custom tags to dist folder"> |
345 |
< |
|
346 |
< |
<delete dir="${dist.javadocs.dir}"/> |
347 |
< |
<mkdir dir="${dist.javadocs.dir}"/> |
348 |
< |
|
349 |
< |
<javadoc destdir="${dist.javadocs.dir}" |
350 |
< |
link="http://java.sun.com/j2se/1.4.1/docs/api" |
351 |
< |
overview="${src.dir}/intro.html" |
352 |
< |
source="${build.docsourcelevel}"> |
353 |
< |
|
354 |
< |
<packageset dir="${build.filter.src.dir}"/> |
355 |
< |
|
356 |
< |
</javadoc> |
259 |
> |
<copy file="${product.jar}" todir="${dist.dir}"/> |
260 |
|
|
261 |
|
</target> |
262 |
|
|
263 |
|
|
264 |
< |
<target name="compile-ant-filter" depends="init"> |
264 |
> |
<target name="compile-ant-filter" |
265 |
> |
depends="init"> |
266 |
|
|
267 |
|
<mkdir dir="${build.ant.dir}"/> |
268 |
|
|
274 |
|
</target> |
275 |
|
|
276 |
|
|
277 |
< |
<target name="filter-src" depends="compile-ant-filter"> |
277 |
> |
<target name="filter-src" |
278 |
> |
depends="compile-ant-filter"> |
279 |
|
|
280 |
|
<mkdir dir="${build.filter.src.dir}"/> |
281 |
|
|
282 |
|
<copy todir="${build.filter.src.dir}"> |
283 |
|
<fileset dir="${src.dir}"> |
284 |
< |
<include name="**/*.java"/> |
285 |
< |
<exclude name="**/Random.java"/> |
286 |
< |
<exclude name="**/Unsafe.java"/> |
284 |
> |
<include name="**/*.html"/> |
285 |
> |
</fileset> |
286 |
> |
</copy> |
287 |
> |
|
288 |
> |
<copy todir="${build.filter.src.dir}"> |
289 |
> |
<fileset dir="${src.dir}"> |
290 |
> |
<exclude name="**/*.html"/> |
291 |
> |
<!-- Files excluded from dist-docs --> |
292 |
> |
<exclude name="java/util/Random.*"/> |
293 |
> |
<exclude name="sun/misc/Unsafe.*"/> |
294 |
|
</fileset> |
295 |
+ |
<!-- |
296 |
|
<filterchain> |
297 |
+ |
--> |
298 |
+ |
|
299 |
+ |
<!-- |
300 |
+ |
# This filter gets rid of angle-bracketed type parameters |
301 |
+ |
# so that javadoc can run on the result. The following |
302 |
+ |
# heuristic seems to work: |
303 |
+ |
# |
304 |
+ |
# For all lines not starting with space(s)-asterisk-space(s), |
305 |
+ |
# replace <something> with a space, where there may be more |
306 |
+ |
# than one right angle bracket at the end, and "something" |
307 |
+ |
# must not contain parens or pipes. (This may need some |
308 |
+ |
# tweaking.) |
309 |
+ |
--> |
310 |
+ |
|
311 |
+ |
<!-- |
312 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
313 |
|
classpath="${build.ant.dir}"> |
386 |
– |
<!-- |
387 |
– |
# These arguments are to get rid of angle-bracketed type |
388 |
– |
# parameters so that javadoc can run on the result. The |
389 |
– |
# following heuristic that seems to work: |
390 |
– |
# |
391 |
– |
# For all lines not starting with space(s)-asterisk-space(s), |
392 |
– |
# replace <something> with a space, where there may be more |
393 |
– |
# than one right angle bracket at the end, and "something" |
394 |
– |
# must not contain parens or pipes. (This may need some |
395 |
– |
# tweaking.) |
396 |
– |
--> |
314 |
|
<param name="notmatching" value="^\s+\*\s.*$"/> |
315 |
< |
<param name="pattern" value="<[^|>()]+?>+"/> |
315 |
> |
<param name="pattern" value="<[^|>()]+?>+"/> |
316 |
|
<param name="replacement" value=" "/> |
317 |
|
</filterreader> |
318 |
+ |
--> |
319 |
+ |
|
320 |
+ |
<!-- |
321 |
+ |
</filterchain> |
322 |
+ |
--> |
323 |
+ |
</copy> |
324 |
+ |
|
325 |
+ |
</target> |
326 |
+ |
|
327 |
+ |
|
328 |
+ |
<target name="filter-doccheck" |
329 |
+ |
depends="filter-src"> |
330 |
+ |
|
331 |
+ |
<mkdir dir="${build.dc-filter.dir}"/> |
332 |
+ |
|
333 |
+ |
<copy todir="${build.dc-filter.dir}"> |
334 |
+ |
<fileset dir="${build.filter.src.dir}"> |
335 |
+ |
<include name="**/*.html"/> |
336 |
+ |
</fileset> |
337 |
+ |
</copy> |
338 |
+ |
|
339 |
+ |
<property name="generic.declarations" |
340 |
+ |
value="/** Fake type parameter. */ public interface E {} /** Fake type parameter. */ public interface T {} /** Fake type parameter. */ public interface K {} /** Fake type parameter. */ public interface V {}" |
341 |
+ |
/> |
342 |
+ |
|
343 |
+ |
<copy todir="${build.dc-filter.dir}"> |
344 |
+ |
<fileset dir="${build.filter.src.dir}"> |
345 |
+ |
<exclude name="**/*.html"/> |
346 |
+ |
</fileset> |
347 |
+ |
<filterchain> |
348 |
+ |
<!-- |
349 |
+ |
# These two filters try to make the source look like |
350 |
+ |
# something that doccheck can process. The first removes |
351 |
+ |
# -source 1.4 assertions and the second adds in a bunch |
352 |
+ |
# of single letter public nested marker interfaces so that |
353 |
+ |
# the generic type parameters are recognized. |
354 |
+ |
--> |
355 |
+ |
|
356 |
+ |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
357 |
+ |
classpath="${build.ant.dir}"> |
358 |
+ |
<param name="matching" value="^\s*assert[\s ].*$"/> |
359 |
+ |
<param name="pattern" value="assert"/> |
360 |
+ |
<param name="replacement" value="//assert"/> |
361 |
+ |
</filterreader> |
362 |
+ |
|
363 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
364 |
|
classpath="${build.ant.dir}"> |
365 |
< |
<!-- |
366 |
< |
# These arguments are to uncomment lines beginning with |
367 |
< |
# "//@" so that javadoc can see imports that are needed |
406 |
< |
# to resolve links but that shouldn't be in the compiled |
407 |
< |
# code. |
408 |
< |
--> |
409 |
< |
<param name="matching" value="^//@.*$"/> |
410 |
< |
<param name="pattern" value="^//@"/> |
411 |
< |
<param name="replacement" value=""/> |
365 |
> |
<param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/> |
366 |
> |
<param name="pattern" value="$"/> |
367 |
> |
<param name="replacement" value=" ${generic.declarations}"/> |
368 |
|
</filterreader> |
369 |
+ |
|
370 |
|
</filterchain> |
371 |
|
</copy> |
372 |
|
|
373 |
|
</target> |
374 |
|
|
375 |
|
|
376 |
< |
<target name="compile-tests" depends="jar"> |
376 |
> |
<target name="compile-tests" |
377 |
> |
depends="jar"> |
378 |
|
|
379 |
|
<mkdir dir="${build.testcases.dir}"/> |
380 |
|
|
381 |
+ |
<javac srcdir="${tck.src.dir}" |
382 |
+ |
destdir="${build.testcases.dir}" |
383 |
+ |
debug="${build.debug}" |
384 |
+ |
debuglevel="${build.debuglevel}" |
385 |
+ |
deprecation="${build.deprecation}" |
386 |
+ |
source="${build.sourcelevel}" |
387 |
+ |
fork="true"> |
388 |
+ |
|
389 |
+ |
<compilerarg value="${bootclasspath.args}"/> |
390 |
+ |
<compilerarg line="${build.args}"/> |
391 |
+ |
|
392 |
+ |
<classpath refid="test.classpath"/> |
393 |
+ |
|
394 |
+ |
</javac> |
395 |
+ |
|
396 |
|
<javac srcdir="${test.src.dir}" |
397 |
|
destdir="${build.testcases.dir}" |
398 |
|
debug="${build.debug}" |
401 |
|
source="${build.sourcelevel}" |
402 |
|
fork="true"> |
403 |
|
|
404 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
405 |
< |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
404 |
> |
<include name="jsr166/test/**"/> |
405 |
> |
|
406 |
> |
<compilerarg value="${bootclasspath.args}"/> |
407 |
> |
<compilerarg line="${build.args}"/> |
408 |
> |
|
409 |
> |
<classpath refid="test.classpath"/> |
410 |
> |
|
411 |
> |
</javac> |
412 |
> |
|
413 |
> |
<!-- |
414 |
> |
<javac srcdir="${jtreg.src.dir}" |
415 |
> |
destdir="${build.testcases.dir}" |
416 |
> |
debug="${build.debug}" |
417 |
> |
debuglevel="${build.debuglevel}" |
418 |
> |
deprecation="${build.deprecation}" |
419 |
> |
source="${build.sourcelevel}" |
420 |
> |
fork="true"> |
421 |
> |
|
422 |
> |
<compilerarg value="${bootclasspath.args}"/> |
423 |
> |
<compilerarg line="${build.args}"/> |
424 |
> |
|
425 |
|
<classpath refid="test.classpath"/> |
426 |
|
|
427 |
|
</javac> |
428 |
+ |
--> |
429 |
|
|
430 |
|
</target> |
431 |
|
|
432 |
|
|
433 |
< |
<target name="run-tests" depends="compile-tests"> |
433 |
> |
<target name="run-tests" |
434 |
> |
depends="compile-tests"> |
435 |
|
|
436 |
|
<!-- May be overridden by user.properties --> |
437 |
|
<property name="testcase" value="*"/> |
445 |
|
dir="${build.reports.dir}" |
446 |
|
fork="true"> |
447 |
|
|
448 |
< |
<jvmarg value="${test.javac.args}"/> |
448 |
> |
<jvmarg value="${bootclasspath.args}"/> |
449 |
> |
|
450 |
> |
<classpath refid="test.classpath"/> |
451 |
|
|
452 |
|
<formatter type="xml"/> |
453 |
|
|
454 |
< |
<batchtest todir="${build.reports.dir}"> |
454 |
> |
<batchtest todir="${build.reports.dir}" unless="no.test.tck"> |
455 |
> |
<fileset dir="${tck.src.dir}"> |
456 |
> |
<include name="**/${testcase}Test.java"/> |
457 |
> |
</fileset> |
458 |
> |
</batchtest> |
459 |
> |
|
460 |
> |
<batchtest todir="${build.reports.dir}" if="do.test.old"> |
461 |
|
<fileset dir="${test.src.dir}"> |
462 |
+ |
<include name="jsr166/test/**/${testcase}Test.java"/> |
463 |
+ |
</fileset> |
464 |
+ |
</batchtest> |
465 |
+ |
|
466 |
+ |
<!-- |
467 |
+ |
<batchtest todir="${build.reports.dir}" if="do.test.jtreg"> |
468 |
+ |
<fileset dir="${jtreg.src.dir}"> |
469 |
|
<include name="**/${testcase}Test.java"/> |
470 |
|
</fileset> |
471 |
|
</batchtest> |
472 |
+ |
--> |
473 |
|
|
474 |
|
</junit> |
475 |
|
|
476 |
|
</target> |
477 |
|
|
478 |
|
|
479 |
< |
<target name="report-tests" depends="run-tests"> |
480 |
< |
<!-- Sets junit.report.format to frames if Xalan is present, |
479 |
> |
<target name="report-tests" |
480 |
> |
depends="run-tests"> |
481 |
> |
|
482 |
> |
<!-- Sets junit.report.format to frames if redirection is present, |
483 |
|
otherwise sets it to noframes. --> |
484 |
|
<available property="junit.report.format" |
485 |
|
value="frames" |
498 |
|
</junitreport> |
499 |
|
|
500 |
|
<fail message="Test Cases Failed" if="junit.failed"/> |
501 |
+ |
|
502 |
+ |
</target> |
503 |
+ |
|
504 |
+ |
|
505 |
+ |
<target name="configure-compiler"> |
506 |
+ |
|
507 |
+ |
<property name="unchecked.option" value="-Xlint:unchecked"/> |
508 |
+ |
|
509 |
+ |
<condition property="warnunchecked.arg" value="${unchecked.option}"> |
510 |
+ |
<istrue value="${build.warnunchecked}"/> |
511 |
+ |
</condition> |
512 |
+ |
|
513 |
+ |
<property name="warnunchecked.arg" value=""/> |
514 |
+ |
|
515 |
+ |
|
516 |
+ |
<!-- Common options in javac invocations --> |
517 |
+ |
<property name="build.args" value="${warnunchecked.arg}"/> |
518 |
+ |
|
519 |
|
</target> |
520 |
|
|
521 |
|
|
522 |
< |
<target name="check-junit"> |
523 |
< |
<!-- FIXME: this test isn't specific enough --> |
522 |
> |
<target name="configure-tests" |
523 |
> |
depends="configure-compiler"> |
524 |
> |
|
525 |
> |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
526 |
|
<available property="junit.available" |
527 |
< |
classname="junit.framework.TestCase"/> |
528 |
< |
<fail message="Need JUnit 3.8 to run tests" unless="junit.available"/> |
527 |
> |
classname="junit.framework.Protectable"/> |
528 |
> |
|
529 |
> |
<!-- Xalan --> |
530 |
> |
<available property="xalan.available" |
531 |
> |
classname="org.apache.xalan.Version"/> |
532 |
> |
|
533 |
> |
|
534 |
> |
<!-- Ant 1.6beta and later don't need or want this check --> |
535 |
> |
<!-- |
536 |
> |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
537 |
> |
unless="junit.available"/> |
538 |
> |
|
539 |
> |
<fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests" |
540 |
> |
unless="xalan.available"/> |
541 |
> |
--> |
542 |
> |
|
543 |
> |
</target> |
544 |
> |
|
545 |
> |
|
546 |
> |
|
547 |
> |
<!-- Anthill targets --> |
548 |
> |
|
549 |
> |
<target name="anthill-build"> |
550 |
> |
|
551 |
> |
<!-- Override this in user.properties --> |
552 |
> |
<property name="tiger.home" location="e:/j2sdk1.5.0"/> |
553 |
> |
|
554 |
> |
<exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java"> |
555 |
> |
<arg value="-Xmx256000000"/> |
556 |
> |
<!-- classpath of new JVM --> |
557 |
> |
<arg value="-classpath"/> <arg path="${java.class.path}"/> |
558 |
> |
<!-- location of Ant home directory --> |
559 |
> |
<arg value="-Dant.home=${ant.home}"/> |
560 |
> |
<!-- the Ant main class --> |
561 |
> |
<arg value="org.apache.tools.ant.Main"/> |
562 |
> |
<!-- The build file --> |
563 |
> |
<arg value="-buildfile"/> <arg value="build.xml"/> |
564 |
> |
<!-- the target to build on the new Ant instance --> |
565 |
> |
<arg value="-DJAVA_HOME=${tiger.home}"/> |
566 |
> |
<arg value="do-anthill-build"/> |
567 |
> |
</exec> |
568 |
> |
</target> |
569 |
> |
|
570 |
> |
<target name="do-anthill-build" |
571 |
> |
depends="jar, test, docs, dist-docs"/> |
572 |
> |
|
573 |
> |
<target name="anthill-publish"> |
574 |
> |
|
575 |
> |
<copy todir="${deployDir}/docs/private"> |
576 |
> |
<fileset dir="${build.javadocs.dir}"/> |
577 |
> |
</copy> |
578 |
> |
|
579 |
> |
<copy todir="${deployDir}/docs/public"> |
580 |
> |
<fileset dir="${dist.javadocs.dir}"/> |
581 |
> |
</copy> |
582 |
> |
|
583 |
> |
<copy tofile="${deployDir}/index.html" |
584 |
> |
file="${basedir}/etc/anthill-index.html"/> |
585 |
> |
|
586 |
> |
<copy todir="${deployDir}/notes"> |
587 |
> |
<fileset dir="${basedir}/etc/notes"/> |
588 |
> |
</copy> |
589 |
> |
|
590 |
> |
</target> |
591 |
> |
|
592 |
> |
|
593 |
> |
<!-- Standalone sample program --> |
594 |
> |
|
595 |
> |
<target name="sample" depends="jar"> |
596 |
> |
|
597 |
> |
<mkdir dir="${build.testcases.dir}"/> |
598 |
> |
|
599 |
> |
<javac srcdir="${test.src.dir}" |
600 |
> |
destdir="${build.testcases.dir}" |
601 |
> |
debug="${build.debug}" |
602 |
> |
debuglevel="${build.debuglevel}" |
603 |
> |
deprecation="${build.deprecation}" |
604 |
> |
source="${build.sourcelevel}" |
605 |
> |
fork="true"> |
606 |
> |
|
607 |
> |
<compilerarg value="${bootclasspath.args}"/> |
608 |
> |
<compilerarg line="${build.args}"/> |
609 |
> |
|
610 |
> |
<classpath refid="test.classpath"/> |
611 |
> |
|
612 |
> |
<include name="jsr166/test/Sample.java"/> |
613 |
> |
|
614 |
> |
</javac> |
615 |
> |
|
616 |
> |
|
617 |
> |
<java classname="jsr166.test.Sample" fork="true"> |
618 |
> |
<jvmarg value="${bootclasspath.args}"/> |
619 |
> |
<classpath refid="test.classpath"/> |
620 |
> |
</java> |
621 |
|
</target> |
622 |
|
|
623 |
+ |
|
624 |
+ |
|
625 |
+ |
<!-- C++ and JNI definitions and demos --> |
626 |
+ |
|
627 |
+ |
<target name="configure-cpp"> |
628 |
+ |
|
629 |
+ |
<!-- Define tasks and types --> |
630 |
+ |
|
631 |
+ |
<path id="cpptasks.path"> |
632 |
+ |
<pathelement location="${lib.dir}/cpptasks.jar"/> |
633 |
+ |
</path> |
634 |
+ |
<taskdef resource="cpptasks.tasks" classpathref="cpptasks.path"/> |
635 |
+ |
<typedef resource="cpptasks.types" classpathref="cpptasks.path"/> |
636 |
+ |
|
637 |
+ |
<!-- Set platform property for JNI includes --> |
638 |
+ |
|
639 |
+ |
<condition property="platform" value="linux"> |
640 |
+ |
<os name="Linux"/> |
641 |
+ |
</condition> |
642 |
+ |
<condition property="platform" value="win32"> |
643 |
+ |
<os family="windows"/> |
644 |
+ |
</condition> |
645 |
+ |
<condition property="platform" value="solaris"> |
646 |
+ |
<os name="SunOS"/> |
647 |
+ |
</condition> |
648 |
+ |
|
649 |
+ |
</target> |
650 |
+ |
|
651 |
+ |
|
652 |
+ |
<target name="cppdemo" depends="configure-cpp"> |
653 |
+ |
|
654 |
+ |
<mkdir dir="${build.dir}"/> |
655 |
+ |
|
656 |
+ |
<cc multithreaded="true" |
657 |
+ |
name="g++" |
658 |
+ |
objdir="${build.dir}" |
659 |
+ |
outfile="${build.dir}/CppDemo"> |
660 |
+ |
<fileset dir="${test.src.dir}" includes="CppDemo.cpp"/> |
661 |
+ |
<libset libs="stdc++"/> |
662 |
+ |
</cc> |
663 |
+ |
|
664 |
+ |
<exec executable="${build.dir}/CppDemo"> |
665 |
+ |
<arg line="count in word frequency of word in command line count"/> |
666 |
+ |
</exec> |
667 |
+ |
|
668 |
+ |
</target> |
669 |
+ |
|
670 |
+ |
|
671 |
+ |
<target name="jnidemo" depends="init, configure-compiler, configure-cpp"> |
672 |
+ |
|
673 |
+ |
<mkdir dir="${build.testcases.dir}"/> |
674 |
+ |
|
675 |
+ |
<javac srcdir="${test.src.dir}" |
676 |
+ |
destdir="${build.testcases.dir}" |
677 |
+ |
debug="${build.debug}" |
678 |
+ |
debuglevel="${build.debuglevel}" |
679 |
+ |
deprecation="${build.deprecation}" |
680 |
+ |
source="${build.sourcelevel}" |
681 |
+ |
fork="true"> |
682 |
+ |
<compilerarg value="${bootclasspath.args}"/> |
683 |
+ |
<compilerarg line="${build.args}"/> |
684 |
+ |
<classpath refid="test.classpath"/> |
685 |
+ |
<include name="JniDemo.java"/> |
686 |
+ |
</javac> |
687 |
+ |
|
688 |
+ |
<javah destdir="${build.testcases.dir}" |
689 |
+ |
classpathref="test.classpath"> |
690 |
+ |
<class name="JniDemo"/> |
691 |
+ |
</javah> |
692 |
+ |
|
693 |
+ |
<cc multithreaded="true" |
694 |
+ |
name="g++" |
695 |
+ |
objdir="${build.dir}" |
696 |
+ |
outfile="${build.dir}/JniDemo" |
697 |
+ |
outtype="shared"> |
698 |
+ |
|
699 |
+ |
<compiler> |
700 |
+ |
<defineset> |
701 |
+ |
<define name="__int64" value="long long"/> |
702 |
+ |
</defineset> |
703 |
+ |
<includepath location="${java.home}/../include"/> |
704 |
+ |
<includepath location="${java.home}/../include/${platform}"/> |
705 |
+ |
<compilerarg value="-mno-cygwin"/> |
706 |
+ |
</compiler> |
707 |
+ |
|
708 |
+ |
<linker> |
709 |
+ |
<linkerarg value="--add-stdcall-alias"/> |
710 |
+ |
</linker> |
711 |
+ |
|
712 |
+ |
<includepath location="${build.testcases.dir}"/> |
713 |
+ |
|
714 |
+ |
<fileset dir="${test.src.dir}" includes="JniDemo.cpp"/> |
715 |
+ |
|
716 |
+ |
<libset libs="stdc++"/> |
717 |
+ |
|
718 |
+ |
</cc> |
719 |
+ |
|
720 |
+ |
<!-- Necessary if windows, harmless if not --> |
721 |
+ |
<copy file="${build.dir}/libJniDemo.so" tofile="${build.dir}/JniDemo.dll"/> |
722 |
+ |
|
723 |
+ |
<java classname="JniDemo" fork="true"> |
724 |
+ |
<!-- Watch out: path separator hardwired to semicolon here! --> |
725 |
+ |
<sysproperty key="java.library.path" path="${java.library.path};${build.dir}"/> |
726 |
+ |
<classpath refid="test.classpath"/> |
727 |
+ |
</java> |
728 |
+ |
|
729 |
+ |
</target> |
730 |
+ |
|
731 |
+ |
|
732 |
+ |
|
733 |
+ |
<!-- Backward compatibility, work in progress (some files not checked in) --> |
734 |
+ |
|
735 |
+ |
|
736 |
+ |
|
737 |
+ |
<property name="pretiger.src.dir" location="${build.dir}/pretiger/src"/> |
738 |
+ |
<property name="build.pretiger.dir" location="${build.dir}/pretiger/classes"/> |
739 |
+ |
<property name="pretiger.jar" location="${build.lib.dir}/jsr166-pretiger.jar"/> |
740 |
+ |
<property name="pretiger.sourcelevel" value="1.4"/> |
741 |
+ |
|
742 |
+ |
<target name="defang" |
743 |
+ |
depends="init" |
744 |
+ |
description="Generates pre-Tiger compatible source"> |
745 |
+ |
|
746 |
+ |
<delete dir="${pretiger.src.dir}"/> |
747 |
+ |
<mkdir dir="${pretiger.src.dir}"/> |
748 |
+ |
|
749 |
+ |
<exec executable="perl"> |
750 |
+ |
<arg file="etc/defang.pl"/> |
751 |
+ |
<!-- <arg value="-v"/> --> |
752 |
+ |
<arg value="-s"/> <arg file="${src.dir}"/> |
753 |
+ |
<arg value="-t"/> <arg file="${pretiger.src.dir}"/> |
754 |
+ |
</exec> |
755 |
+ |
|
756 |
+ |
</target> |
757 |
+ |
|
758 |
+ |
<target name="compile-pretiger" |
759 |
+ |
depends="init, configure-compiler, defang" |
760 |
+ |
description="Compiles pre-Tiger sources to build folder"> |
761 |
+ |
|
762 |
+ |
<mkdir dir="${build.pretiger.dir}"/> |
763 |
+ |
|
764 |
+ |
<javac srcdir="${pretiger.src.dir}" |
765 |
+ |
destdir="${build.pretiger.dir}" |
766 |
+ |
debug="${build.debug}" |
767 |
+ |
debuglevel="${build.debuglevel}" |
768 |
+ |
deprecation="${build.deprecation}" |
769 |
+ |
source="${pretiger.sourcelevel}" |
770 |
+ |
fork="true"> |
771 |
+ |
|
772 |
+ |
<compilerarg line="${build.args}"/> |
773 |
+ |
<exclude name="**/Thread.java"/> |
774 |
+ |
|
775 |
+ |
</javac> |
776 |
+ |
|
777 |
+ |
</target> |
778 |
+ |
|
779 |
+ |
<target name="pretiger" depends="compile-pretiger"> |
780 |
+ |
|
781 |
+ |
<mkdir dir="${build.lib.dir}"/> |
782 |
+ |
|
783 |
+ |
<jar destfile="${pretiger.jar}"> |
784 |
+ |
<fileset dir="${build.pretiger.dir}"> |
785 |
+ |
</fileset> |
786 |
+ |
</jar> |
787 |
+ |
|
788 |
+ |
</target> |
789 |
|
|
790 |
|
</project> |