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.36 by tim, Thu May 29 17:29:08 2003 UTC vs.
Revision 1.54 by tim, Mon Sep 1 04:09:57 2003 UTC

# Line 35 | Line 35
35    <property name="build.lib.dir"        location="${build.dir}/lib"/>
36    <property name="build.ant.dir"        location="${build.dir}/ant"/>
37    <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"/>
40    <property name="build.reports.dir"    location="${build.dir}/reports"/>
41    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
42    <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 -->
46    <property name="src.dir"              location="${basedir}/src/main"/>
# Line 56 | Line 58
58    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
59    <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  
63  
64 <
65 <  <!-- Files excluded from emulation and dist-docs -->
63 <  <patternset id="emulation.excludes">
64 >  <!-- Files excluded from dist-docs and emulation jar -->
65 >  <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>
79 +
80  
81  
82    <!-- Main targets -->
# Line 77 | Line 89
89  
90      <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}"
98            destdir="${build.classes.dir}"
99              debug="${build.debug}"
# Line 85 | Line 102
102             source="${build.sourcelevel}"
103               fork="true">
104  
105 <      <bootclasspath refid="javac.bootclasspath"/>
106 <      <compilerarg line="${build.javac.args}"/>
105 >      <compilerarg    line="${gjc.args}"/>
106 > <!--
107 >      <bootclasspath refid="compile.bootclasspath"/>
108 > -->
109  
110      </javac>
111  
# Line 119 | Line 138
138  
139  
140    <target name="doccheck"
141 <          depends="filter-src"
142 <          description="Reports on javadoc style errors (not working yet)">
141 >          depends="filter-doccheck"
142 >          description="Reports on javadoc style errors">
143  
144      <delete dir="${build.doccheck.dir}"/>
145      <mkdir dir="${build.doccheck.dir}"/>
# Line 128 | Line 147
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.src.dir}"/>
150 >      <packageset dir="${build.filter.doccheck.dir}"/>
151      </javadoc>
152  
153 +    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
154 +
155    </target>
156  
157  
# Line 158 | Line 179
179    </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"
223            depends="init, configure-compiler"
224            description="Strip generics from java source (not working yet)">
# Line 177 | Line 238
238             source="${build.sourcelevel}"
239               fork="true">
240  
241 <      <bootclasspath refid="javac.bootclasspath"/>
242 <      <compilerarg line="${build.javac.args} -s"/>
241 >      <compilerarg    line="${gjc.args} -s"/>
242 > <!--
243 >      <bootclasspath refid="compile.bootclasspath"/>
244 > -->
245  
246      </javac>
247  
# Line 189 | Line 252
252            depends="init, dist-clean, dist-jar, dist-docs"
253            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"
276            description="Removes all build products">
# Line 236 | Line 318
318      <!-- Version is kept in a separate file -->
319      <loadfile property="version" srcFile="version.properties"/>
320      <echo>Building JSR-166 version ${version}</echo>
321 +    <echo>java.home is ${java.home}</echo>
322  
323    </target>
324  
# Line 272 | Line 355
355             source="${build.sourcelevel}"
356               fork="true">
357  
358 <      <bootclasspath refid="javac.bootclasspath"/>
359 <      <compilerarg line="${build.javac.args}"/>
358 >      <compilerarg    line="${gjc.args}"/>
359 > <!--
360 >      <bootclasspath refid="compile.bootclasspath"/>
361 > -->
362  
363      </javac>
364  
# Line 287 | Line 372
372  
373      <jar destfile="${product.jar}" duplicate="add">
374        <fileset dir="${build.classes.dir}">
375 <        <patternset refid="emulation.excludes"/>
375 >        <patternset refid="atomic.exclusion"/>
376 >        <patternset refid="unsafe.exclusion"/>
377        </fileset>
378        <fileset dir="${build.emulation.dir}"/>
379      </jar>
# Line 327 | Line 413
413        </fileset>
414      </copy>
415  
330    <!-- Not needed now, used for doccheck filtering:
331    <property name="generic.declarations"
332             value="public interface E {} public interface T {} public interface K {} public interface V {}"
333    />
334    -->
335
416      <copy todir="${build.filter.src.dir}">
417        <fileset dir="${src.dir}">
418          <exclude name="**/*.html"/>
419 <        <patternset refid="emulation.excludes"/>
419 >        <patternset refid="unsafe.exclusion"/>
420        </fileset>
421        <filterchain>
422  
# Line 372 | Line 452
452            <param name="pattern"     value="^//@"/>
453            <param name="replacement" value=""/>
454          </filterreader>
455 +      </filterchain>
456 +    </copy>
457 +
458 +  </target>
459 +
460 +
461 +
462 +
463 +  <target name="filter-doccheck"
464 +          depends="filter-src">
465  
466 +    <mkdir dir="${build.filter.doccheck.dir}"/>
467  
468 +    <copy todir="${build.filter.doccheck.dir}">
469 +      <fileset dir="${build.filter.src.dir}">
470 +        <include name="**/*.html"/>
471 +      </fileset>
472 +    </copy>
473 +
474 +    <property name="generic.declarations"
475 +             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 {}"
476 +    />
477 +
478 +    <copy todir="${build.filter.doccheck.dir}">
479 +      <fileset dir="${build.filter.src.dir}">
480 +        <exclude name="**/*.html"/>
481 +      </fileset>
482 +      <filterchain>
483          <!--
484 <         # The next two filters try to make the source look like
484 >         # These two filters try to make the source look like
485           # something that doccheck can process. The first removes
486           # -source 1.4 assertions and the second adds in a bunch
487           # of single letter public nested marker interfaces so that
488           # the generic type parameters are recognized.
383         #
384         # Currently commented out because doccheck doesn't work. :-(
489           -->
490  
387        <!--
491          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
492                        classpath="${build.ant.dir}">
493            <param name="matching"    value="^\s*assert[\s ].*$"/>
# Line 394 | Line 497
497  
498          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
499                        classpath="${build.ant.dir}">
500 <          <param name="matching"    value="^(.*(class|interface|implements) .*|)\{.*$"/>
500 >          <param name="matching"    value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
501            <param name="pattern"     value="$"/>
502            <param name="replacement" value=" ${generic.declarations}"/>
503          </filterreader>
401        -->
504  
505        </filterchain>
506      </copy>
# Line 411 | Line 513
513  
514      <mkdir dir="${build.testcases.dir}"/>
515  
516 + <!--
517 +    <echo>javac ${gjc.args}</echo>
518 +    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
519 +    <echo>classpath="${test.classpath}"</echo>
520 + -->
521 +
522      <javac srcdir="${test.src.dir}"
523            destdir="${build.testcases.dir}"
524              debug="${build.debug}"
# Line 419 | Line 527
527             source="${build.sourcelevel}"
528               fork="true">
529  
530 <      <classpath refid="test.classpath"/>
531 <      <bootclasspath refid="javac.bootclasspath"/>
532 <      <compilerarg line="${build.javac.args}"/>
530 >      <compilerarg    line="${gjc.args}"/>
531 > <!--      
532 >      <bootclasspath refid="test.compile.bootclasspath"/>
533 > -->      
534 >      <classpath     refid="test.classpath"/>
535 >      
536 >      <include name="java/**"/>
537 >      <include name="jsr166/**"/>
538  
539      </javac>
540  
# Line 443 | Line 556
556                      dir="${build.reports.dir}"
557                     fork="true">
558  
559 <      <jvmarg value="${test.bootclasspath.arg}"/>
559 >      <jvmarg value="-Xbootclasspath:${test.run.bootclasspath}"/>
560  
561        <formatter type="xml"/>
562  
563        <batchtest todir="${build.reports.dir}">
564          <fileset dir="${test.src.dir}">
565 <          <include name="**/${testcase}Test.java"/>
565 >          <include name="java/**/${testcase}Test.java"/>
566 >          <include name="jsr166/**/${testcase}Test.java"/>
567          </fileset>
568        </batchtest>
569  
# Line 461 | Line 575
575    <target name="report-tests"
576            depends="run-tests">
577  
578 <    <!-- Sets junit.report.format to frames if Xalan is present,
578 >    <!-- Sets junit.report.format to frames if redirection is present,
579           otherwise sets it to noframes. -->
580      <available property="junit.report.format"
581                    value="frames"
# Line 487 | Line 601
601    <target name="configure-compiler">
602  
603      <property name="gjc.version"
604 <             value="2.0"/>
604 >             value="2.2"/>
605  
606 <    <condition property="build.novariance" value="-novariance">
606 >    <condition property="novariance.arg" value="-novariance">
607        <and>
608          <equals arg1="${gjc.version}" arg2="2.0"/>
609          <or>
# Line 499 | Line 613
613        </and>
614      </condition>
615  
616 <    <property name="build.novariance"
616 >    <property name="novariance.arg"
617               value=""/>
618  
619      <property name="gjc.dir"
# Line 509 | Line 623
623            location="${gjc.dir}/${gjc.version}/javac.jar"/>
624  
625      <property name="collect.jar"
626 <          location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/>
626 >          location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
627  
628 + <!--
629 +    <property name="unchecked.option" value="-warnunchecked"/>
630 + -->
631  
632 <    <condition property="build.warnunchecked" value="-warnunchecked">
632 >    <property name="unchecked.option" value="-Xlint:unchecked"/>
633 >
634 >    <condition property="warnunchecked.arg" value="${unchecked.option}">
635        <istrue value="${gjc.warnunchecked}"/>
636      </condition>
637  
638 <    <property name="build.warnunchecked" value=""/>
639 <
638 >    <property name="warnunchecked.arg" value=""/>
639 >    
640      <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
641        <istrue value="${build.nothreads}"/>
642      </condition>
# Line 527 | Line 646
646       ! Bootclasspath munging for source compilation.
647       -->
648  
649 <    <path id="javac.bootclasspath.prefix">
650 <      <!-- <pathelement location="${src.dir}"/> -->
649 >    <path id="pre.bootclasspath">
650 > <!--
651        <pathelement location="${javac.jar}"/>
652 + -->
653      </path>
654  
655 <    <path id="javac.bootclasspath">
656 <      <!-- <pathelement location="${src.dir}"/> -->
655 >    <path id="compile.bootclasspath">
656 >      <pathelement location="${build.classes.dir}"/>
657 > <!--      
658        <pathelement location="${collect.jar}"/>
659 + -->
660        <pathelement location="${rt.jar}"/>
661      </path>
662  
663 <    <!-- Flatten bootclasspath prefix into a platform-appropriate string -->
664 <    <property name="javac.bootclasspath.prefix"
665 <             refid="javac.bootclasspath.prefix"/>
544 <
545 <    <!-- Turn the flattened bootclasspath prefix into a javac argument -->
546 <    <property name="build.bootclasspath.arg"
547 <             value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>
548 <
549 <    <!-- Flatten bootclasspath for trace message -->
550 <    <property name="javac.bootclasspath"
551 <             refid="javac.bootclasspath"/>
663 >    <!-- Flatten paths into platform-appropriate strings -->
664 >    <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
665 >    <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
666  
553    <!-- Common options in javac invocations -->
554    <property name="build.javac.args"
555             value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/>
667  
668 <    <echo>javac ${build.javac.args}</echo>
669 <    <echo>bootclasspath=${javac.bootclasspath}</echo>
668 >    <!-- Common options in javac invocations -->
669 > <!--
670 >    <property name="gjc.args"
671 >             value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
672 >    />
673 > -->
674 >    <property name="gjc.args" value="${warnunchecked.arg} ${novariance.arg}"/>
675  
676    </target>
677  
# Line 591 | Line 707
707    </target>
708  
709  
710 <  <target name="configure-tests">
710 >  <target name="configure-tests"
711 >       depends="configure-compiler">
712  
713      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
714      <available property="junit.available"
# Line 600 | Line 717
717      <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
718            unless="junit.available"/>
719  
720 +    <!-- Xalan -->
721 +    <available property="xalan.available"
722 +               classname="org.apache.xalan.Version"/>
723 +
724 +    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
725 +          unless="xalan.available"/>
726 +
727  
728      <!--
729       ! Bootclasspath munging for testing, so JUnit can test our local
# Line 608 | Line 732
732  
733      <path id="test.classpath">
734        <pathelement location="${product.jar}"/>
735 +      <pathelement location="${rt.jar}"/>
736        <pathelement location="${build.testcases.dir}"/>
737        <pathelement location="${junit.jar}"/>
738      </path>
739  
740 <    <!-- Flatten test classpath into a platform-appropriate string -->
741 <    <property name="test.classpath" refid="test.classpath"/>
740 >    <path id="test.compile.bootclasspath">
741 >      <pathelement location="${javac.jar}"/>
742 >      <pathelement location="${collect.jar}"/>
743 >      <pathelement location="${rt.jar}"/>
744 >    </path>
745 >
746 >    <path id="test.run.bootclasspath">
747 > <!--    
748 >      <pathelement location="${javac.jar}"/>
749 > -->      
750 >      <path refid="test.classpath"/>
751 >    </path>
752  
753 <    <!-- Turn the flattened test classpath into a javac argument -->
754 <    <property name="test.bootclasspath.arg"
755 <             value='-Xbootclasspath/p:${test.classpath}'/>
753 >    <!-- Flatten test classpaths into platform-appropriate strings -->
754 >    <property name="test.classpath"             refid="test.classpath"/>
755 >    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
756 >    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
757  
758    </target>
759  
# Line 625 | Line 761
761  
762    <!-- Anthill targets -->
763  
764 <  <target name="anthill-build"
764 >  <target name="anthill-build">
765 >    <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
766 >      <arg value="-Xmx256000000"/>
767 >      <!-- classpath of new JVM -->
768 >      <arg value="-classpath"/> <arg path="${java.class.path}"/>
769 >      <!-- location of Ant home directory -->
770 >      <arg value="-Dant.home=${ant.home}"/>
771 >      <!-- the Ant main class -->
772 >      <arg value="org.apache.tools.ant.Main"/>
773 >      <!-- The build file -->
774 >      <arg value="-buildfile"/>  <arg value="build.xml"/>
775 >      <!-- the target to build on the new Ant instance -->
776 >      <arg value="-DJAVA_HOME=${tiger.home}"/>
777 >      <arg value="do-anthill-build"/>
778 >    </exec>
779 >  </target>
780 >  
781 >  <target name="do-anthill-build"
782            depends="jar, test, docs, dist-docs"/>
783  
784    <target name="anthill-publish">
# Line 648 | Line 801
801    </target>
802  
803  
804 +  <target name="ng" depends="test">
805 +    <java classname="SuperfluousAbstract" fork="true">
806 +
807 +      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
808 +
809 +    </java>
810 +  </target>
811 +
812 +
813   </project>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines