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.32 by tim, Thu May 29 04:35:42 2003 UTC vs.
Revision 1.39 by tim, Sat May 31 17:24:03 2003 UTC

# Line 70 | Line 70
70    <!-- Main targets -->
71  
72    <target name="compile"
73 <          depends="init, configure-compiler"
73 >          depends="init, configure-compiler, prepare-src"
74            description="Compiles main sources to build folder">
75  
76 +    <property name="prepare.src.dir" value="${src.dir}"/>
77 +
78      <mkdir dir="${build.classes.dir}"/>
79  
80 <    <javac srcdir="${src.dir}"
80 > <!--
81 >    <echo>javac ${gjc.args}</echo>
82 >    <echo>bootclasspath=${compile.bootclasspath}</echo>
83 > -->
84 >
85 >    <javac srcdir="${prepare.src.dir}"
86            destdir="${build.classes.dir}"
87              debug="${build.debug}"
88         debuglevel="${build.debuglevel}"
# Line 83 | Line 90
90             source="${build.sourcelevel}"
91               fork="true">
92  
93 <      <bootclasspath refid="javac.bootclasspath"/>
94 <      <compilerarg line="${build.javac.args}"/>
93 >      <compilerarg    line="${gjc.args}"/>
94 >      <bootclasspath refid="compile.bootclasspath"/>
95  
96      </javac>
97  
# Line 175 | Line 182
182             source="${build.sourcelevel}"
183               fork="true">
184  
185 <      <bootclasspath refid="javac.bootclasspath"/>
186 <      <compilerarg line="${build.javac.args} -s"/>
185 >      <compilerarg    line="${gjc.args} -s"/>
186 >      <bootclasspath refid="compile.bootclasspath"/>
187  
188      </javac>
189  
# Line 270 | Line 277
277             source="${build.sourcelevel}"
278               fork="true">
279  
280 <      <bootclasspath refid="javac.bootclasspath"/>
281 <      <compilerarg line="${build.javac.args}"/>
280 >      <compilerarg    line="${gjc.args}"/>
281 >      <bootclasspath refid="compile.bootclasspath"/>
282  
283      </javac>
284  
# Line 325 | Line 332
332        </fileset>
333      </copy>
334  
335 +    <!-- Not needed now, used for doccheck filtering:
336 +    <property name="generic.declarations"
337 +             value="public interface E {} public interface T {} public interface K {} public interface V {}"
338 +    />
339 +    -->
340 +
341      <copy todir="${build.filter.src.dir}">
342        <fileset dir="${src.dir}">
343          <exclude name="**/*.html"/>
344          <patternset refid="emulation.excludes"/>
345        </fileset>
346        <filterchain>
347 +
348 +        <!--
349 +         # This filter gets rid of angle-bracketed type parameters
350 +         # so that javadoc can run on the result. The following
351 +         # heuristic seems to work:
352 +         #
353 +         # For all lines not starting with space(s)-asterisk-space(s),
354 +         #   replace <something> with a space, where there may be more
355 +         #   than one right angle bracket at the end, and "something"
356 +         #   must not contain parens or pipes. (This may need some
357 +         #   tweaking.)
358 +         -->
359 +
360          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
361                        classpath="${build.ant.dir}">
336          <!--
337           # These arguments are to get rid of angle-bracketed type
338           # parameters so that javadoc can run on the result. The
339           # following heuristic that seems to work:
340           #
341           # For all lines not starting with space(s)-asterisk-space(s),
342           #   replace <something> with a space, where there may be more
343           #   than one right angle bracket at the end, and "something"
344           #   must not contain parens or pipes. (This may need some
345           #   tweaking.)
346           -->
362            <param name="notmatching" value="^\s+\*\s.*$"/>
363 <          <param name="pattern" value="&lt;[^|>()]+?>+"/>
363 >          <param name="pattern"     value="&lt;[^|>()]+?>+"/>
364            <param name="replacement" value=" "/>
365          </filterreader>
366 +
367 +
368 +        <!--
369 +         # This filter uncomments lines beginning with "//@" so that
370 +         # javadoc can see imports that are needed to resolve links
371 +         # but that shouldn't be in the compiled code.
372 +         -->
373 +
374          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
375                        classpath="${build.ant.dir}">
376 <          <!--
377 <           # These arguments are to uncomment lines beginning with
355 <           # "//@" so that javadoc can see imports that are needed
356 <           # to resolve links but that shouldn't be in the compiled
357 <           # code.
358 <           -->
359 <          <param name="matching" value="^//@.*$"/>
360 <          <param name="pattern" value="^//@"/>
376 >          <param name="matching"    value="^//@.*$"/>
377 >          <param name="pattern"     value="^//@"/>
378            <param name="replacement" value=""/>
379          </filterreader>
380 +
381 +
382 +        <!--
383 +         # The next two filters try to make the source look like
384 +         # something that doccheck can process. The first removes
385 +         # -source 1.4 assertions and the second adds in a bunch
386 +         # of single letter public nested marker interfaces so that
387 +         # the generic type parameters are recognized.
388 +         #
389 +         # Currently commented out because doccheck doesn't work. :-(
390 +         -->
391 +
392 +        <!--
393 +        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
394 +                      classpath="${build.ant.dir}">
395 +          <param name="matching"    value="^\s*assert[\s ].*$"/>
396 +          <param name="pattern"     value="assert"/>
397 +          <param name="replacement" value="//assert"/>
398 +        </filterreader>
399 +
400 +        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
401 +                      classpath="${build.ant.dir}">
402 +          <param name="matching"    value="^(.*(class|interface|implements) .*|)\{.*$"/>
403 +          <param name="pattern"     value="$"/>
404 +          <param name="replacement" value=" ${generic.declarations}"/>
405 +        </filterreader>
406 +        -->
407 +
408        </filterchain>
409      </copy>
410  
# Line 371 | Line 416
416  
417      <mkdir dir="${build.testcases.dir}"/>
418  
419 + <!--
420 +    <echo>javac ${gjc.args}</echo>
421 +    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
422 +    <echo>classpath="${test.classpath}"</echo>
423 + -->
424 +
425      <javac srcdir="${test.src.dir}"
426            destdir="${build.testcases.dir}"
427              debug="${build.debug}"
# Line 379 | Line 430
430             source="${build.sourcelevel}"
431               fork="true">
432  
433 <      <classpath refid="test.classpath"/>
434 <      <bootclasspath refid="javac.bootclasspath"/>
435 <      <compilerarg line="${build.javac.args}"/>
433 >      <compilerarg    line="${gjc.args}"/>
434 >      <bootclasspath refid="test.compile.bootclasspath"/>
435 >      <classpath     refid="test.classpath"/>
436  
437      </javac>
438  
# Line 403 | Line 454
454                      dir="${build.reports.dir}"
455                     fork="true">
456  
457 <      <jvmarg value="${test.bootclasspath.arg}"/>
457 >      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
458  
459        <formatter type="xml"/>
460  
# Line 447 | Line 498
498    <target name="configure-compiler">
499  
500      <property name="gjc.version"
501 <             value="1.3"/>
501 >             value="2.0"/>
502  
503 <    <condition property="build.novariance" value="-novariance">
503 >    <condition property="novariance.arg" value="-novariance">
504        <and>
505          <equals arg1="${gjc.version}" arg2="2.0"/>
506          <or>
# Line 459 | Line 510
510        </and>
511      </condition>
512  
513 <    <property name="build.novariance"
513 >    <property name="novariance.arg"
514               value=""/>
515  
516      <property name="gjc.dir"
# Line 469 | Line 520
520            location="${gjc.dir}/${gjc.version}/javac.jar"/>
521  
522      <property name="collect.jar"
523 <          location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/>
523 >          location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
524  
525  
526 <    <condition property="build.warnunchecked" value="-warnunchecked">
526 >    <condition property="warnunchecked.arg" value="-warnunchecked">
527        <istrue value="${gjc.warnunchecked}"/>
528      </condition>
529  
530 <    <property name="build.warnunchecked" value=""/>
530 >    <property name="warnunchecked.arg" value=""/>
531 >
532 >    <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
533 >      <istrue value="${build.nothreads}"/>
534 >    </condition>
535  
536  
537      <!--
538       ! Bootclasspath munging for source compilation.
539       -->
540  
541 <    <path id="javac.bootclasspath.prefix">
487 <      <!-- <pathelement location="${src.dir}"/> -->
541 >    <path id="pre.bootclasspath">
542        <pathelement location="${javac.jar}"/>
543      </path>
544  
545 <    <path id="javac.bootclasspath">
546 <      <!-- <pathelement location="${src.dir}"/> -->
545 >    <path id="compile.bootclasspath">
546 >      <pathelement location="${build.classes.dir}"/>
547        <pathelement location="${collect.jar}"/>
548        <pathelement location="${rt.jar}"/>
549      </path>
550  
551 <    <!-- Flatten bootclasspath prefix into a platform-appropriate string -->
552 <    <property name="javac.bootclasspath.prefix"
553 <             refid="javac.bootclasspath.prefix"/>
554 <
501 <    <!-- Turn the flattened bootclasspath prefix into a javac argument -->
502 <    <property name="build.bootclasspath.arg"
503 <             value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>
504 <
505 <    <!-- Flatten bootclasspath for trace message -->
506 <    <property name="javac.bootclasspath"
507 <             refid="javac.bootclasspath"/>
551 >    <!-- Flatten paths into platform-appropriate strings -->
552 >    <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
553 >    <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
554 >
555  
556      <!-- Common options in javac invocations -->
557 <    <property name="build.javac.args"
558 <             value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/>
557 >    <property name="gjc.args"
558 >             value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
559 >    />
560 >
561 >  </target>
562 >
563 >
564 >  <target name="prepare-src"
565 >          depends="configure-compiler"
566 >          if="prepare.src.dir">
567  
568 <    <echo>javac ${build.javac.args}
569 < bootclasspath is ${javac.bootclasspath}</echo>
568 >    <mkdir dir="${prepare.src.dir}"/>
569 >    <copy todir="${prepare.src.dir}">
570 >      <fileset dir="${src.dir}">
571 >        <exclude name="java/lang/**"/>
572 >      </fileset>
573 >    </copy>
574  
575    </target>
576  
# Line 533 | Line 592 | bootclasspath is ${javac.bootclasspath}<
592    </target>
593  
594  
595 <  <target name="configure-tests">
595 >  <target name="configure-tests"
596 >       depends="configure-compiler">
597  
598      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
599      <available property="junit.available"
# Line 554 | Line 614 | bootclasspath is ${javac.bootclasspath}<
614        <pathelement location="${junit.jar}"/>
615      </path>
616  
617 <    <!-- Flatten test classpath into a platform-appropriate string -->
618 <    <property name="test.classpath" refid="test.classpath"/>
617 >    <path id="test.compile.bootclasspath">
618 >      <pathelement location="${javac.jar}"/>
619 >      <pathelement location="${collect.jar}"/>
620 >      <pathelement location="${rt.jar}"/>
621 >    </path>
622 >
623 >    <path id="test.run.bootclasspath">
624 >      <pathelement location="${javac.jar}"/>
625 >      <path refid="test.classpath"/>
626 >    </path>
627  
628 <    <!-- Turn the flattened test classpath into a javac argument -->
629 <    <property name="test.bootclasspath.arg"
630 <             value='-Xbootclasspath/p:${test.classpath}'/>
628 >    <!-- Flatten test classpaths into platform-appropriate strings -->
629 >    <property name="test.classpath"             refid="test.classpath"/>
630 >    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
631 >    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
632  
633    </target>
634  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines