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.35 by tim, Thu May 29 15:53:58 2003 UTC vs.
Revision 1.41 by tim, Fri Jun 6 20:48:55 2003 UTC

# Line 59 | Line 59
59  
60  
61  
62 <  <!-- Files excluded from emulation and dist-docs -->
63 <  <patternset id="emulation.excludes">
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 -->
# Line 77 | Line 85
85  
86      <mkdir dir="${build.classes.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}"
# Line 85 | Line 98
98             source="${build.sourcelevel}"
99               fork="true">
100  
101 <      <bootclasspath refid="javac.bootclasspath"/>
102 <      <compilerarg line="${build.javac.args}"/>
101 >      <compilerarg    line="${gjc.args}"/>
102 >      <bootclasspath refid="compile.bootclasspath"/>
103  
104      </javac>
105  
# Line 177 | Line 190
190             source="${build.sourcelevel}"
191               fork="true">
192  
193 <      <bootclasspath refid="javac.bootclasspath"/>
194 <      <compilerarg line="${build.javac.args} -s"/>
193 >      <compilerarg    line="${gjc.args} -s"/>
194 >      <bootclasspath refid="compile.bootclasspath"/>
195  
196      </javac>
197  
# Line 272 | Line 285
285             source="${build.sourcelevel}"
286               fork="true">
287  
288 <      <bootclasspath refid="javac.bootclasspath"/>
289 <      <compilerarg line="${build.javac.args}"/>
288 >      <compilerarg    line="${gjc.args}"/>
289 >      <bootclasspath refid="compile.bootclasspath"/>
290  
291      </javac>
292  
# Line 287 | Line 300
300  
301      <jar destfile="${product.jar}" duplicate="add">
302        <fileset dir="${build.classes.dir}">
303 <        <patternset refid="emulation.excludes"/>
303 >        <patternset refid="atomic.exclusion"/>
304 >        <patternset refid="unsafe.exclusion"/>
305        </fileset>
306        <fileset dir="${build.emulation.dir}"/>
307      </jar>
# Line 327 | Line 341
341        </fileset>
342      </copy>
343  
344 +    <!-- Not needed now, used for doccheck filtering:
345 +    <property name="generic.declarations"
346 +             value="public interface E {} public interface T {} public interface K {} public interface V {}"
347 +    />
348 +    -->
349 +
350      <copy todir="${build.filter.src.dir}">
351        <fileset dir="${src.dir}">
352          <exclude name="**/*.html"/>
353 <        <patternset refid="emulation.excludes"/>
353 >        <patternset refid="unsafe.exclusion"/>
354        </fileset>
355        <filterchain>
356 +
357 +        <!--
358 +         # This filter gets rid of angle-bracketed type parameters
359 +         # so that javadoc can run on the result. The following
360 +         # heuristic seems to work:
361 +         #
362 +         # For all lines not starting with space(s)-asterisk-space(s),
363 +         #   replace <something> with a space, where there may be more
364 +         #   than one right angle bracket at the end, and "something"
365 +         #   must not contain parens or pipes. (This may need some
366 +         #   tweaking.)
367 +         -->
368 +
369          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
370                        classpath="${build.ant.dir}">
338          <!--
339           # These arguments are to get rid of angle-bracketed type
340           # parameters so that javadoc can run on the result. The
341           # following heuristic that seems to work:
342           #
343           # For all lines not starting with space(s)-asterisk-space(s),
344           #   replace <something> with a space, where there may be more
345           #   than one right angle bracket at the end, and "something"
346           #   must not contain parens or pipes. (This may need some
347           #   tweaking.)
348           -->
371            <param name="notmatching" value="^\s+\*\s.*$"/>
372 <          <param name="pattern" value="&lt;[^|>()]+?>+"/>
372 >          <param name="pattern"     value="&lt;[^|>()]+?>+"/>
373            <param name="replacement" value=" "/>
374          </filterreader>
375 +
376 +
377 +        <!--
378 +         # This filter uncomments lines beginning with "//@" so that
379 +         # javadoc can see imports that are needed to resolve links
380 +         # but that shouldn't be in the compiled code.
381 +         -->
382 +
383          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
384                        classpath="${build.ant.dir}">
385 <          <!--
386 <           # These arguments are to uncomment lines beginning with
357 <           # "//@" so that javadoc can see imports that are needed
358 <           # to resolve links but that shouldn't be in the compiled
359 <           # code.
360 <           -->
361 <          <param name="matching" value="^//@.*$"/>
362 <          <param name="pattern" value="^//@"/>
385 >          <param name="matching"    value="^//@.*$"/>
386 >          <param name="pattern"     value="^//@"/>
387            <param name="replacement" value=""/>
388          </filterreader>
389 +
390 +
391 +        <!--
392 +         # The next two filters try to make the source look like
393 +         # something that doccheck can process. The first removes
394 +         # -source 1.4 assertions and the second adds in a bunch
395 +         # of single letter public nested marker interfaces so that
396 +         # the generic type parameters are recognized.
397 +         #
398 +         # Currently commented out because doccheck doesn't work. :-(
399 +         -->
400 +
401 +        <!--
402 +        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
403 +                      classpath="${build.ant.dir}">
404 +          <param name="matching"    value="^\s*assert[\s ].*$"/>
405 +          <param name="pattern"     value="assert"/>
406 +          <param name="replacement" value="//assert"/>
407 +        </filterreader>
408 +
409 +        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
410 +                      classpath="${build.ant.dir}">
411 +          <param name="matching"    value="^(.*(class|interface|implements) .*|)\{.*$"/>
412 +          <param name="pattern"     value="$"/>
413 +          <param name="replacement" value=" ${generic.declarations}"/>
414 +        </filterreader>
415 +        -->
416 +
417        </filterchain>
418      </copy>
419  
# Line 373 | Line 425
425  
426      <mkdir dir="${build.testcases.dir}"/>
427  
428 + <!--
429 +    <echo>javac ${gjc.args}</echo>
430 +    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
431 +    <echo>classpath="${test.classpath}"</echo>
432 + -->
433 +
434      <javac srcdir="${test.src.dir}"
435            destdir="${build.testcases.dir}"
436              debug="${build.debug}"
# Line 381 | Line 439
439             source="${build.sourcelevel}"
440               fork="true">
441  
442 <      <classpath refid="test.classpath"/>
443 <      <bootclasspath refid="javac.bootclasspath"/>
444 <      <compilerarg line="${build.javac.args}"/>
442 >      <compilerarg    line="${gjc.args}"/>
443 >      <bootclasspath refid="test.compile.bootclasspath"/>
444 >      <classpath     refid="test.classpath"/>
445  
446      </javac>
447  
# Line 405 | Line 463
463                      dir="${build.reports.dir}"
464                     fork="true">
465  
466 <      <jvmarg value="${test.bootclasspath.arg}"/>
466 >      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
467  
468        <formatter type="xml"/>
469  
# Line 451 | Line 509
509      <property name="gjc.version"
510               value="2.0"/>
511  
512 <    <condition property="build.novariance" value="-novariance">
512 >    <condition property="novariance.arg" value="-novariance">
513        <and>
514          <equals arg1="${gjc.version}" arg2="2.0"/>
515          <or>
# Line 461 | Line 519
519        </and>
520      </condition>
521  
522 <    <property name="build.novariance"
522 >    <property name="novariance.arg"
523               value=""/>
524  
525      <property name="gjc.dir"
# Line 471 | Line 529
529            location="${gjc.dir}/${gjc.version}/javac.jar"/>
530  
531      <property name="collect.jar"
532 <          location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/>
532 >          location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
533  
534  
535 <    <condition property="build.warnunchecked" value="-warnunchecked">
535 >    <condition property="warnunchecked.arg" value="-warnunchecked">
536        <istrue value="${gjc.warnunchecked}"/>
537      </condition>
538  
539 <    <property name="build.warnunchecked" value=""/>
539 >    <property name="warnunchecked.arg" value=""/>
540  
541      <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
542        <istrue value="${build.nothreads}"/>
# Line 489 | Line 547
547       ! Bootclasspath munging for source compilation.
548       -->
549  
550 <    <path id="javac.bootclasspath.prefix">
493 <      <!-- <pathelement location="${src.dir}"/> -->
550 >    <path id="pre.bootclasspath">
551        <pathelement location="${javac.jar}"/>
552      </path>
553  
554 <    <path id="javac.bootclasspath">
555 <      <!-- <pathelement location="${src.dir}"/> -->
554 >    <path id="compile.bootclasspath">
555 >      <pathelement location="${build.classes.dir}"/>
556        <pathelement location="${collect.jar}"/>
557        <pathelement location="${rt.jar}"/>
558      </path>
559  
560 <    <!-- Flatten bootclasspath prefix into a platform-appropriate string -->
561 <    <property name="javac.bootclasspath.prefix"
562 <             refid="javac.bootclasspath.prefix"/>
506 <
507 <    <!-- Turn the flattened bootclasspath prefix into a javac argument -->
508 <    <property name="build.bootclasspath.arg"
509 <             value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>
510 <
511 <    <!-- Flatten bootclasspath for trace message -->
512 <    <property name="javac.bootclasspath"
513 <             refid="javac.bootclasspath"/>
560 >    <!-- Flatten paths into platform-appropriate strings -->
561 >    <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
562 >    <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
563  
515    <!-- Common options in javac invocations -->
516    <property name="build.javac.args"
517             value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/>
564  
565 <    <echo>javac ${build.javac.args}</echo>
566 <    <echo>bootclasspath=${javac.bootclasspath}</echo>
565 >    <!-- Common options in javac invocations -->
566 >    <property name="gjc.args"
567 >             value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
568 >    />
569  
570    </target>
571  
# Line 553 | Line 601
601    </target>
602  
603  
604 <  <target name="configure-tests">
604 >  <target name="configure-tests"
605 >       depends="configure-compiler">
606  
607      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
608      <available property="junit.available"
# Line 574 | Line 623
623        <pathelement location="${junit.jar}"/>
624      </path>
625  
626 <    <!-- Flatten test classpath into a platform-appropriate string -->
627 <    <property name="test.classpath" refid="test.classpath"/>
626 >    <path id="test.compile.bootclasspath">
627 >      <pathelement location="${javac.jar}"/>
628 >      <pathelement location="${collect.jar}"/>
629 >      <pathelement location="${rt.jar}"/>
630 >    </path>
631 >
632 >    <path id="test.run.bootclasspath">
633 >      <pathelement location="${javac.jar}"/>
634 >      <path refid="test.classpath"/>
635 >    </path>
636  
637 <    <!-- Turn the flattened test classpath into a javac argument -->
638 <    <property name="test.bootclasspath.arg"
639 <             value='-Xbootclasspath/p:${test.classpath}'/>
637 >    <!-- Flatten test classpaths into platform-appropriate strings -->
638 >    <property name="test.classpath"             refid="test.classpath"/>
639 >    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
640 >    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
641  
642    </target>
643  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines