This is an automated email from the ASF dual-hosted git repository. bodewig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ant.git
commit bc9fed1198acf599173334f5e90a855ea5077fc7 Merge: d591851 45fd589 Author: Stefan Bodewig <[email protected]> AuthorDate: Tue May 5 12:11:07 2020 +0200 Merge branch '1.9.x' WHATSNEW | 3 ++ manual/Tasks/rmic.html | 5 ++ src/etc/testcases/taskdefs/rmic/rmic.xml | 58 ++++++++++++---------- .../tools/ant/taskdefs/rmic/ForkingSunRmic.java | 5 ++ src/tests/antunit/taskdefs/rmic-test.xml | 22 +++++++- .../tools/ant/taskdefs/RmicAdvancedTest.java | 18 +++++++ 6 files changed, 84 insertions(+), 27 deletions(-) diff --cc WHATSNEW index 65c0ce8,55ef289..125def9 --- a/WHATSNEW +++ b/WHATSNEW @@@ -50,56 -7,10 +50,59 @@@ Other changes * The runant.py script should now work with Python 3. Github Pull Request #96 + * tstamp task now honors SOURCE_DATE_EPOCH environment variable for + reproducible builds (https://reproducible-builds.org/specs/source-date-epoch/#idm55) + Bugzilla Report 62617 + + * rmic has been removed from Java 15. The task will now throw an + exception if you try to use it while running Java 15 or newer. + -Changes from Ant 1.9.13 TO Ant 1.9.14 +Changes from Ant 1.10.6 TO Ant 1.10.7 +===================================== + +Fixed bugs: +----------- + + * FTP still tries checking or entering directories after a timeout + Bugzilla Report 63454 + + * junitlauncher - does not detect failure in @BeforeAll + Bugzilla Report 63479 + + * Error using ant-1.10.6 with jdk8 + Bugzilla Report 63457 + + * FTP task no longer duplicates a check for a file being a symlink. + Bugzilla Report 63259 + + * junitlauncher task, when used in fork mode with "<testclasses>", + used to create the wrong number of listeners per test class. This + has now been fixed. + Bugzilla Report 63446 + + * The "legacy-xml" junitlauncher task's listener would not include + @ParameterizedTest testcases in its XML report file. This has now + been fixed. + Bugzilla Report 63680 + +Other changes: +-------------- + + * FTP task timeout improvements. + Bugzilla Reports 63252 and 47414 + + * junitlauncher task now supports selecting test classes for execution, + based on the JUnit 5 tags, through the new "includeTags" and + "excludeTags" attributes. + + * prefer https over http when building ant itself, and in the ant + documentation and sources + + * changed the references and Maven coordinates of JavaMail dependency + to Jakarta Mail and thus javax.mail to jakarta.mail - and upgraded + the dependency to 1.6.3. + +Changes from Ant 1.10.5 TO Ant 1.10.6 ===================================== Changes that could break older environments: diff --cc manual/Tasks/rmic.html index 49a9788,226b54b..c328c58 --- a/manual/Tasks/rmic.html +++ b/manual/Tasks/rmic.html @@@ -24,51 -24,60 +24,56 @@@ <body> -<h2><a name="rmic">Rmic</a></h2> +<h2 id="rmic">Rmic</h2> <h3>Description</h3> -<p>Runs the rmic compiler for a certain class.</p> +<p>Runs the <kbd>rmic</kbd> compiler for a certain class.</p> + -<p><b>Note</b> <code>rmic</code> has been deprecated as of Java 13 and ++<p><b>Note</b> <kbd>rmic</kbd> has been deprecated as of Java 13 and + removed as of Java 15. Trying to use it with Java15 will fail unless + you specifiy the execxutable or rmic-adapter explicitly.</p> + -<p>Rmic can be run on a single class (as specified with the classname -attribute) or a number of classes at once (all classes below base that -are neither _Stub nor _Skel classes). If you want to rmic a single -class and this class is a class nested into another class, you have to -specify the classname in the form <code>Outer$$Inner</code> instead of -<code>Outer.Inner</code>.</p> -<p>It is possible to refine the set of files that are being rmiced. This can be -done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i> -attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to -have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the <i>defaultexcludes</i> attribute, you can specify whether you -want to use default exclusions or not. See the section on <a -href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the +<p><code>Rmic</code> can be run on a single class (as specified with the classname attribute) or a +number of classes at once (all classes below base that are neither <code>_Stub</code> +nor <code>_Skel</code> classes). If you want to <code>rmic</code> a single class and this class is +a class nested into another class, you have to specify the classname in the +form <code>Outer$$Inner</code> instead of <code>Outer.Inner</code>.</p> +<p>It is possible to refine the set of files that are being <code>rmic</code>ed. This can be done +with the <var>includes</var>, <var>includesfile</var>, <var>excludes</var>, <var>excludesfile</var> +and <var>defaultexcludes</var> attributes. With the <var>includes</var> or <var>includesfile</var> +attribute you specify the files you want to have included by using patterns. The <var>exclude</var> +or <var>excludesfile</var> attribute is used to specify the files you want to have excluded. This is +also done with patterns. And finally with the <var>defaultexcludes</var> attribute, you can specify +whether you want to use default exclusions or not. See the section +on <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the inclusion/exclusion of files works, and how to write patterns.</p> -<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and -supports most attributes of <code><fileset></code> -(<code>dir</code> becomes <code>base</code>) as well as the nested -<code><include></code>, <code><exclude></code> and -<code><patternset></code> elements.</p> -<p>It is possible to use different compilers. This can be selected -with the "build.rmic" property, the <code>compiler</code> -attribute. or a nested element. -<a name="compilervalues">Here are the choices</a>:</p> +<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most +attributes of <code><fileset></code> (<var>dir</var> becomes <var>base</var>) as well as the +nested <code><include></code>, <code><exclude></code> +and <code><patternset></code> elements.</p> +<p id="compilervalues">It is possible to use different compilers. This can be selected with +the <code>build.rmic</code> property, the <var>compiler</var> attribute, or a nested element. Here +are the choices:</p> <ul> - <li>default -the default compiler (kaffe, sun or forking) for the platform. - <li>sun (the standard compiler of the JDK < JDK 9)</li> - <li>kaffe (the standard compiler of <a href="http://www.kaffe.org" target="_top">Kaffe</a>)</li> - <li>weblogic</li> - <li>forking - the sun compiler forked into a separate process (since - Apache Ant 1.7). Starting with Ant 1.9.8 this is the default when - running on JDK 9+.</li> - <li>xnew - the sun compiler forked into a separate process, - with the -Xnew option (since Ant 1.7). - This is the most reliable way to use -Xnew. - <br></br>JDK9 has removed support for -Xnew and starting with Ant - 1.9.8 this option will be rejected by ant when running on JDK9.</li> - <li> "" (empty string). This has the same behaviour as not setting the compiler attribute. - First the value of <tt>build.rmic</tt> is used if defined, and if not, the default - for the platform is chosen. If build.rmic is set to this, you get the default. - + <li><q>default</q>—the default compiler (<q>kaffe</q>, <q>sun</q> or <q>forking</q>) for the + platform. + <li><q>sun</q>—the standard compiler prior to JDK 9</li> + <li><q>kaffe</q>—the standard compiler of <a href="https://github.com/kaffe/kaffe" + target="_top">Kaffe</a></li> + <li><q>weblogic</q></li> + <li><q>forking</q>—(<em>since Apache Ant 1.7</em>) the <q>sun</q> compiler forked into a + separate process. <em>Since Ant 1.9.8</em>, this is the default when running on JDK 9+.</li> + <li><q>xnew</q>—(<em>since Ant 1.7</em>) the <q>sun</q> compiler forked into a separate + process, with the <kbd>-Xnew</kbd> option. This is the most reliable way to + use <kbd>-Xnew</kbd>.<br/>JDK 9 has removed support for <kbd>-Xnew</kbd> and <em>since Ant + 1.9.8</em> this option will be rejected when running on JDK 9+.</li> + <li><q></q> (empty string). This has the same behaviour as not setting the compiler attribute. + First the value of <code>build.rmic</code> is used if defined, and if not, the default for the + platform is chosen. If <code>build.rmic</code> is set to this, you get the default.</li> </ul> -<p>The <a href="http://dione.zcu.cz/~toman40/miniRMI/">miniRMI</a> -project contains a compiler implementation for this task as well, -please consult miniRMI's documentation to learn how to use it.</p> +<p>The <a href="https://web.archive.org/web/20131225023602/http://dione.zcu.cz/~toman40/miniRMI/" +target="_top">miniRMI</a> project contains a compiler implementation for this task as well, please +consult miniRMI's documentation to learn how to use it.</p> <h4>CORBA support</h4> diff --cc src/etc/testcases/taskdefs/rmic/rmic.xml index 78de800,fe9973e..04b3f4d --- a/src/etc/testcases/taskdefs/rmic/rmic.xml +++ b/src/etc/testcases/taskdefs/rmic/rmic.xml @@@ -212,9 -217,18 +217,12 @@@ </condition> <property name="rmic.compiler" value="sun"/> <available property="wlrmic.present" classname="weblogic.rmic"/> - <condition property="rmic6.present"> - <and> - <isset property="rmic.present"/> - <available classname="java.util.ServiceLoader"/> - </and> - </condition> + <condition property="java15+"> + <javaversion atleast="15"/> + </condition> </target> - <target name="testDefault" depends="init"> + <target name="testDefault" depends="init" unless="java15+"> <base-rmic compiler="default" listfiles="true"/> <assertBaseCompiled/> </target> diff --cc src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java index ca23c82,4ca4fe2..3b78b81 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java @@@ -228,15 -232,16 +228,17 @@@ public class RmicAdvancedTest * A unit test for JUnit */ @Test - public void testDefaultBadClass() throws Exception { - Assume.assumeFalse(JavaEnvUtils.isAtLeastJavaVersion("15")); + public void testDefaultBadClass() { ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage(Rmic.ERROR_RMIC_FAILED); try { buildRule.executeTarget("testDefaultBadClass"); - fail("expected the class to fail"); - } catch(BuildException ex) { - AntAssert.assertContains(Rmic.ERROR_RMIC_FAILED, ex.getMessage()); + } finally { + // don't look for much text here as it is vendor and version dependent + assertThat(buildRule.getLog(), containsString("unimplemented.class")); } - //dont look for much text here as it is vendor and version dependent - AntAssert.assertContains("unimplemented.class", buildRule.getLog()); } /** @@@ -331,15 -356,14 +333,17 @@@ } /** - * test that passes -Xnew to sun's rmic. - * - * @throws Exception + * test that passes -Xnew to sun's rmic running in a different VM. */ @Test - public void testXnewDest() throws Exception { - // skipped via unless attribute for JDK > 6 - buildRule.executeTarget("testXnewDest"); + public void testXnewForkedJava9plus() { + assumeTrue("Current system is Java 8 or older", + JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("JDK9 has removed support for -Xnew"); + buildRule.executeTarget("testXnewForked"); } /** @@@ -354,36 -378,12 +358,40 @@@ /** * test that passes -Xnew to sun's rmic running in a different VM. - * - * @throws Exception if something goes wrong */ @Test - public void testXnewForkedDest() throws Exception { - xnewTest("testXnewForkedDest"); + public void testXnewForkedDestJava9plus() { + assumeTrue("Current system is Java 8 or older", + JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("JDK9 has removed support for -Xnew"); + buildRule.executeTarget("testXnewForkedDest"); + } + + /** + * test that runs the new xnew compiler adapter. + */ + @Test + public void testXnewCompiler() { + assumeFalse("Current system is Java 9 or newer", + JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)); + buildRule.executeTarget("testXnewCompiler"); + } + + /** + * test that runs the new xnew compiler adapter. + */ + @Test + public void testXnewCompilerJava9plus() { + assumeTrue("Current system is Java 8 or older", + JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("JDK9 has removed support for -Xnew"); + buildRule.executeTarget("testXnewCompiler"); } /** @@@ -398,34 -398,22 +406,38 @@@ /** * test that runs the new xnew compiler adapter. - * - * @throws Exception if something goes wrong */ @Test - public void testXnewCompilerDest() throws Exception { - xnewTest("testXnewCompilerDest"); + public void testXnewCompilerDestJava9plus() { + assumeTrue("Current system is Java 8 or older", + JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("JDK9 has removed support for -Xnew"); + buildRule.executeTarget("testXnewCompilerDest"); + } + + /** + * test that verifies that IDL compiles. + */ + @Test + public void testIDL() { + assumeFalse("Current system is Java 11 or newer", JavaEnvUtils.isAtLeastJavaVersion("11")); + buildRule.executeTarget("testIDL"); } /** * test that verifies that IDL compiles. - * - * @throws Exception if something goes wrong */ @Test - public void testIDL() throws Exception { - corbaTest("testIDL"); + public void testIDLJava11plus() { + assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11")); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("this rmic implementation doesn't support the -idl switch"); + buildRule.executeTarget("testIDL"); } /** @@@ -438,54 -427,57 +450,60 @@@ } /** + * test that verifies that IDL compiles. + */ + @Test + public void testIDLDestJava11plus() { + assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11")); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("this rmic implementation doesn't support the -idl switch"); + buildRule.executeTarget("testIDL"); + } + + /** * test that verifies that IIOP compiles. - * - * @throws Exception if something goes wrong */ @Test - public void testIIOP() throws Exception { - corbaTest("testIIOP"); + public void testIIOP() { + assumeFalse("Current system is Java 11 or newer", JavaEnvUtils.isAtLeastJavaVersion("11")); + buildRule.executeTarget("testIIOP"); } /** * test that verifies that IIOP compiles. - * - * @throws Exception if something goes wrong - */ - @Test - public void testIIOPDest() throws Exception { - corbaTest("testIIOPDest"); - } - - private void xnewTest(String target) { - if (!JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9) - || JavaEnvUtils.isAtLeastJavaVersion("15")) { - // target is skipped with Java 15+ - buildRule.executeTarget(target); - } else { - try { - buildRule.executeTarget(target); - fail("Target should have thrown a BuildException"); - } catch (BuildException ex) { - assertEquals("JDK9 has removed support for -Xnew", ex.getMessage()); - } - } + */ + @Test + public void testIIOPJava11plus() { + assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11")); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("this rmic implementation doesn't support the -iiop switch"); + buildRule.executeTarget("testIIOP"); } - private void corbaTest(String target) { - if (!JavaEnvUtils.isAtLeastJavaVersion("11") - || JavaEnvUtils.isAtLeastJavaVersion("15")) { - // target is skipped with Java 15+ - buildRule.executeTarget(target); - } else { - try { - buildRule.executeTarget(target); - fail("Target should have thrown a BuildException"); - } catch (BuildException ex) { - if (target.contains("IDL")) { - assertEquals("this rmic implementation doesn't support the -idl switch", ex.getMessage()); - } else { - assertEquals("this rmic implementation doesn't support the -iiop switch", ex.getMessage()); - } - } - } + /** + * test that verifies that IIOP compiles. + */ + @Test + public void testIIOPDest() { + assumeFalse("Current system is Java 11 or newer", JavaEnvUtils.isAtLeastJavaVersion("11")); + buildRule.executeTarget("testIIOPDest"); + } + + /** + * test that verifies that IIOP compiles. + */ + @Test + public void testIIOPDestJava11plus() { + assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11")); ++ assumeFalse("Current system is Java 15 or newer", ++ JavaEnvUtils.isAtLeastJavaVersion("15")); + thrown.expect(BuildException.class); + thrown.expectMessage("this rmic implementation doesn't support the -iiop switch"); + buildRule.executeTarget("testIIOP"); } /**
