[cvs] / jsr166 / build.xml Repository:
ViewVC logotype

Diff of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.35, Thu May 29 15:53:58 2003 UTC revision 1.53, Tue Aug 26 19:59:14 2003 UTC
# Line 35  Line 35 
35    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
36    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <property name="build.ant.dir"        location="${build.dir}/ant"/>
37    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
38      <property name="build.sinjdocs.dir"   location="${build.dir}/sinjdocs"/>
39    <property name="build.stripped.dir"   location="${build.dir}/stripped"/>    <property name="build.stripped.dir"   location="${build.dir}/stripped"/>
40    <property name="build.reports.dir"    location="${build.dir}/reports"/>    <property name="build.reports.dir"    location="${build.dir}/reports"/>
41    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
42    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
43      <property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/>
44    
45    <!-- Source locations -->    <!-- Source locations -->
46    <property name="src.dir"              location="${basedir}/src/main"/>    <property name="src.dir"              location="${basedir}/src/main"/>
# Line 56  Line 58 
58    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
59    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
60    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
61      <property name="sinjdoc.jar"          location="${lib.dir}/sinjdoc.jar"/>
62    
63    
64      <!-- Files excluded from dist-docs and emulation jar -->
65    <!-- Files excluded from emulation and dist-docs -->    <patternset id="unsafe.exclusion">
   <patternset id="emulation.excludes">  
66      <exclude name="java/util/Random.*"/>      <exclude name="java/util/Random.*"/>
67      <exclude name="sun/misc/Unsafe.*"/>      <exclude name="sun/misc/Unsafe.*"/>
68    </patternset>    </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>
79    
80    
81    
82    <!-- Main targets -->    <!-- Main targets -->
# Line 77  Line 89 
89    
90      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
91    
92    <!--
93        <echo>javac ${gjc.args}</echo>
94        <echo>bootclasspath=${compile.bootclasspath}</echo>
95    -->
96    
97      <javac srcdir="${prepare.src.dir}"      <javac srcdir="${prepare.src.dir}"
98            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
99              debug="${build.debug}"              debug="${build.debug}"
# Line 85  Line 102 
102             source="${build.sourcelevel}"             source="${build.sourcelevel}"
103               fork="true">               fork="true">
104    
105        <bootclasspath refid="javac.bootclasspath"/>  <!--
106        <compilerarg line="${build.javac.args}"/>        <compilerarg    line="${gjc.args}"/>
107          <bootclasspath refid="compile.bootclasspath"/>
108    -->
109    
110      </javac>      </javac>
111    
# Line 119  Line 138 
138    
139    
140    <target name="doccheck"    <target name="doccheck"
141            depends="filter-src"            depends="filter-doccheck"
142            description="Reports on javadoc style errors (not working yet)">            description="Reports on javadoc style errors">
143    
144      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
145      <mkdir dir="${build.doccheck.dir}"/>      <mkdir dir="${build.doccheck.dir}"/>
# Line 128  Line 147 
147      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
148           docletpath="${lib.dir}/doccheck.jar"           docletpath="${lib.dir}/doccheck.jar"
149              destdir="${build.doccheck.dir}">              destdir="${build.doccheck.dir}">
150        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.doccheck.dir}"/>
151      </javadoc>      </javadoc>
152    
153        <echo>DocCheck output is in ${build.doccheck.dir}</echo>
154    
155    </target>    </target>
156    
157    
# Line 158  Line 179 
179    </target>    </target>
180    
181    
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"    <target name="strip"
223            depends="init, configure-compiler"            depends="init, configure-compiler"
224            description="Strip generics from java source (not working yet)">            description="Strip generics from java source (not working yet)">
# Line 177  Line 238 
238             source="${build.sourcelevel}"             source="${build.sourcelevel}"
239               fork="true">               fork="true">
240    
241        <bootclasspath refid="javac.bootclasspath"/>      <!--
242        <compilerarg line="${build.javac.args} -s"/>        <compilerarg    line="${gjc.args} -s"/>
243          <bootclasspath refid="compile.bootclasspath"/>
244         -->
245    
246      </javac>      </javac>
247    
# Line 189  Line 252 
252            depends="init, dist-clean, dist-jar, dist-docs"            depends="init, dist-clean, dist-jar, dist-docs"
253            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
254    
255      <target name="release"
256              depends="dist"
257              description="Puts entire CVS tree, plus distribution productions, in a jar">
258    
259    <!--
260        #keep build dir? - dl
261        <delete dir="${build.dir}"/>
262    -->
263        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
264    
265        <jar basedir="${basedir}" destfile="${release.jar}">
266          <exclude name="${release.jar}"/>
267          <exclude name="user.properties"/>
268          <exclude name="etc/notes/**"/>
269          <exclude name="lib/gjc/2.1/**"/>
270          <exclude name="**/SyntaxTest.java"/>
271        </jar>
272    
273      </target>
274    
275    <target name="clean"    <target name="clean"
276            description="Removes all build products">            description="Removes all build products">
# Line 272  Line 354 
354             source="${build.sourcelevel}"             source="${build.sourcelevel}"
355               fork="true">               fork="true">
356    
357        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
358        <compilerarg line="${build.javac.args}"/>        <bootclasspath refid="compile.bootclasspath"/>
359    
360      </javac>      </javac>
361    
# Line 287  Line 369 
369    
370      <jar destfile="${product.jar}" duplicate="add">      <jar destfile="${product.jar}" duplicate="add">
371        <fileset dir="${build.classes.dir}">        <fileset dir="${build.classes.dir}">
372          <patternset refid="emulation.excludes"/>          <patternset refid="atomic.exclusion"/>
373            <patternset refid="unsafe.exclusion"/>
374        </fileset>        </fileset>
375        <fileset dir="${build.emulation.dir}"/>        <fileset dir="${build.emulation.dir}"/>
376      </jar>      </jar>
# Line 330  Line 413 
413      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
414        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
415          <exclude name="**/*.html"/>          <exclude name="**/*.html"/>
416          <patternset refid="emulation.excludes"/>          <patternset refid="unsafe.exclusion"/>
417        </fileset>        </fileset>
418        <filterchain>        <filterchain>
419          <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
                       classpath="${build.ant.dir}">  
420            <!--            <!--
421             # These arguments are to get rid of angle-bracketed type           # This filter gets rid of angle-bracketed type parameters
422             # parameters so that javadoc can run on the result. The           # so that javadoc can run on the result. The following
423             # following heuristic that seems to work:           # heuristic seems to work:
424             #             #
425             # For all lines not starting with space(s)-asterisk-space(s),             # For all lines not starting with space(s)-asterisk-space(s),
426             #   replace <something> with a space, where there may be more             #   replace <something> with a space, where there may be more
# Line 346  Line 428 
428             #   must not contain parens or pipes. (This may need some             #   must not contain parens or pipes. (This may need some
429             #   tweaking.)             #   tweaking.)
430             -->             -->
431    
432            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
433                          classpath="${build.ant.dir}">
434            <param name="notmatching" value="^\s+\*\s.*$"/>            <param name="notmatching" value="^\s+\*\s.*$"/>
435            <param name="pattern" value="&lt;[^|>()]+?>+"/>            <param name="pattern" value="&lt;[^|>()]+?>+"/>
436            <param name="replacement" value=" "/>            <param name="replacement" value=" "/>
437          </filterreader>          </filterreader>
438          <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
439                        classpath="${build.ant.dir}">  
440            <!--            <!--
441             # These arguments are to uncomment lines beginning with           # This filter uncomments lines beginning with "//@" so that
442             # "//@" so that javadoc can see imports that are needed           # javadoc can see imports that are needed to resolve links
443             # to resolve links but that shouldn't be in the compiled           # but that shouldn't be in the compiled code.
            # code.  
444             -->             -->
445    
446            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
447                          classpath="${build.ant.dir}">
448            <param name="matching" value="^//@.*$"/>            <param name="matching" value="^//@.*$"/>
449            <param name="pattern" value="^//@"/>            <param name="pattern" value="^//@"/>
450            <param name="replacement" value=""/>            <param name="replacement" value=""/>
# Line 368  Line 455 
455    </target>    </target>
456    
457    
458    
459    
460      <target name="filter-doccheck"
461              depends="filter-src">
462    
463        <mkdir dir="${build.filter.doccheck.dir}"/>
464    
465        <copy todir="${build.filter.doccheck.dir}">
466          <fileset dir="${build.filter.src.dir}">
467            <include name="**/*.html"/>
468          </fileset>
469        </copy>
470    
471        <property name="generic.declarations"
472                 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        />
474    
475        <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>
501    
502          </filterchain>
503        </copy>
504    
505      </target>
506    
507    
508    <target name="compile-tests"    <target name="compile-tests"
509            depends="jar">            depends="jar">
510    
511      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
512    
513    <!--
514        <echo>javac ${gjc.args}</echo>
515        <echo>bootclasspath=${test.compile.bootclasspath}</echo>
516        <echo>classpath="${test.classpath}"</echo>
517    -->
518    
519      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
520            destdir="${build.testcases.dir}"            destdir="${build.testcases.dir}"
521              debug="${build.debug}"              debug="${build.debug}"
# Line 381  Line 524 
524             source="${build.sourcelevel}"             source="${build.sourcelevel}"
525               fork="true">               fork="true">
526    
527    <!--
528          <compilerarg    line="${gjc.args}"/>
529    -->
530          <bootclasspath refid="test.compile.bootclasspath"/>
531        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
       <bootclasspath refid="javac.bootclasspath"/>  
       <compilerarg line="${build.javac.args}"/>  
532    
533      </javac>      </javac>
534    
# Line 405  Line 550 
550                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
551                     fork="true">                     fork="true">
552    
553        <jvmarg value="${test.bootclasspath.arg}"/>        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
554    
555        <formatter type="xml"/>        <formatter type="xml"/>
556    
# Line 447  Line 592 
592    
593    
594    <target name="configure-compiler">    <target name="configure-compiler">
595    <!--
596      <property name="gjc.version"      <property name="gjc.version"
597               value="2.0"/>               value="2.2"/>
598    
599      <condition property="build.novariance" value="-novariance">      <condition property="novariance.arg" value="-novariance">
600        <and>        <and>
601          <equals arg1="${gjc.version}" arg2="2.0"/>          <equals arg1="${gjc.version}" arg2="2.0"/>
602          <or>          <or>
# Line 461  Line 606 
606        </and>        </and>
607      </condition>      </condition>
608    
609      <property name="build.novariance"      <property name="novariance.arg"
610               value=""/>               value=""/>
611    
612      <property name="gjc.dir"      <property name="gjc.dir"
# Line 471  Line 616 
616            location="${gjc.dir}/${gjc.version}/javac.jar"/>            location="${gjc.dir}/${gjc.version}/javac.jar"/>
617    
618      <property name="collect.jar"      <property name="collect.jar"
619            location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/>            location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
   
620    
621      <condition property="build.warnunchecked" value="-warnunchecked">  -->
622        <condition property="warnunchecked.arg" value="-warnunchecked">
623        <istrue value="${gjc.warnunchecked}"/>        <istrue value="${gjc.warnunchecked}"/>
624      </condition>      </condition>
625    
626      <property name="build.warnunchecked" value=""/>      <property name="warnunchecked.arg" value=""/>
627    
628      <condition property="prepare.src.dir" value="${build.dir}/prepare-src">      <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
629        <istrue value="${build.nothreads}"/>        <istrue value="${build.nothreads}"/>
# Line 489  Line 634 
634       ! Bootclasspath munging for source compilation.       ! Bootclasspath munging for source compilation.
635       -->       -->
636    
637      <path id="javac.bootclasspath.prefix">      <path id="pre.bootclasspath">
       <!-- <pathelement location="${src.dir}"/> -->  
638        <pathelement location="${javac.jar}"/>        <pathelement location="${javac.jar}"/>
639      </path>      </path>
640    
641      <path id="javac.bootclasspath">      <path id="compile.bootclasspath">
642        <!-- <pathelement location="${src.dir}"/> -->        <pathelement location="${build.classes.dir}"/>
643        <pathelement location="${collect.jar}"/>        <pathelement location="${collect.jar}"/>
644        <pathelement location="${rt.jar}"/>        <pathelement location="${rt.jar}"/>
645      </path>      </path>
646    
647      <!-- Flatten bootclasspath prefix into a platform-appropriate string -->      <!-- Flatten paths into platform-appropriate strings -->
648      <property name="javac.bootclasspath.prefix"      <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
649               refid="javac.bootclasspath.prefix"/>      <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
   
     <!-- Turn the flattened bootclasspath prefix into a javac argument -->  
     <property name="build.bootclasspath.arg"  
              value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>  
   
     <!-- Flatten bootclasspath for trace message -->  
     <property name="javac.bootclasspath"  
              refid="javac.bootclasspath"/>  
650    
     <!-- Common options in javac invocations -->  
     <property name="build.javac.args"  
              value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/>  
651    
652      <echo>javac ${build.javac.args}</echo>      <!-- Common options in javac invocations -->
653      <echo>bootclasspath=${javac.bootclasspath}</echo>  <!--
654        <property name="gjc.args"
655                 value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
656        />
657    -->
658    
659    </target>    </target>
660    
# Line 553  Line 690 
690    </target>    </target>
691    
692    
693    <target name="configure-tests">    <target name="configure-tests"
694           depends="configure-compiler">
695    
696      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
697      <available property="junit.available"      <available property="junit.available"
# Line 574  Line 712 
712        <pathelement location="${junit.jar}"/>        <pathelement location="${junit.jar}"/>
713      </path>      </path>
714    
715      <!-- Flatten test classpath into a platform-appropriate string -->      <path id="test.compile.bootclasspath">
716      <property name="test.classpath" refid="test.classpath"/>        <pathelement location="${javac.jar}"/>
717          <pathelement location="${collect.jar}"/>
718          <pathelement location="${rt.jar}"/>
719        </path>
720    
721      <!-- Turn the flattened test classpath into a javac argument -->      <path id="test.run.bootclasspath">
722      <property name="test.bootclasspath.arg"        <pathelement location="${javac.jar}"/>
723               value='-Xbootclasspath/p:${test.classpath}'/>        <path refid="test.classpath"/>
724        </path>
725    
726        <!-- Flatten test classpaths into platform-appropriate strings -->
727        <property name="test.classpath"             refid="test.classpath"/>
728        <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
729        <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
730    
731    </target>    </target>
732    
# Line 610  Line 757 
757    </target>    </target>
758    
759    
760      <target name="ng" depends="test">
761        <java classname="SuperfluousAbstract" fork="true">
762    
763          <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
764    
765        </java>
766      </target>
767    
768    
769  </project>  </project>

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.53

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8