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.53 by dl, Tue Aug 26 19:59:14 2003 UTC vs.
Revision 1.83 by dl, Sat Nov 13 13:20:12 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines