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.22 by tim, Wed May 14 21:30:37 2003 UTC vs.
Revision 1.42 by tim, Mon Jun 9 14:11:43 2003 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 1.8 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 +
22 +
23    <!-- Compilation options -->
24    <property name="build.sourcelevel"    value="1.5"/>
25 +  <property name="build.docsourcelevel" value="1.4"/>
26    <property name="build.debug"          value="true"/>
27    <property name="build.debuglevel"     value="source,lines,vars"/>
28    <property name="build.deprecation"    value="false"/>
36  <!--
37  <property name="build.warnings"       value="true"/>
38  -->
29  
30    <!-- Build locations -->
31    <property name="build.dir"            location="build"/>
32    <property name="build.classes.dir"    location="${build.dir}/classes"/>
33 +  <property name="build.emulation.dir"  location="${build.dir}/emulation"/>
34    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
35    <property name="build.lib.dir"        location="${build.dir}/lib"/>
36    <property name="build.ant.dir"        location="${build.dir}/ant"/>
# Line 51 | Line 42 | ant [target], where target is one of:
42  
43    <!-- Source locations -->
44    <property name="src.dir"              location="${basedir}/src/main"/>
45 +  <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
46    <property name="test.src.dir"         location="${basedir}/src/test"/>
47    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
48    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
# Line 62 | Line 54 | ant [target], where target is one of:
54  
55    <!-- Jar locations -->
56    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
65  <property name="javac.jar"            location="${lib.dir}/javac.jar"/>
66  <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  
70  <property name="javac.args"           value='-J-Xbootclasspath/p:${javac.jar}'/>
60  
61 <  <path id="javac.bootclasspath">
62 <    <pathelement location="${collect.jar}"/>
63 <    <pathelement location="${rt.jar}"/>
64 <  </path>
65 <
66 <  <path id="test.classpath">
67 <    <pathelement location="${product.jar}"/>
68 <  </path>
61 >
62 >  <!-- Files excluded from dist-docs and emulation jar -->
63 >  <patternset id="unsafe.exclusion">
64 >    <exclude name="java/util/Random.*"/>
65 >    <exclude name="sun/misc/Unsafe.*"/>
66 >  </patternset>
67 >
68 >  <!-- Files excludes from emulation jar -->
69 >  <patternset id="atomic.exclusion">
70 >    <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
71 >    <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
72 >    <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
73 >    <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
74 >  </patternset>
75 >
76  
77  
78    <!-- Main targets -->
79  
80 <  <target name="compile" depends="init"
81 <          description="Compiles all sources to build folder">
80 >  <target name="compile"
81 >          depends="init, configure-compiler, prepare-src"
82 >          description="Compiles main sources to build folder">
83 >
84 >    <property name="prepare.src.dir" value="${src.dir}"/>
85 >
86      <mkdir dir="${build.classes.dir}"/>
87 <    <javac srcdir="${src.dir}"
87 >
88 > <!--
89 >    <echo>javac ${gjc.args}</echo>
90 >    <echo>bootclasspath=${compile.bootclasspath}</echo>
91 > -->
92 >
93 >    <javac srcdir="${prepare.src.dir}"
94            destdir="${build.classes.dir}"
95              debug="${build.debug}"
96         debuglevel="${build.debuglevel}"
# Line 92 | Line 98 | ant [target], where target is one of:
98             source="${build.sourcelevel}"
99               fork="true">
100  
101 <      <bootclasspath refid="javac.bootclasspath"/>
102 <      <compilerarg line="${javac.args} ${build.warnings.option}"/>
101 >      <compilerarg    line="${gjc.args}"/>
102 >      <bootclasspath refid="compile.bootclasspath"/>
103  
104      </javac>
105 +
106    </target>
107  
108  
109 <  <target name="jar" depends="compile"
110 <          description="Builds library jar from compiled sources">
111 <    <mkdir dir="${build.lib.dir}"/>
105 <    <jar basedir="${build.classes.dir}"
106 <        destfile="${product.jar}"
107 <    />
108 <  </target>
109 >  <target name="jar"
110 >          depends="configure-emulation, init-jar, native-jar, emulation-jar"
111 >          description="Builds library jar from compiled sources"/>
112  
113  
114 <  <target name="test" depends="init, check-junit, report-tests"
115 <          description="Runs all tests (requires JUnit 1.8 in ${ant.home}/lib)"/>
114 >  <target name="test"
115 >          depends="init, configure-tests, report-tests"
116 >          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
117  
118  
119 <  <target name="checkstyle" depends="filter-src"
119 >  <target name="checkstyle"
120 >          depends="filter-src"
121            description="Reports on style errors in Java source (verbose, mostly chaff)">
122 +
123      <taskdef resource="checkstyletask.properties"
124              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
125  
# Line 121 | Line 127 | ant [target], where target is one of:
127        <formatter type="plain"/>  <!-- also available: type="xml" -->
128        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
129      </checkstyle>
130 +
131    </target>
132  
133  
134 <  <target name="doccheck" depends="filter-src"
134 >  <target name="doccheck"
135 >          depends="filter-src"
136            description="Reports on javadoc style errors (not working yet)">
137 +
138      <delete dir="${build.doccheck.dir}"/>
139      <mkdir dir="${build.doccheck.dir}"/>
140 +
141      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
142           docletpath="${lib.dir}/doccheck.jar"
143              destdir="${build.doccheck.dir}">
144        <packageset dir="${build.filter.src.dir}"/>
145      </javadoc>
146 +
147    </target>
148  
149  
150 <  <target name="docs" depends="filter-src"
150 >  <target name="docs"
151 >          depends="filter-src"
152            description="Builds javadocs with custom tags to build folder">
153 +
154      <delete dir="${build.javadocs.dir}"/>
155      <mkdir dir="${build.javadocs.dir}"/>
156 +
157      <javadoc destdir="${build.javadocs.dir}"
158                  link="http://java.sun.com/j2se/1.4.1/docs/api"
159              overview="${src.dir}/intro.html"
160 <              source="${build.sourcelevel}">
160 >              source="${build.docsourcelevel}">
161  
162        <tag name="revised" description="Last revised:"/>
163 <      <tag name="spec" description="Specified by:"/>
164 <      <tag name="editor" description="Last edited by:"/>
165 <      <tag name="fixme" description="FIX ME:"/>
163 >      <tag name="spec"    description="Specified by:"/>
164 >      <tag name="editor"  description="Last edited by:"/>
165 >      <tag name="fixme"   description="FIX ME:"/>
166 >
167        <packageset dir="${build.filter.src.dir}"/>
168  
169      </javadoc>
170 +
171    </target>
172  
173  
174 <  <!--
175 <   # javac -s doesn't reliably generate compilable code. It generates
176 <   # bridge methods (marked as "synthetic") that can have identical
177 <   # signatures to existing methods except for the return value.
162 <   -->
163 <  <target name="strip" depends="init">
174 >  <target name="strip"
175 >          depends="init, configure-compiler"
176 >          description="Strip generics from java source (not working yet)">
177 >
178      <mkdir dir="${build.stripped.dir}"/>
179 +
180 +    <!--
181 +     # javac -s doesn't reliably generate compilable code. It generates
182 +     # bridge methods (marked as "synthetic") that can have identical
183 +     # signatures to existing methods except for the return value.
184 +     -->
185      <javac srcdir="${src.dir}"
186            destdir="${build.stripped.dir}"
187              debug="${build.debug}"
# Line 170 | Line 190 | ant [target], where target is one of:
190             source="${build.sourcelevel}"
191               fork="true">
192  
193 <      <bootclasspath refid="javac.bootclasspath"/>
194 <      <compilerarg line="${javac.args} ${build.warnings.option} -s"/>
193 >      <compilerarg    line="${gjc.args} -s"/>
194 >      <bootclasspath refid="compile.bootclasspath"/>
195  
196      </javac>
197 +
198    </target>
199  
200  
201 <  <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"
201 >  <target name="dist"
202 >          depends="init, dist-clean, dist-jar, dist-docs"
203            description="Puts all distributable products in single hierarchy"/>
204  
205 +  <target name="release"
206 +          depends="dist"
207 +          description="Puts entire CVS tree, plus distribution productions, in a jar">
208 +
209 +    <delete dir="${build.dir}"/>
210 +
211 +    <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
212 +
213 +    <jar basedir="${basedir}" destfile="${release.jar}">
214 +      <exclude name="${release.jar}"/>
215 +      <exclude name="user.properties"/>
216 +      <exclude name="etc/notes/**"/>
217 +    </jar>
218 +
219 +  </target>
220  
221    <target name="clean"
222            description="Removes all build products">
223 +
224      <delete dir="${build.dir}"/>
225      <delete dir="${build.classes.dir}"/>
226      <delete dir="${build.lib.dir}"/>
227 +
228    </target>
229  
230  
231    <target name="dist-clean"
232            description="Removes all build and distribution products">
233 +
234      <delete dir="${dist.dir}"/>
235 +
236    </target>
237  
238  
239 <  <!-- Anthill targets -->
239 >  <target name="dist-docs"
240 >          depends="filter-src"
241 >          description="Builds javadocs without custom tags to dist folder">
242  
243 <  <!-- Should really run the tests instead of just the jar target -->
244 <  <target name="anthill-build" depends="jar, docs, dist-docs"/>
243 >    <delete dir="${dist.javadocs.dir}"/>
244 >    <mkdir dir="${dist.javadocs.dir}"/>
245  
246 <  <target name="anthill-publish">
247 <    <copy todir="${deployDir}/docs/private">
248 <      <fileset dir="${build.javadocs.dir}"/>
249 <    </copy>
207 <    <copy todir="${deployDir}/docs/public">
208 <      <fileset dir="${dist.javadocs.dir}"/>
209 <    </copy>
210 <    <copy tofile="${deployDir}/index.html"
211 <          file="${basedir}/etc/anthill-index.html"/>
212 <    <copy todir="${deployDir}/notes">
213 <      <fileset dir="${basedir}/etc/notes"/>
214 <    </copy>
215 <  </target>
246 >    <javadoc destdir="${dist.javadocs.dir}"
247 >                link="http://java.sun.com/j2se/1.4.1/docs/api"
248 >            overview="${src.dir}/intro.html"
249 >              source="${build.docsourcelevel}">
250  
251 +      <packageset dir="${build.filter.src.dir}"/>
252  
253 <  <!-- Internal targets -->
253 >    </javadoc>
254  
220  <target name="set-warnings-if" if="build.warnings">
221    <property name="build.warnings.option" value="-warnunchecked"/>
255    </target>
256  
257  
225  <target name="set-warnings-unless" unless="build.warnings">
226    <property name="build.warnings.option" value=""/>
227  </target>
258  
259 +  <!-- Internal targets -->
260 +
261 +
262 +  <target name="init">
263  
230  <target name="init" depends="set-warnings-if, set-warnings-unless">
264      <!-- Version is kept in a separate file -->
265      <loadfile property="version" srcFile="version.properties"/>
266      <echo>Building JSR-166 version ${version}</echo>
267 +
268    </target>
269  
270  
271 <  <target name="dist-jar" depends="clean, jar">
272 <    <copy file="${product.jar}" todir="${dist.dir}"/>
271 >  <target name="init-jar">
272 >
273 >    <mkdir dir="${build.lib.dir}"/>
274 >
275    </target>
276  
277  
278 <  <target name="dist-docs" depends="filter-src"
279 <          description="Builds javadocs without custom tags to dist folder">
280 <    <delete dir="${dist.javadocs.dir}"/>
245 <    <mkdir dir="${dist.javadocs.dir}"/>
246 <    <javadoc destdir="${dist.javadocs.dir}"
247 <                link="http://java.sun.com/j2se/1.4.1/docs/api"
248 <            overview="${src.dir}/intro.html"
249 <              source="${build.sourcelevel}">
278 >  <target name="native-jar"
279 >          depends="compile"
280 >          unless="build.emulation.true">
281  
282 <      <packageset dir="${build.filter.src.dir}"/>
282 >    <jar destfile="${product.jar}">
283 >      <fileset dir="${build.classes.dir}"/>
284 >    </jar>
285 >
286 >  </target>
287 >
288 >
289 >  <target name="compile-emulation"
290 >          depends="init, configure-compiler"
291 >          if="build.emulation.true">
292 >
293 >    <mkdir dir="${build.emulation.dir}"/>
294 >
295 >    <javac srcdir="${emulation.src.dir}"
296 >          destdir="${build.emulation.dir}"
297 >            debug="${build.debug}"
298 >       debuglevel="${build.debuglevel}"
299 >      deprecation="${build.deprecation}"
300 >           source="${build.sourcelevel}"
301 >             fork="true">
302 >
303 >      <compilerarg    line="${gjc.args}"/>
304 >      <bootclasspath refid="compile.bootclasspath"/>
305 >
306 >    </javac>
307 >
308 >  </target>
309 >
310 >
311 >  <target name="emulation-jar"
312 >          depends="compile-emulation"
313 >          if="build.emulation.true">
314 >
315 >
316 >    <jar destfile="${product.jar}" duplicate="add">
317 >      <fileset dir="${build.classes.dir}">
318 >        <patternset refid="atomic.exclusion"/>
319 >        <patternset refid="unsafe.exclusion"/>
320 >      </fileset>
321 >      <fileset dir="${build.emulation.dir}"/>
322 >    </jar>
323 >
324 >  </target>
325 >
326 >
327 >  <target name="dist-jar"
328 >          depends="clean, jar">
329 >
330 >    <copy file="${product.jar}" todir="${dist.dir}"/>
331  
253    </javadoc>
332    </target>
333  
334  
335 <  <target name="compile-ant-filter" depends="init">
335 >  <target name="compile-ant-filter"
336 >          depends="init">
337 >
338      <mkdir dir="${build.ant.dir}"/>
339 +
340      <javac srcdir="${ant.src.dir}"
341            destdir="${build.ant.dir}"
342             source="1.4"
343      />
344 +
345    </target>
346  
347  
348 <  <target name="filter-src" depends="compile-ant-filter">
348 >  <target name="filter-src"
349 >          depends="compile-ant-filter">
350 >
351      <mkdir dir="${build.filter.src.dir}"/>
352 +
353      <copy todir="${build.filter.src.dir}">
354        <fileset dir="${src.dir}">
355 <        <include name="**/*.java"/>
355 >        <include name="**/*.html"/>
356 >      </fileset>
357 >    </copy>
358 >
359 >    <!-- Not needed now, used for doccheck filtering:
360 >    <property name="generic.declarations"
361 >             value="public interface E {} public interface T {} public interface K {} public interface V {}"
362 >    />
363 >    -->
364 >
365 >    <copy todir="${build.filter.src.dir}">
366 >      <fileset dir="${src.dir}">
367 >        <exclude name="**/*.html"/>
368 >        <patternset refid="unsafe.exclusion"/>
369        </fileset>
370        <filterchain>
371 +
372 +        <!--
373 +         # This filter gets rid of angle-bracketed type parameters
374 +         # so that javadoc can run on the result. The following
375 +         # heuristic seems to work:
376 +         #
377 +         # For all lines not starting with space(s)-asterisk-space(s),
378 +         #   replace <something> with a space, where there may be more
379 +         #   than one right angle bracket at the end, and "something"
380 +         #   must not contain parens or pipes. (This may need some
381 +         #   tweaking.)
382 +         -->
383 +
384          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
385                        classpath="${build.ant.dir}">
275          <!--
276           # These arguments are to get rid of angle-bracketed type
277           # parameters so that javadoc can run on the result. The
278           # following heuristic that seems to work:
279           #
280           # For all lines not starting with space(s)-asterisk-space(s),
281           #   replace <something> with a space, where there may be more
282           #   than one right angle bracket at the end, and "something"
283           #   must not contain parens or pipes. (This may need some
284           #   tweaking.)
285           -->
386            <param name="notmatching" value="^\s+\*\s.*$"/>
387 <          <param name="pattern" value="&lt;[^|>()]+?>+"/>
387 >          <param name="pattern"     value="&lt;[^|>()]+?>+"/>
388            <param name="replacement" value=" "/>
389          </filterreader>
390 +
391 +
392 +        <!--
393 +         # This filter uncomments lines beginning with "//@" so that
394 +         # javadoc can see imports that are needed to resolve links
395 +         # but that shouldn't be in the compiled code.
396 +         -->
397 +
398          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
399                        classpath="${build.ant.dir}">
400 <          <!--
401 <           # These arguments are to uncomment lines beginning with
294 <           # "//@" so that javadoc can see imports that are needed
295 <           # to resolve links but that shouldn't be in the compiled
296 <           # code.
297 <           -->
298 <          <param name="matching" value="^//@.*$"/>
299 <          <param name="pattern" value="^//@"/>
400 >          <param name="matching"    value="^//@.*$"/>
401 >          <param name="pattern"     value="^//@"/>
402            <param name="replacement" value=""/>
403          </filterreader>
404 +
405 +
406 +        <!--
407 +         # The next two filters try to make the source look like
408 +         # something that doccheck can process. The first removes
409 +         # -source 1.4 assertions and the second adds in a bunch
410 +         # of single letter public nested marker interfaces so that
411 +         # the generic type parameters are recognized.
412 +         #
413 +         # Currently commented out because doccheck doesn't work. :-(
414 +         -->
415 +
416 +        <!--
417 +        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
418 +                      classpath="${build.ant.dir}">
419 +          <param name="matching"    value="^\s*assert[\s ].*$"/>
420 +          <param name="pattern"     value="assert"/>
421 +          <param name="replacement" value="//assert"/>
422 +        </filterreader>
423 +
424 +        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
425 +                      classpath="${build.ant.dir}">
426 +          <param name="matching"    value="^(.*(class|interface|implements) .*|)\{.*$"/>
427 +          <param name="pattern"     value="$"/>
428 +          <param name="replacement" value=" ${generic.declarations}"/>
429 +        </filterreader>
430 +        -->
431 +
432        </filterchain>
433      </copy>
434 +
435    </target>
436  
437  
438 <  <target name="compile-tests" depends="jar">
438 >  <target name="compile-tests"
439 >          depends="jar">
440 >
441      <mkdir dir="${build.testcases.dir}"/>
442 +
443 + <!--
444 +    <echo>javac ${gjc.args}</echo>
445 +    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
446 +    <echo>classpath="${test.classpath}"</echo>
447 + -->
448 +
449      <javac srcdir="${test.src.dir}"
450            destdir="${build.testcases.dir}"
451              debug="${build.debug}"
# Line 314 | Line 454 | ant [target], where target is one of:
454             source="${build.sourcelevel}"
455               fork="true">
456  
457 <      <bootclasspath refid="javac.bootclasspath"/>
458 <      <compilerarg line="${javac.args} ${build.warnings.option}"/>
459 <      <classpath refid="test.classpath"/>
457 >      <compilerarg    line="${gjc.args}"/>
458 >      <bootclasspath refid="test.compile.bootclasspath"/>
459 >      <classpath     refid="test.classpath"/>
460  
461      </javac>
462 +
463    </target>
464  
465  
466 <  <target name="run-tests" depends="compile-tests">
466 >  <target name="run-tests"
467 >          depends="compile-tests">
468 >
469 >    <!-- May be overridden by user.properties -->
470 >    <property name="testcase" value="*"/>
471 >
472      <mkdir dir="${build.reports.dir}"/>
473 +
474      <junit printsummary="true"
475               showoutput="true"
476            errorProperty="junit.failed"
# Line 331 | Line 478 | ant [target], where target is one of:
478                      dir="${build.reports.dir}"
479                     fork="true">
480  
481 <      <!--
335 <       ! This nastiness is so JUnit can test classes we are inserting
336 <       ! into the java.* packages.
337 <       -->
338 <      <jvmarg value="-Xbootclasspath/p:${product.jar};${build.testcases.dir};${junit.jar}"/>
481 >      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
482  
483        <formatter type="xml"/>
484  
485        <batchtest todir="${build.reports.dir}">
486          <fileset dir="${test.src.dir}">
487 <          <include name="**/*Test.java"/>
487 >          <include name="**/${testcase}Test.java"/>
488          </fileset>
489        </batchtest>
490  
491      </junit>
492 +
493    </target>
494  
495  
496 <  <target name="report-tests" depends="run-tests">
496 >  <target name="report-tests"
497 >          depends="run-tests">
498 >
499      <!-- Sets junit.report.format to frames if Xalan is present,
500           otherwise sets it to noframes. -->
501      <available property="junit.report.format"
# Line 369 | Line 515 | ant [target], where target is one of:
515      </junitreport>
516  
517      <fail message="Test Cases Failed" if="junit.failed"/>
518 +
519    </target>
520  
521  
522 <  <target name="check-junit">
523 <    <!-- FIXME: this test isn't specific enough -->
522 >  <target name="configure-compiler">
523 >
524 >    <property name="gjc.version"
525 >             value="2.0"/>
526 >
527 >    <condition property="novariance.arg" value="-novariance">
528 >      <and>
529 >        <equals arg1="${gjc.version}" arg2="2.0"/>
530 >        <or>
531 >          <not><isset property="gjc.novariance"/></not>
532 >          <istrue value="${gjc.novariance}"/>
533 >        </or>
534 >      </and>
535 >    </condition>
536 >
537 >    <property name="novariance.arg"
538 >             value=""/>
539 >
540 >    <property name="gjc.dir"
541 >             value="${lib.dir}/gjc"/>
542 >
543 >    <property name="javac.jar"
544 >          location="${gjc.dir}/${gjc.version}/javac.jar"/>
545 >
546 >    <property name="collect.jar"
547 >          location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
548 >
549 >
550 >    <condition property="warnunchecked.arg" value="-warnunchecked">
551 >      <istrue value="${gjc.warnunchecked}"/>
552 >    </condition>
553 >
554 >    <property name="warnunchecked.arg" value=""/>
555 >
556 >    <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
557 >      <istrue value="${build.nothreads}"/>
558 >    </condition>
559 >
560 >
561 >    <!--
562 >     ! Bootclasspath munging for source compilation.
563 >     -->
564 >
565 >    <path id="pre.bootclasspath">
566 >      <pathelement location="${javac.jar}"/>
567 >    </path>
568 >
569 >    <path id="compile.bootclasspath">
570 >      <pathelement location="${build.classes.dir}"/>
571 >      <pathelement location="${collect.jar}"/>
572 >      <pathelement location="${rt.jar}"/>
573 >    </path>
574 >
575 >    <!-- Flatten paths into platform-appropriate strings -->
576 >    <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
577 >    <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
578 >
579 >
580 >    <!-- Common options in javac invocations -->
581 >    <property name="gjc.args"
582 >             value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
583 >    />
584 >
585 >  </target>
586 >
587 >
588 >  <target name="prepare-src"
589 >          depends="configure-compiler"
590 >          if="prepare.src.dir">
591 >
592 >    <mkdir dir="${prepare.src.dir}"/>
593 >    <copy todir="${prepare.src.dir}">
594 >      <fileset dir="${src.dir}">
595 >        <exclude name="java/lang/**"/>
596 >      </fileset>
597 >    </copy>
598 >
599 >  </target>
600 >
601 >
602 >  <target name="configure-emulation">
603 >
604 >    <condition property="build.emulation.true">
605 >      <or>
606 >        <and>
607 >          <os family="windows"/>
608 >          <not>
609 >            <isset property="build.emulation"/>
610 >          </not>
611 >        </and>
612 >        <istrue value="${build.emulation}"/>
613 >      </or>
614 >    </condition>
615 >
616 >  </target>
617 >
618 >
619 >  <target name="configure-tests"
620 >       depends="configure-compiler">
621 >
622 >    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
623      <available property="junit.available"
624 <               classname="junit.framework.TestCase"/>
625 <    <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>
624 >               classname="junit.framework.Protectable"/>
625 >
626 >    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
627 >          unless="junit.available"/>
628 >
629 >
630 >    <!--
631 >     ! Bootclasspath munging for testing, so JUnit can test our local
632 >     ! modifications to java.*.
633 >     -->
634 >
635 >    <path id="test.classpath">
636 >      <pathelement location="${product.jar}"/>
637 >      <pathelement location="${build.testcases.dir}"/>
638 >      <pathelement location="${junit.jar}"/>
639 >    </path>
640 >
641 >    <path id="test.compile.bootclasspath">
642 >      <pathelement location="${javac.jar}"/>
643 >      <pathelement location="${collect.jar}"/>
644 >      <pathelement location="${rt.jar}"/>
645 >    </path>
646 >
647 >    <path id="test.run.bootclasspath">
648 >      <pathelement location="${javac.jar}"/>
649 >      <path refid="test.classpath"/>
650 >    </path>
651 >
652 >    <!-- Flatten test classpaths into platform-appropriate strings -->
653 >    <property name="test.classpath"             refid="test.classpath"/>
654 >    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
655 >    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
656 >
657 >  </target>
658 >
659 >
660 >
661 >  <!-- Anthill targets -->
662 >
663 >  <target name="anthill-build"
664 >          depends="jar, test, docs, dist-docs"/>
665 >
666 >  <target name="anthill-publish">
667 >
668 >    <copy todir="${deployDir}/docs/private">
669 >      <fileset dir="${build.javadocs.dir}"/>
670 >    </copy>
671 >
672 >    <copy todir="${deployDir}/docs/public">
673 >      <fileset dir="${dist.javadocs.dir}"/>
674 >    </copy>
675 >
676 >    <copy tofile="${deployDir}/index.html"
677 >          file="${basedir}/etc/anthill-index.html"/>
678 >
679 >    <copy todir="${deployDir}/notes">
680 >      <fileset dir="${basedir}/etc/notes"/>
681 >    </copy>
682 >
683    </target>
684  
685  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines