ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
(Generate patch)

Comparing jsr166/build.xml (file contents):
Revision 1.27 by tim, Wed May 28 00:33:17 2003 UTC vs.
Revision 1.89 by jsr166, Fri Jun 10 18:07:30 2011 UTC

# Line 1 | Line 1
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"/>
24 >  <property name="build.sourcelevel"    value="1.6"/>
25    <property name="build.debug"          value="true"/>
26    <property name="build.debuglevel"     value="source,lines,vars"/>
27    <property name="build.deprecation"    value="false"/>
28  
29    <!-- Build locations -->
30 <  <property name="build.dir"            location="build"/>
31 <  <property name="build.classes.dir"    location="${build.dir}/classes"/>
32 <  <property name="build.emulation.dir"  location="${build.dir}/emulation"/>
33 <  <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
34 <  <property name="build.lib.dir"        location="${build.dir}/lib"/>
35 <  <property name="build.ant.dir"        location="${build.dir}/ant"/>
36 <  <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
37 <  <property name="build.stripped.dir"   location="${build.dir}/stripped"/>
38 <  <property name="build.reports.dir"    location="${build.dir}/reports"/>
39 <  <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
40 <  <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
30 >  <property name="build.dir"                   location="build"/>
31 >  <property name="build.classes.dir"           location="${build.dir}/classes"/>
32 >  <property name="build.testcases.dir"         location="${build.dir}/testcases"/>
33 >  <property name="build.loops.dir"             location="${build.dir}/loops"/>
34 >  <property name="build.lib.dir"               location="${build.dir}/lib"/>
35 >  <property name="build.javadocs.dir"          location="${build.dir}/javadocs"/>
36 >  <property name="build.reports.dir"           location="${build.dir}/reports"/>
37 >  <property name="build.jsr166x.dir"           location="${build.dir}/jsr166x"/>
38 >  <property name="build.jsr166xlib.dir"        location="${build.dir}/jsr166xlib"/>
39 >  <property name="build.jsr166xjavadocs.dir"   location="${build.dir}/jsr166xjavadocs"/>
40 >
41 >  <property name="build.jsr166y.dir"           location="${build.dir}/jsr166y"/>
42 >  <property name="build.jsr166ylib.dir"        location="${build.dir}/jsr166ylib"/>
43 >  <property name="build.jsr166yjavadocs.dir"   location="${build.dir}/jsr166yjavadocs"/>
44 >
45 >  <property name="build.extra166y.dir"         location="${build.dir}/extra166y"/>
46 >  <property name="build.extra166ylib.dir"      location="${build.dir}/extra166ylib"/>
47 >  <property name="build.extra166yjavadocs.dir" location="${build.dir}/extra166yjavadocs"/>
48  
49    <!-- Source locations -->
50    <property name="src.dir"              location="${basedir}/src/main"/>
59  <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
51    <property name="test.src.dir"         location="${basedir}/src/test"/>
52 <  <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
53 <  <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
52 >  <property name="loops.src.dir"        location="${basedir}/src/loops"/>
53 >  <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
54 >  <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
55    <property name="lib.dir"              location="${basedir}/lib"/>
56    <property name="dist.dir"             location="${basedir}/dist"/>
57 <
57 >  <property name="topsrc.dir"           location="${basedir}/src"/>
58 >  <property name="jsr166xsrc.dir"       location="${basedir}/src/jsr166x"/>
59 >  <property name="jsr166ysrc.dir"       location="${basedir}/src/jsr166y"/>
60 >  <property name="extra166ysrc.dir"     location="${basedir}/src/extra166y"/>
61 >  <property name="jdksrc.dir"           location="/home/dl/1.6.0/j2se/martin/j2se/src/share/classes"/>
62    <!-- Distribution locations -->
63 <  <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
63 >  <property name="dist.javadocs.dir"           location="${dist.dir}/docs"/>
64 >  <property name="dist.jsr166xjavadocs.dir"    location="${dist.dir}/jsr166xdocs"/>
65 >  <property name="dist.jsr166yjavadocs.dir"    location="${dist.dir}/jsr166ydocs"/>
66 >  <property name="dist.extra166yjavadocs.dir"  location="${dist.dir}/extra166ydocs"/>
67  
68    <!-- Jar locations -->
69    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
70 <  <property name="javac.jar"            location="${lib.dir}/javac.jar"/>
71 <  <property name="collect.jar"          location="${lib.dir}/collect.jar"/>
70 >  <property name="jsr166xproduct.jar"   location="${build.jsr166xlib.dir}/jsr166x.jar"/>
71 >  <property name="jsr166yproduct.jar"   location="${build.jsr166ylib.dir}/jsr166y.jar"/>
72 >  <property name="extra166yproduct.jar" location="${build.extra166ylib.dir}/extra166y.jar"/>
73    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
74  <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
75
76
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>
74  
75 <  <!-- Flatten bootclasspath prefix into a platform-appropriate string -->
76 <  <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 <   -->
75 >  <!-- Bootclasspath argument -->
76 >  <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
77  
78 +  <!-- Test classpath -->
79    <path id="test.classpath">
105    <pathelement location="${product.jar}"/>
80      <pathelement location="${build.testcases.dir}"/>
81      <pathelement location="${junit.jar}"/>
82    </path>
83  
84 <  <!-- Flatten test classpath into a platform-appropriate string -->
85 <  <property name="test.classpath" refid="test.classpath"/>
86 <
87 <  <!-- Turn the flattened test classpath into a javac argument -->
114 <  <property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/>
115 <
84 >  <!-- ALoops classpath -->
85 >  <path id="loops.classpath">
86 >    <pathelement location="${build.loops.dir}"/>
87 >  </path>
88  
89  
90    <!-- Main targets -->
91  
92 <  <target name="compile" depends="init"
92 >  <target name="dists"
93 >          depends="dist, jsr166xdist, jsr166ydist, extra166ydist"
94 >          description="Builds all public jars and docs"/>
95 >
96 >  <target name="compile"
97 >          depends="init, configure-compiler"
98            description="Compiles main sources to build folder">
99  
100      <mkdir dir="${build.classes.dir}"/>
# Line 130 | Line 107 | ant [target], where target is one of:
107             source="${build.sourcelevel}"
108               fork="true">
109  
110 <      <bootclasspath refid="javac.bootclasspath"/>
111 <      <compilerarg line="${javac.args} ${build.warnings.option}"/>
110 >      <include name="**/*.java"/>
111 >      <compilerarg value="-XDignore.symbol.file=true"/>
112 >
113 > <!--
114 >      <exclude name="java/lang/**"/>
115 >      <compilerarg line="${build.args}"/>
116 >      <compilerarg line="-Xlint -Xmaxwarns 1000"/>
117 > -->
118  
119      </javac>
120  
121    </target>
122  
123  
141  <target name="jar" depends="native-jar, emulation-jar"/>
124  
125 +  <target name="jar"
126 +          depends="compile"
127 +          description="Builds library jar from compiled sources">
128 +
129 +    <mkdir dir="${build.lib.dir}"/>
130 +
131 +    <jar destfile="${product.jar}">
132 +      <fileset dir="${build.classes.dir}"/>
133 +    </jar>
134  
135 <  <target name="test" depends="init, check-junit, report-tests"
145 <          description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)"
146 <  />
135 >  </target>
136  
137  
149  <target name="checkstyle" depends="filter-src"
150          description="Reports on style errors in Java source (verbose, mostly chaff)">
138  
139 <    <taskdef resource="checkstyletask.properties"
140 <            classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
139 >  <target name="test"
140 >          depends="init, configure-tests, report-tests"
141 >          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
142  
155    <checkstyle>
156      <formatter type="plain"/>  <!-- also available: type="xml" -->
157      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
158    </checkstyle>
143  
160  </target>
144  
145 +  <target name="docs"
146 +          description="Builds javadocs with custom tags to build folder">
147  
148 <  <target name="doccheck" depends="filter-src"
149 <          description="Reports on javadoc style errors (not working yet)">
148 >    <delete dir="${build.javadocs.dir}"/>
149 >    <mkdir dir="${build.javadocs.dir}"/>
150  
151 <    <delete dir="${build.doccheck.dir}"/>
152 <    <mkdir dir="${build.doccheck.dir}"/>
151 >    <!-- the packagenames="none" hack below prevents scanning the -->
152 >    <!-- sourcepath for packages -->
153  
154 <    <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
155 <         docletpath="${lib.dir}/doccheck.jar"
156 <            destdir="${build.doccheck.dir}">
157 <      <packageset dir="${build.filter.src.dir}"/>
154 >    <javadoc destdir="${build.javadocs.dir}"
155 >             packagenames="none"
156 >             link="http://download.oracle.com/javase/7/docs/api/"
157 >             overview="${src.dir}/intro.html"
158 >             sourcepath="${src.dir}:${jdksrc.dir}"
159 >             additionalparam="-XDignore.symbol.file=true" >
160 >      <fileset dir="${src.dir}" defaultexcludes="yes">
161 >      <include name="**/*.java"/>
162 >      </fileset>
163      </javadoc>
164  
165    </target>
166  
167  
178  <target name="docs" depends="filter-src"
179          description="Builds javadocs with custom tags to build folder">
168  
169 <    <delete dir="${build.javadocs.dir}"/>
170 <    <mkdir dir="${build.javadocs.dir}"/>
169 >  <target name="dist"
170 >          depends="init, dist-clean, dist-jar, dist-docs"
171 >          description="Puts all distributable products in single hierarchy"/>
172  
184    <javadoc destdir="${build.javadocs.dir}"
185                link="http://java.sun.com/j2se/1.4.1/docs/api"
186            overview="${src.dir}/intro.html"
187              source="${build.docsourcelevel}">
188
189      <tag name="revised" description="Last revised:"/>
190      <tag name="spec" description="Specified by:"/>
191      <tag name="editor" description="Last edited by:"/>
192      <tag name="fixme" description="FIX ME:"/>
193      <packageset dir="${build.filter.src.dir}"/>
173  
174 +  <target name="release"
175 +          depends="dist"
176 +          description="Puts entire CVS tree, plus distribution productions, in a jar">
177 +
178 +    <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
179 +
180 +    <jar basedir="${basedir}" destfile="${release.jar}">
181 +      <!-- <exclude name="build/**"/> -->
182 +      <exclude name="${release.jar}"/>
183 +      <exclude name="user.properties"/>
184 +      <exclude name="etc/notes/**"/>
185 +      <exclude name="src/emulation/**"/>
186 +      <exclude name="**/SyntaxTest.java"/>
187 +      <exclude name="**/SuperfluousAbstract.java"/>
188 +    </jar>
189 +
190 +  </target>
191 +
192 +
193 +
194 +  <target name="clean"
195 +          description="Removes all build products">
196 +
197 +    <delete dir="${build.dir}"/>
198 +    <delete dir="${build.classes.dir}"/>
199 +    <delete dir="${build.lib.dir}"/>
200 +
201 +  </target>
202 +
203 +
204 +
205 +  <target name="dist-clean"
206 +          description="Removes all build and distribution products">
207 +
208 +    <delete dir="${dist.dir}"/>
209 +
210 +  </target>
211 +
212 +
213 +
214 +  <target name="dist-docs"
215 +          description="Builds javadocs without custom tags to dist folder">
216 +
217 +    <delete dir="${dist.javadocs.dir}"/>
218 +    <mkdir dir="${dist.javadocs.dir}"/>
219 +
220 +    <!-- the packagenames="none" hack below prevents scanning the -->
221 +    <!-- sourcepath for packages -->
222 +
223 +    <javadoc destdir="${dist.javadocs.dir}"
224 +             packagenames="none"
225 +             link="http://download.oracle.com/javase/7/docs/api/"
226 +             overview="${src.dir}/intro.html"
227 +             sourcepath="${src.dir}:${jdksrc.dir}"
228 +             additionalparam="-XDignore.symbol.file=true" >
229 +      <fileset dir="${src.dir}" defaultexcludes="yes">
230 +      <include name="**/*.java"/>
231 +      </fileset>
232      </javadoc>
233  
234    </target>
235  
236  
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">
237  
238 <    <mkdir dir="${build.stripped.dir}"/>
238 >  <!-- Internal targets -->
239 >
240  
241 <    <javac srcdir="${src.dir}"
242 <          destdir="${build.stripped.dir}"
241 >  <target name="init">
242 >
243 >    <!-- Version is kept in a separate file -->
244 >    <loadfile property="version" srcFile="version.properties"/>
245 >    <echo>Building JSR-166 version ${version}</echo>
246 >    <echo>java.home is ${java.home}</echo>
247 >
248 >  </target>
249 >
250 >
251 >  <target name="dist-jar"
252 >          depends="clean, jar">
253 >
254 >    <copy file="${product.jar}" todir="${dist.dir}"/>
255 >
256 >  </target>
257 >
258 >
259 >  <target name="compile-tests"
260 >          depends="jar">
261 >
262 >    <mkdir dir="${build.testcases.dir}"/>
263 >
264 >    <javac srcdir="${tck.src.dir}"
265 >          destdir="${build.testcases.dir}"
266              debug="${build.debug}"
267         debuglevel="${build.debuglevel}"
268        deprecation="${build.deprecation}"
269             source="${build.sourcelevel}"
270               fork="true">
271  
272 <      <bootclasspath refid="javac.bootclasspath"/>
273 <      <compilerarg line="${javac.args} ${build.warnings.option} -s"/>
272 >      <compilerarg value="${bootclasspath.args}"/>
273 >      <compilerarg line="${build.args}"/>
274 >      <compilerarg value="-XDignore.symbol.file=true"/>
275 >
276 >      <classpath refid="test.classpath"/>
277  
278      </javac>
279  
280 +    <javac srcdir="${test.src.dir}"
281 +          destdir="${build.testcases.dir}"
282 +            debug="${build.debug}"
283 +       debuglevel="${build.debuglevel}"
284 +      deprecation="${build.deprecation}"
285 +           source="${build.sourcelevel}"
286 +             fork="true">
287 +
288 +      <include name="jsr166/test/**"/>
289 +
290 +      <compilerarg value="${bootclasspath.args}"/>
291 +      <compilerarg line="${build.args}"/>
292 +      <compilerarg value="-XDignore.symbol.file=true"/>
293 +
294 +      <classpath refid="test.classpath"/>
295 +
296 +    </javac>
297 +
298 + <!--
299 +    <javac srcdir="${jtreg.src.dir}"
300 +          destdir="${build.testcases.dir}"
301 +            debug="${build.debug}"
302 +       debuglevel="${build.debuglevel}"
303 +      deprecation="${build.deprecation}"
304 +           source="${build.sourcelevel}"
305 +             fork="true">
306 +
307 +      <compilerarg value="${bootclasspath.args}"/>
308 +      <compilerarg line="${build.args}"/>
309 +      <compilerarg value="-XDignore.symbol.file=true"/>
310 +
311 +      <classpath refid="test.classpath"/>
312 +
313 +    </javac>
314 + -->
315 +
316    </target>
317  
318  
319 <  <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"
320 <          description="Puts all distributable products in single hierarchy"/>
319 >  <target name="run-tests"
320 >          depends="compile-tests">
321 >
322 >    <!-- May be overridden by user.properties -->
323 >    <property name="testcase" value="*"/>
324  
325 +    <mkdir dir="${build.reports.dir}"/>
326  
327 <  <target name="clean"
328 <          description="Removes all build products">
327 >    <junit printsummary="true"
328 >             showoutput="true"
329 >          errorProperty="junit.failed"
330 >        failureProperty="junit.failed"
331 >                    dir="${build.reports.dir}"
332 >                   fork="true">
333  
334 <    <delete dir="${build.dir}"/>
335 <    <delete dir="${build.classes.dir}"/>
336 <    <delete dir="${build.lib.dir}"/>
334 >      <jvmarg value="${bootclasspath.args}"/>
335 >      <jvmarg value="-server"/>
336 >      <jvmarg value="-showversion"/>
337 >
338 >      <classpath refid="test.classpath"/>
339 >
340 >      <formatter type="xml"/>
341 >
342 >      <batchtest todir="${build.reports.dir}" unless="no.test.tck">
343 >        <fileset dir="${tck.src.dir}">
344 >          <include name="**/${testcase}Test.java"/>
345 >        </fileset>
346 >      </batchtest>
347 >
348 >      <batchtest todir="${build.reports.dir}" if="do.test.old">
349 >        <fileset dir="${test.src.dir}">
350 >          <include name="jsr166/test/**/${testcase}Test.java"/>
351 >        </fileset>
352 >      </batchtest>
353 >
354 > <!--
355 >      <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
356 >        <fileset dir="${jtreg.src.dir}">
357 >          <include name="**/${testcase}Test.java"/>
358 >        </fileset>
359 >      </batchtest>
360 > -->
361 >
362 >    </junit>
363  
364    </target>
365  
366  
367 <  <target name="dist-clean"
368 <          description="Removes all build and distribution products">
367 >  <target name="report-tests"
368 >          depends="run-tests">
369  
370 <    <delete dir="${dist.dir}"/>
370 >    <!-- Sets junit.report.format to frames if redirection is present,
371 >         otherwise sets it to noframes. -->
372 >    <available property="junit.report.format"
373 >                  value="frames"
374 >              classname="org.apache.xalan.lib.Redirect"
375 >    />
376 >    <property name="junit.report.format" value="noframes"/>
377 >
378 >    <junitreport todir="${build.reports.dir}">
379 >      <fileset dir="${build.reports.dir}">
380 >        <include name="TEST-*.xml"/>
381 >      </fileset>
382 >      <report format="${junit.report.format}" todir="${build.reports.dir}"
383 >      />
384 >    </junitreport>
385 >
386 >    <fail message="Test Cases Failed" if="junit.failed"/>
387  
388    </target>
389  
390  
391 <  <!-- Anthill targets -->
391 >  <target name="configure-compiler">
392 >
393 >    <property name="unchecked.option" value="-Xlint:unchecked"/>
394 >
395 >    <condition property="warnunchecked.arg" value="${unchecked.option}">
396 >      <istrue value="${build.warnunchecked}"/>
397 >    </condition>
398 >
399 >    <property name="warnunchecked.arg" value=""/>
400  
249  <!-- Should really run the tests instead of just the jar target -->
250  <target name="anthill-build" depends="jar, test, docs, dist-docs"/>
401  
402 <  <target name="anthill-publish">
403 <    <copy todir="${deployDir}/docs/private">
404 <      <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>
402 >    <!-- Common options in javac invocations -->
403 >    <property name="build.args" value="${warnunchecked.arg}"/>
404 >
405    </target>
406  
407  
408 <  <!-- Internal targets -->
408 >  <target name="configure-tests"
409 >       depends="configure-compiler">
410 >
411 >    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
412 >    <available property="junit.available"
413 >               classname="junit.framework.Protectable"/>
414 >
415 >    <!-- Xalan -->
416 >    <available property="xalan.available"
417 >               classname="org.apache.xalan.Version"/>
418  
269  <target name="set-warnings-if" if="build.warnings">
419  
420 <    <property name="build.warnings.option" value="-warnunchecked"/>
420 >    <!-- Ant 1.6beta and later don't need or want this check -->
421 >    <!--
422 >    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
423 >          unless="junit.available"/>
424 >
425 >    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
426 >          unless="xalan.available"/>
427 >    -->
428  
429    </target>
430  
431  
432 <  <target name="set-warnings-unless" unless="build.warnings">
432 >  <!-- Various demos and test programs -->
433 >
434 >
435 >  <target name="loops" depends="init, configure-compiler"
436 >          description="Benchmark from Doug Lea's AQS paper">
437 >
438 >    <mkdir dir="${build.loops.dir}"/>
439 >
440 >    <javac srcdir="${loops.src.dir}"
441 >          destdir="${build.loops.dir}"
442 >            debug="${build.debug}"
443 >       debuglevel="${build.debuglevel}"
444 >      deprecation="${build.deprecation}"
445 >           source="${build.sourcelevel}"
446 >             fork="true">
447  
448 <    <property name="build.warnings.option" value=""/>
448 >      <compilerarg line="${build.args}"/>
449 >      <classpath refid="loops.classpath"/>
450 >      <compilerarg value="-XDignore.symbol.file=true"/>
451 >
452 >    </javac>
453 >
454 >    <java classname="ALoops" fork="true">
455 >      <classpath refid="loops.classpath"/>
456 >    </java>
457  
458    </target>
459  
460  
461 <  <target name="init" depends="set-warnings-if, set-warnings-unless">
461 >  <!-- jsr166x -->
462  
463 <    <!-- Version is kept in a separate file -->
464 <    <loadfile property="version" srcFile="version.properties"/>
465 <    <echo>Building JSR-166 version ${version}</echo>
463 >
464 >  <target name="jsr166xcompile"
465 >          depends="init, configure-compiler"
466 >          description="Compiles jsr166x sources">
467 >
468 >    <mkdir dir="${build.jsr166x.dir}"/>
469 >
470 >    <javac srcdir="${jsr166xsrc.dir}"
471 >          destdir="${build.jsr166x.dir}"
472 >            debug="${build.debug}"
473 >       debuglevel="${build.debuglevel}"
474 >      deprecation="${build.deprecation}"
475 >           source="${build.sourcelevel}"
476 >             fork="true">
477 >
478 >      <include name="**/*.java"/>
479 >      <compilerarg line="${build.args}"/>
480 >      <compilerarg value="-XDignore.symbol.file=true"/>
481 >
482 >    </javac>
483  
484    </target>
485  
486  
487 <  <target name="native-jar" depends="compile"
487 >
488 >  <target name="jsr166xjar"
489 >          depends="jsr166xcompile"
490            description="Builds library jar from compiled sources">
491  
492 <    <mkdir dir="${build.lib.dir}"/>
492 >    <mkdir dir="${build.jsr166xlib.dir}"/>
493  
494 <    <jar destfile="${product.jar}">
495 <      <fileset dir="${build.classes.dir}"/>
494 >    <jar destfile="${jsr166xproduct.jar}">
495 >      <fileset dir="${build.jsr166x.dir}"/>
496      </jar>
497  
498    </target>
499  
500  
304  <target name="compile-emulation" depends="init"
305          if="build.emulation"
306          description="Compiles emulation sources to build folder">
501  
502 <    <mkdir dir="${build.emulation.dir}"/>
502 >  <target name="jsr166xdocs"
503 >          description="Builds javadocs with custom tags to build folder">
504 >
505 >    <delete dir="${build.jsr166xjavadocs.dir}"/>
506 >    <mkdir dir="${build.jsr166xjavadocs.dir}"/>
507 >
508 >    <javadoc destdir="${build.jsr166xjavadocs.dir}"
509 >             packagenames="jsr166x"
510 >             link="http://download.oracle.com/javase/7/docs/api/"
511 >             source="${build.sourcelevel}"
512 >             sourcepath="${topsrc.dir}:${jdksrc.dir}"
513 >             additionalparam="-XDignore.symbol.file=true" />
514 >
515 >  </target>
516 >
517 >
518 >  <target name="jsr166xdist"
519 >          depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdist-docs"
520 >          description="Puts all distributable products in single hierarchy"/>
521 >
522 >
523 >
524 >  <target name="jsr166xclean"
525 >          description="Removes all build products">
526 >
527 >    <delete dir="${build.jsr166x.dir}"/>
528 >    <delete dir="${build.jsr166xlib.dir}"/>
529 >
530 >  </target>
531 >
532 >
533 >
534 >  <target name="jsr166xdist-clean"
535 >          description="Removes all build and distribution products">
536 >
537 >  </target>
538 >
539 >
540 >
541 >  <target name="jsr166xdist-docs"
542 >          description="Builds javadocs without custom tags to dist folder">
543 >
544 >    <delete dir="${dist.jsr166xjavadocs.dir}"/>
545 >    <mkdir dir="${dist.jsr166xjavadocs.dir}"/>
546 >
547 >    <javadoc destdir="${dist.jsr166xjavadocs.dir}"
548 >             packagenames="jsr166x"
549 >             link="http://download.oracle.com/javase/7/docs/api/"
550 >             source="${build.sourcelevel}"
551 >             sourcepath="${topsrc.dir}:${jdksrc.dir}"
552 >             additionalparam="-XDignore.symbol.file=true" />
553 >
554 >  </target>
555 >
556 >  <target name="jsr166xdist-jar"
557 >          depends="jsr166xclean, jsr166xjar">
558 >
559 >    <copy file="${jsr166xproduct.jar}" todir="${dist.dir}"/>
560 >
561 >  </target>
562 >
563 >  <!-- jsr166y -->
564 >
565 >
566 >  <target name="jsr166ycompile"
567 >          depends="init, configure-compiler"
568 >          description="Compiles jsr166y sources">
569  
570 <    <javac srcdir="${emulation.src.dir}"
571 <          destdir="${build.emulation.dir}"
570 >    <mkdir dir="${build.jsr166y.dir}"/>
571 >
572 >    <javac srcdir="${jsr166ysrc.dir}"
573 >          destdir="${build.jsr166y.dir}"
574              debug="${build.debug}"
575         debuglevel="${build.debuglevel}"
576        deprecation="${build.deprecation}"
577             source="${build.sourcelevel}"
578               fork="true">
579  
580 <      <bootclasspath refid="javac.bootclasspath"/>
581 <      <compilerarg line="${javac.args} ${build.warnings.option}"/>
580 >      <include name="**/*.java"/>
581 >      <compilerarg line="${build.args}"/>
582 >      <compilerarg value="-XDignore.symbol.file=true"/>
583 >      <compilerarg value="${bootclasspath.args}"/>
584 >
585 > <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
586  
587      </javac>
588  
589    </target>
590  
591  
326  <target name="emulation-jar" depends="native-jar, compile-emulation"
327          if="build.emulation">
592  
593 <    <jar destfile="${product.jar}" update="true" duplicate="add">
594 <      <fileset dir="${build.emulation.dir}"/>
593 >  <target name="jsr166yjar"
594 >          depends="jsr166ycompile"
595 >          description="Builds library jar from compiled sources">
596 >
597 >    <mkdir dir="${build.jsr166ylib.dir}"/>
598 >
599 >    <jar destfile="${jsr166yproduct.jar}" index="true">
600 >      <fileset dir="${build.jsr166y.dir}"/>
601      </jar>
602  
603    </target>
604  
605  
336  <target name="dist-jar" depends="clean, jar">
606  
607 <    <copy file="${product.jar}" todir="${dist.dir}"/>
607 >  <target name="jsr166ydocs"
608 >          description="Builds javadocs with custom tags to build folder">
609 >
610 >    <delete dir="${build.jsr166yjavadocs.dir}"/>
611 >    <mkdir dir="${build.jsr166yjavadocs.dir}"/>
612 >
613 >    <javadoc destdir="${build.jsr166yjavadocs.dir}"
614 >             packagenames="jsr166y"
615 >             link="http://download.oracle.com/javase/7/docs/api/"
616 >             source="${build.sourcelevel}"
617 >             sourcepath="${topsrc.dir}:${jdksrc.dir}"
618 >             additionalparam="-XDignore.symbol.file=true" />
619  
620    </target>
621  
622  
623 <  <target name="dist-docs" depends="filter-src"
624 <          description="Builds javadocs without custom tags to dist folder">
623 >  <target name="jsr166ydist"
624 >          depends="jsr166ydist-clean, jsr166ydist-jar, jsr166ydist-docs"
625 >          description="Puts all distributable products in single hierarchy"/>
626  
346    <delete dir="${dist.javadocs.dir}"/>
347    <mkdir dir="${dist.javadocs.dir}"/>
627  
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}">
628  
629 <      <packageset dir="${build.filter.src.dir}"/>
629 >  <target name="jsr166yclean"
630 >          description="Removes all build products">
631  
632 <    </javadoc>
632 >    <delete dir="${build.jsr166y.dir}"/>
633 >    <delete dir="${build.jsr166ylib.dir}"/>
634  
635    </target>
636  
637  
361  <target name="compile-ant-filter" depends="init">
638  
639 <    <mkdir dir="${build.ant.dir}"/>
640 <
365 <    <javac srcdir="${ant.src.dir}"
366 <          destdir="${build.ant.dir}"
367 <           source="1.4"
368 <    />
639 >  <target name="jsr166ydist-clean"
640 >          description="Removes all build and distribution products">
641  
642    </target>
643  
644 +  <target name="jsr166ydist-docs"
645 +          description="Builds javadocs without custom tags to dist folder">
646  
647 <  <target name="filter-src" depends="compile-ant-filter">
647 >    <delete dir="${dist.jsr166yjavadocs.dir}"/>
648 >    <mkdir dir="${dist.jsr166yjavadocs.dir}"/>
649  
650 <    <mkdir dir="${build.filter.src.dir}"/>
650 >    <javadoc destdir="${dist.jsr166yjavadocs.dir}"
651 >             packagenames="jsr166y"
652 >             link="http://download.oracle.com/javase/7/docs/api/"
653 >             source="${build.sourcelevel}"
654 >             sourcepath="${topsrc.dir}:${jdksrc.dir}"
655 >             additionalparam="-XDignore.symbol.file=true" />
656  
657 <    <copy todir="${build.filter.src.dir}">
658 <      <fileset dir="${src.dir}">
659 <        <include name="**/*.java"/>
660 <        <exclude name="**/Random.java"/>
661 <        <exclude name="**/Unsafe.java"/>
662 <      </fileset>
383 <      <filterchain>
384 <        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
385 <                      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 <           -->
397 <          <param name="notmatching" value="^\s+\*\s.*$"/>
398 <          <param name="pattern" value="&lt;[^|>()]+?>+"/>
399 <          <param name="replacement" value=" "/>
400 <        </filterreader>
401 <        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
402 <                      classpath="${build.ant.dir}">
403 <          <!--
404 <           # These arguments are to uncomment lines beginning with
405 <           # "//@" 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=""/>
412 <        </filterreader>
413 <      </filterchain>
414 <    </copy>
657 >  </target>
658 >
659 >  <target name="jsr166ydist-jar"
660 >          depends="jsr166yclean, jsr166yjar">
661 >
662 >    <copy file="${jsr166yproduct.jar}" todir="${dist.dir}"/>
663  
664    </target>
665  
666 +  <!-- extra166y -->
667  
419  <target name="compile-tests" depends="jar">
668  
669 <    <mkdir dir="${build.testcases.dir}"/>
669 >  <target name="extra166ycompile"
670 >          depends="init, configure-compiler, jsr166ycompile"
671 >          description="Compiles extra166y sources">
672  
673 <    <javac srcdir="${test.src.dir}"
674 <          destdir="${build.testcases.dir}"
673 >    <mkdir dir="${build.extra166y.dir}"/>
674 >
675 >    <javac srcdir="${extra166ysrc.dir}"
676 >          destdir="${build.extra166y.dir}"
677              debug="${build.debug}"
678 +            classpath="${jsr166yproduct.jar}"
679         debuglevel="${build.debuglevel}"
680        deprecation="${build.deprecation}"
681             source="${build.sourcelevel}"
682               fork="true">
683  
684 <      <bootclasspath refid="javac.bootclasspath"/>
685 <      <compilerarg line="${javac.args} ${build.warnings.option}"/>
686 <      <classpath refid="test.classpath"/>
684 >      <include name="**/*.java"/>
685 >      <compilerarg line="${build.args}"/>
686 >      <compilerarg value="-XDignore.symbol.file=true"/>
687 >      <compilerarg value="${bootclasspath.args}"/>
688 >
689 > <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
690  
691      </javac>
692  
693    </target>
694  
695  
440  <target name="run-tests" depends="compile-tests">
696  
697 <    <!-- May be overridden by user.properties -->
698 <    <property name="testcase" value="*"/>
697 >  <target name="extra166yjar"
698 >          depends="extra166ycompile"
699 >          description="Builds library jar from compiled sources">
700  
701 <    <mkdir dir="${build.reports.dir}"/>
701 >    <mkdir dir="${build.extra166ylib.dir}"/>
702  
703 <    <junit printsummary="true"
704 <             showoutput="true"
705 <          errorProperty="junit.failed"
450 <        failureProperty="junit.failed"
451 <                    dir="${build.reports.dir}"
452 <                   fork="true">
703 >    <jar destfile="${extra166yproduct.jar}" index="true">
704 >      <fileset dir="${build.extra166y.dir}"/>
705 >    </jar>
706  
707 <      <jvmarg value="${test.javac.args}"/>
707 >  </target>
708  
456      <formatter type="xml"/>
709  
458      <batchtest todir="${build.reports.dir}">
459        <fileset dir="${test.src.dir}">
460          <include name="**/${testcase}Test.java"/>
461        </fileset>
462      </batchtest>
710  
711 <    </junit>
711 >  <target name="extra166ydocs"
712 >          description="Builds javadocs with custom tags to build folder">
713 >
714 >    <delete dir="${build.extra166yjavadocs.dir}"/>
715 >    <mkdir dir="${build.extra166yjavadocs.dir}"/>
716 >
717 >    <javadoc destdir="${build.extra166yjavadocs.dir}"
718 >             packagenames="extra166y"
719 >             link="http://download.oracle.com/javase/7/docs/api/"
720 >             source="${build.sourcelevel}"
721 >             sourcepath="${topsrc.dir}:${jdksrc.dir}"
722 >             additionalparam="-XDignore.symbol.file=true" />
723  
724    </target>
725  
726  
727 <  <target name="report-tests" depends="run-tests">
728 <    <!-- Sets junit.report.format to frames if Xalan is present,
729 <         otherwise sets it to noframes. -->
472 <    <available property="junit.report.format"
473 <                  value="frames"
474 <              classname="org.apache.xalan.lib.Redirect"
475 <    />
476 <    <property name="junit.report.format" value="noframes"/>
727 >  <target name="extra166ydist"
728 >          depends="extra166ydist-clean, extra166ydist-jar, extra166ydist-docs"
729 >          description="Puts all distributable products in single hierarchy"/>
730  
478    <junitreport todir="${build.reports.dir}">
479      <fileset dir="${build.reports.dir}">
480        <include name="TEST-*.xml"/>
481      </fileset>
482      <report styledir="${stylesheet.dir}"
483                format="${junit.report.format}"
484                 todir="${build.reports.dir}"
485      />
486    </junitreport>
731  
732 <    <fail message="Test Cases Failed" if="junit.failed"/>
732 >
733 >  <target name="extra166yclean"
734 >          description="Removes all build products">
735 >
736 >    <delete dir="${build.extra166y.dir}"/>
737 >    <delete dir="${build.extra166ylib.dir}"/>
738 >
739    </target>
740  
741  
742 <  <target name="check-junit">
743 <    <!-- FIXME: this test isn't specific enough -->
744 <    <available property="junit.available"
745 <               classname="junit.framework.TestCase"/>
746 <    <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>
742 >
743 >  <target name="extra166ydist-clean"
744 >          description="Removes all build and distribution products">
745 >
746 >  </target>
747 >
748 >  <target name="extra166ydist-docs"
749 >          description="Builds javadocs without custom tags to dist folder">
750 >
751 >    <delete dir="${dist.extra166yjavadocs.dir}"/>
752 >    <mkdir dir="${dist.extra166yjavadocs.dir}"/>
753 >
754 >    <javadoc destdir="${dist.extra166yjavadocs.dir}"
755 >             packagenames="extra166y"
756 >             link="http://download.oracle.com/javase/7/docs/api/"
757 >             source="${build.sourcelevel}"
758 >             sourcepath="${topsrc.dir}:${jdksrc.dir}"
759 >             additionalparam="-XDignore.symbol.file=true" />
760 >
761    </target>
762  
763 +  <target name="extra166ydist-jar"
764 +          depends="extra166yclean, extra166yjar">
765 +
766 +    <copy file="${extra166yproduct.jar}" todir="${dist.dir}"/>
767 +
768 +  </target>
769  
770   </project>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines