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.131 by jsr166, Fri Feb 1 18:31:17 2013 UTC vs.
Revision 1.143 by dl, Wed Jul 10 17:09:45 2013 UTC

# Line 44 | Line 44 | As of 2013-02, the very latest lambda 8
44    <property name="build.deprecation"    value="false"/>
45    <property name="build.javadoc.access" value="protected"/>
46  
47 +  <!-- Tck options; see JSR166TestCase.java -->
48 +  <!-- ant -Djsr166.profileTests=true -Djsr166.runsPerTest=100 test-tck -->
49 +  <property name="jsr166.profileTests"     value="false"/>
50 +  <property name="jsr166.profileThreshold" value="100"/>
51 +  <property name="jsr166.runsPerTest"      value="1"/>
52 +  <!-- Allow running an individual tck test class -->
53 +  <!-- ant -Djsr166.tckTestClass=CountedCompleterTest -Djsr166.runsPerTest=100 test-tck -->
54 +  <property name="jsr166.tckTestClass"     value="JSR166TestCase"/>
55 +
56    <!-- Build locations -->
57    <property name="build.dir"                   location="build"/>
58    <property name="build.classes.dir"           location="${build.dir}/classes"/>
# Line 170 | Line 179 | As of 2013-02, the very latest lambda 8
179  
180    <macrodef name="run-tck-tests">
181      <attribute name="tck.src.dir" default="${tck.src.dir}"/>
173    <attribute name="source" default="6"/>
182      <attribute name="target"/>
183 +    <attribute name="compile-target" default="@{target}"/>
184      <attribute name="workdir"/>
185      <attribute name="classes"/>
186      <attribute name="jvmflags" default=""/>
187 +    <element name="javac-elements" optional="true"/>
188      <sequential>
189  
190      <mkdir dir="@{workdir}/tck-classes"/>
# Line 184 | Line 194 | As of 2013-02, the very latest lambda 8
194             debug="${build.debug}"
195             debuglevel="${build.debuglevel}"
196             deprecation="${build.deprecation}"
197 <           source="@{source}"
197 >           source="@{compile-target}"
198 >           target="@{compile-target}"
199             classpath="${junit.jar}"
200 <           bootclasspath="@{classes}:${bootclasspath@{source}}"
200 >           bootclasspath="@{classes}:${bootclasspath@{compile-target}}"
201             includeAntRuntime="false"
202             includeJavaRuntime="false"
203 <           executable="${javac@{target}}"
203 >           executable="${javac@{compile-target}}"
204             fork="true">
205  
206        <include name="*.java"/>
207        <compilerarg value="-XDignore.symbol.file=true"/>
208        <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
209        <compilerarg line="${build.args}"/>
210 +      <javac-elements/>
211  
212      </javac>
213  
214 <    <java classname="JSR166TestCase"
214 >    <java classname="${jsr166.tckTestClass}"
215            failonerror="true"
216            jvm="${java@{target}}"
217            fork="true">
218          <jvmarg value="-Xbootclasspath/p:@{classes}"/>
219          <jvmarg line="@{jvmflags}"/>
220 +        <sysproperty key="jsr166.profileTests"     value="${jsr166.profileTests}"/>
221 +        <sysproperty key="jsr166.profileThreshold" value="${jsr166.profileThreshold}"/>
222 +        <sysproperty key="jsr166.runsPerTest"      value="${jsr166.runsPerTest}"/>
223          <classpath>
224            <pathelement location="${junit.jar}"/>
225            <pathelement location="@{workdir}/tck-classes"/>
# Line 214 | Line 229 | As of 2013-02, the very latest lambda 8
229      </sequential>
230    </macrodef>
231  
232 +  <macrodef name="run-jtreg-tests">
233 +    <attribute name="jtreg.src.dir" default="${jtreg.src.dir}"/>
234 +    <attribute name="source" default="7"/>
235 +    <attribute name="target"/>
236 +    <attribute name="workdir"/>
237 +    <attribute name="classes"/>
238 +    <attribute name="jtregflags" default=""/>
239 +    <sequential>
240 +    <delete dir="@{workdir}/JTwork"   quiet="true"/>
241 +    <delete dir="@{workdir}/JTreport" quiet="true"/>
242 +    <mkdir dir="@{workdir}/JTwork/scratch"/>
243 +    <mkdir dir="@{workdir}/JTreport"/>
244 +    <jtreg dir="@{jtreg.src.dir}"
245 +           jdk="${jdk@{target}.home}"
246 +           workDir="@{workdir}/JTwork"
247 +           reportDir="@{workdir}/JTreport">
248 +
249 +      <arg value="-Xbootclasspath/p:@{classes}"/>
250 +      <arg value="-agentvm"/>
251 +      <arg value="-v:nopass,fail"/>
252 +      <arg value="-vmoptions:-esa -ea"/>
253 +      <arg value="-automatic"/>
254 +      <arg value="-k:!ignore"/>
255 +      <arg line="@{jtregflags}"/>
256 +    </jtreg>
257 +    </sequential>
258 +  </macrodef>
259 +
260    <!-- ALoops classpath -->
261    <path id="loops.classpath">
262      <pathelement location="${build.loops.dir}"/>
# Line 247 | Line 290 | As of 2013-02, the very latest lambda 8
290             fork="true">
291  
292        <include name="**/*.java"/>
293 +      <compilerarg value="-Xprefer:source"/>
294        <compilerarg value="-XDignore.symbol.file=true"/>
295        <compilerarg value="-Xlint:all"/>
296        <compilerarg line="${build.args}"/>
# Line 265 | Line 309 | As of 2013-02, the very latest lambda 8
309    </target>
310  
311  
268  <target name="test"
269          depends="configure-tests, report-tests"
270          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
271
272
312    <target name="docs"
313            description="Builds javadocs for src/main to dist dir">
314  
# Line 293 | Line 332 | As of 2013-02, the very latest lambda 8
332        <arg value="-XDignore.symbol.file=true"/>
333        <arg value="-tag"/>
334        <arg value="${javadoc.jls.option}"/>
335 +      <arg value="-tag"/>
336 +      <arg value="apiNote:a:&lt;em&gt;API Note:&lt;/em&gt;"/>
337 +      <arg value="-tag"/>
338 +      <arg value="implSpec:a:&lt;em&gt;Implementation Requirements:&lt;/em&gt;"/>
339 +      <arg value="-tag"/>
340 +      <arg value="implNote:a:&lt;em&gt;Implementation Note:&lt;/em&gt;"/>
341      </javadoc>
342    </target>
343  
# Line 336 | Line 381 | As of 2013-02, the very latest lambda 8
381    </target>
382  
383  
339  <!-- Internal targets -->
340
341
384    <target name="dist-jar"
385            depends="clean, jar">
386      <copy file="${product.jar}" todir="${dist.dir}"/>
# Line 350 | Line 392 | As of 2013-02, the very latest lambda 8
392    </target>
393  
394  
353  <target name="compile-tests"
354          depends="jar">
355
356    <mkdir dir="${build.testcases.dir}"/>
357
358    <javac srcdir="${tck.src.dir}"
359           destdir="${build.testcases.dir}"
360           debug="${build.debug}"
361           debuglevel="${build.debuglevel}"
362           deprecation="${build.deprecation}"
363           source="6"
364           classpath="${junit.jar}"
365           bootclasspath="@{product.jar}:${bootclasspath6}"
366           includeAntRuntime="false"
367           includeJavaRuntime="false"
368           executable="${javac8}"
369           fork="true">
370
371      <include name="**/*.java"/>
372      <compilerarg value="-XDignore.symbol.file=true"/>
373      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
374      <compilerarg line="${build.args}"/>
375
376    </javac>
377
378    <javac srcdir="${test.src.dir}"
379           destdir="${build.testcases.dir}"
380           debug="${build.debug}"
381           debuglevel="${build.debuglevel}"
382           deprecation="${build.deprecation}"
383           source="6"
384           classpath=""
385           bootclasspath="@{product.jar}:${bootclasspath6}"
386           includeAntRuntime="false"
387           includeJavaRuntime="false"
388           executable="${javac8}"
389           fork="true">
390
391      <include name="jsr166/test/**/*.java"/>
392      <compilerarg value="-XDignore.symbol.file=true"/>
393      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
394      <compilerarg line="${build.args}"/>
395
396    </javac>
397
398 <!--
399    <javac srcdir="${jtreg.src.dir}"
400          destdir="${build.testcases.dir}"
401            debug="${build.debug}"
402       debuglevel="${build.debuglevel}"
403      deprecation="${build.deprecation}"
404           source="${build.sourcelevel}"
405             fork="true">
406
407      <compilerarg value="-Xbootclasspath/p:${product.jar}"/>
408      <compilerarg value="-XDignore.symbol.file=true"/>
409      <compilerarg line="${build.args}"/>
410
411    </javac>
412 -->
413
414  </target>
415
395    <target name="test-tck"
396            depends="jar"
397            description="Runs tck tests for main directly">
# Line 423 | Line 402 | As of 2013-02, the very latest lambda 8
402        classes="${product.jar}"/>
403    </target>
404  
405 <  <target name="run-tests"
406 <          depends="compile-tests">
407 <
408 <    <!-- May be overridden by user.properties -->
409 <    <property name="testcase" value="*"/>
410 <
411 <    <mkdir dir="${build.reports.dir}"/>
433 <
434 <    <junit printsummary="true"
435 <             showoutput="true"
436 <          errorProperty="junit.failed"
437 <        failureProperty="junit.failed"
438 <                    dir="${build.reports.dir}"
439 <                    jvm="${java8}"
440 <                   fork="true">
441 <
442 <      <jvmarg value="-Xbootclasspath/p:${product.jar}"/>
443 <      <jvmarg value="-server"/>
444 <      <jvmarg value="-showversion"/>
445 <
446 <      <classpath refid="test.classpath"/>
447 <
448 <      <formatter type="xml"/>
449 <
450 <      <batchtest todir="${build.reports.dir}" unless="no.test.tck">
451 <        <fileset dir="${tck.src.dir}">
452 <          <include name="**/${testcase}Test.java"/>
453 <        </fileset>
454 <      </batchtest>
455 <
456 <      <batchtest todir="${build.reports.dir}" if="do.test.old">
457 <        <fileset dir="${test.src.dir}">
458 <          <include name="jsr166/test/**/${testcase}Test.java"/>
459 <        </fileset>
460 <      </batchtest>
461 <
462 < <!--
463 <      <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
464 <        <fileset dir="${jtreg.src.dir}">
465 <          <include name="**/${testcase}Test.java"/>
466 <        </fileset>
467 <      </batchtest>
468 < -->
469 <
470 <    </junit>
471 <
405 >  <target name="test-jtreg"
406 >          depends="jar"
407 >          description="Runs jtreg tests for main using the jtreg ant task">
408 >    <run-jtreg-tests
409 >       target="8"
410 >       workdir="${build.dir}"
411 >       classes="${product.jar}"/>
412    </target>
413  
414 <
415 <  <target name="report-tests"
416 <          depends="run-tests">
477 <
478 <    <!-- Sets junit.report.format to frames if redirection is present,
479 <         otherwise sets it to noframes. -->
480 <    <available property="junit.report.format"
481 <                  value="frames"
482 <              classname="org.apache.xalan.lib.Redirect"
483 <    />
484 <    <property name="junit.report.format" value="noframes"/>
485 <
486 <    <junitreport todir="${build.reports.dir}">
487 <      <fileset dir="${build.reports.dir}">
488 <        <include name="TEST-*.xml"/>
489 <      </fileset>
490 <      <report format="${junit.report.format}" todir="${build.reports.dir}"
491 <      />
492 <    </junitreport>
493 <
494 <    <fail message="Test Cases Failed" if="junit.failed"/>
495 <
414 >  <target name="test"
415 >          depends="test-tck, test-jtreg"
416 >          description="Runs tck and jtreg tests for main">
417    </target>
418  
419  
420 +
421    <target name="configure-compiler">
422  
423      <property name="unchecked.option" value="-Xlint:unchecked"/>
# Line 513 | Line 435 | As of 2013-02, the very latest lambda 8
435    </target>
436  
437  
516  <target name="configure-tests"
517       depends="configure-compiler">
518
519    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
520    <available property="junit.available"
521               classname="junit.framework.Protectable"/>
522
523    <!-- Xalan -->
524    <available property="xalan.available"
525               classname="org.apache.xalan.Version"/>
526
527
528    <!-- Ant 1.6beta and later don't need or want this check -->
529    <!--
530    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
531          unless="junit.available"/>
532
533    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
534          unless="xalan.available"/>
535    -->
536
537  </target>
538
438  
439    <!-- Various demos and test programs -->
440  
# Line 588 | Line 487 | As of 2013-02, the very latest lambda 8
487             fork="true">
488  
489        <include name="**/*.java"/>
490 +      <compilerarg value="-Xprefer:source"/>
491        <compilerarg value="-XDignore.symbol.file=true"/>
492        <compilerarg value="-Xlint:all"/>
493        <compilerarg line="${build.args}"/>
# Line 614 | Line 514 | As of 2013-02, the very latest lambda 8
514      <run-tck-tests
515        target="7"
516        workdir="${build.4jdk7.dir}"
517 <      classes="${4jdk7product.jar}"/>
517 >      classes="${4jdk7product.jar}">
518 >      <javac-elements>
519 >        <!-- JDK8+ test classes -->
520 >        <exclude name="*8Test.java"/>
521 >        <exclude name="DoubleAccumulatorTest.java"/>
522 >        <exclude name="DoubleAdderTest.java"/>
523 >        <exclude name="LongAccumulatorTest.java"/>
524 >        <exclude name="LongAdderTest.java"/>
525 >        <exclude name="CompletableFutureTest.java"/>
526 >        <exclude name="StampedLockTest.java"/>
527 >      </javac-elements>
528 >    </run-tck-tests>
529    </target>
530  
531  
# Line 640 | Line 551 | As of 2013-02, the very latest lambda 8
551  
552        <formatter type="brief"/>
553  
554 <      <test name="JSR166TestCase" haltonfailure="no">
554 >      <test name="${jsr166.tckTestClass}" haltonfailure="no">
555        </test>
556  
557      </junit>
558    </target>
559  
560    <target name="4jdk7-test-jtreg"
561 <          depends="4jdk7compile"
561 >          depends="4jdk7jar"
562            description="Runs jtreg tests for jsr166-4jdk7 using the jtreg ant task">
563 <    <delete dir="${build.4jdk7.dir}/JTwork"   quiet="true"/>
564 <    <delete dir="${build.4jdk7.dir}/JTreport" quiet="true"/>
565 <    <mkdir dir="${build.4jdk7.dir}/JTwork/scratch"/>
566 <    <mkdir dir="${build.4jdk7.dir}/JTreport"/>
567 <    <jtreg dir="${jtreg.src.dir}"
657 <           jdk="${jdk7.home}"
658 <           workDir="${build.4jdk7.dir}/JTwork"
659 <           reportDir="${build.4jdk7.dir}/JTreport">
660 <
661 <      <arg value="-Xbootclasspath/p:${4jdk7product.jar}"/>
662 <      <arg value="-agentvm"/>
663 <      <arg value="-v:nopass,fail"/>
664 <      <arg value="-vmoptions:-esa -ea"/>
665 <      <arg value="-automatic"/>
666 <      <arg value="-k:!ignore"/>
667 <    </jtreg>
563 >    <run-jtreg-tests
564 >       target="7"
565 >       workdir="${build.4jdk7.dir}"
566 >       classes="${4jdk7product.jar}"
567 >       jtregflags="-exclude:${jtreg.src.dir}/jdk8tests"/>
568    </target>
569  
570  
# Line 1062 | Line 962 | As of 2013-02, the very latest lambda 8
962  
963      <run-tck-tests
964        tck.src.dir="${test.src.dir}/tck-jsr166e"
965 <      source="7"
1066 <      target="8"
965 >      target="7"
966        workdir="${build.jsr166e.dir}"
967        classes="${jsr166e.jar}"/>
968    </target>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines