ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaikiran Pai <jaiki...@apache.org>
Subject Re: [ant] branch 1.9.x updated: rmic has been removed in Java 15+
Date Tue, 05 May 2020 12:28:34 GMT
With this change, things are much better now with Java 15
https://builds.apache.org/job/Ant%20Master%20(latest%20EA%20JDK)/jdk_axis=jdk15-ea,label_exp=ubuntu/36/testReport/

That one remaining failure is due to Nashorn no longer being part of
Java 15.

-Jaikiran

On 05/05/20 3:24 pm, bodewig@apache.org wrote:
> This is an automated email from the ASF dual-hosted git repository.
>
> bodewig pushed a commit to branch 1.9.x
> in repository https://gitbox.apache.org/repos/asf/ant.git
>
>
> The following commit(s) were added to refs/heads/1.9.x by this push:
>      new 45fd589  rmic has been removed in Java 15+
> 45fd589 is described below
>
> commit 45fd589a1fb2eece010993b43eb220821ea0d22a
> Author: Stefan Bodewig <bodewig@apache.org>
> AuthorDate: Tue May 5 11:53:39 2020 +0200
>
>     rmic has been removed in Java 15+
> ---
>  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       | 10 +++-
>  6 files changed, 74 insertions(+), 29 deletions(-)
>
> diff --git a/WHATSNEW b/WHATSNEW
> index aac8219..55ef289 100644
> --- a/WHATSNEW
> +++ b/WHATSNEW
> @@ -7,6 +7,9 @@ Other changes:
>   * The runant.py script should now work with Python 3.
>     Github Pull Request #96
>  
> + * 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
>  =====================================
>  
> diff --git a/manual/Tasks/rmic.html b/manual/Tasks/rmic.html
> index c0d6daf..226b54b 100644
> --- a/manual/Tasks/rmic.html
> +++ b/manual/Tasks/rmic.html
> @@ -27,6 +27,11 @@
>  <h2><a name="rmic">Rmic</a></h2>
>  <h3>Description</h3>
>  <p>Runs the rmic compiler for a certain class.</p>
> +
> +<p><b>Note</b> <code>rmic</code> 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
> diff --git a/src/etc/testcases/taskdefs/rmic/rmic.xml b/src/etc/testcases/taskdefs/rmic/rmic.xml
> index 4670f43..fe9973e 100644
> --- a/src/etc/testcases/taskdefs/rmic/rmic.xml
> +++ b/src/etc/testcases/taskdefs/rmic/rmic.xml
> @@ -201,11 +201,16 @@
>    <target name="probe-rmic">
>      <available property="kaffe.present" classname="jkaffe.rmi.rmic.RMIC"/>
>      <condition property="rmic.present">
> -      <or>
> -        <available classname="sun.rmi.rmic.Main"/>
> -        <!-- we'll use forking as default for Java9 -->
> -        <available classname="java.lang.module.ModuleDescriptor"/>
> -      </or>
> +      <and>
> +        <or>
> +          <available classname="sun.rmi.rmic.Main"/>
> +          <!-- we'll use forking as default for Java9 -->
> +          <available classname="java.lang.module.ModuleDescriptor"/>
> +        </or>
> +        <not>
> +          <javaversion atleast="15"/>
> +        </not>
> +      </and>
>      </condition>
>      <condition property="rmic.compiler" value="forking">
>        <available classname="java.lang.module.ModuleDescriptor"/>
> @@ -218,56 +223,59 @@
>          <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>
>  
> -  <target name="testDefaultDest" depends="init">
> +  <target name="testDefaultDest" depends="init" unless="java15+">
>      <dest-rmic compiler="default"/>
>      <assertBaseCompiledInDest/>
>    </target>
>  
> -  <target name="testEmpty" depends="init">
> +  <target name="testEmpty" depends="init" unless="java15+">
>      <base-rmic compiler=""/>
>      <assertBaseCompiled/>
>    </target>
>  
> -  <target name="testEmptyDest" depends="init">
> +  <target name="testEmptyDest" depends="init" unless="java15+">
>      <dest-rmic compiler=""/>
>      <assertBaseCompiledInDest/>
>    </target>
>  
> -  <target name="testVersion11" depends="init">
> +  <target name="testVersion11" depends="init" unless="java15+">
>      <base-rmic compiler="default" stubversion="1.1" />
>      <assertBaseCompiled/>
>    </target>
>  
> -  <target name="testVersion11Dest" depends="init">
> +  <target name="testVersion11Dest" depends="init" unless="java15+">
>      <dest-rmic compiler="default" stubversion="1.1" />
>      <assertBaseCompiledInDest/>
>    </target>
>  
> -  <target name="testVersion12" depends="init">
> +  <target name="testVersion12" depends="init" unless="java15+">
>      <base-rmic compiler="default" stubversion="1.2" />
>      <assertStubCompiled/>
>      <assertSkelAbsent/>
>    </target>
>    
> -  <target name="testVersion12Dest" depends="init">
> +  <target name="testVersion12Dest" depends="init" unless="java15+">
>      <dest-rmic compiler="default" stubversion="1.2" />
>      <assertStubCompiledInDest/>
>      <assertSkelAbsentInDest/>
>    </target>
>    
> -  <target name="testVersionCompat" depends="init">
> +  <target name="testVersionCompat" depends="init" unless="java15+">
>      <base-rmic compiler="default" stubversion="compat" />
>      <assertBaseCompiled/>
>    </target>
>    
> -  <target name="testVersionCompatDest" depends="init">
> +  <target name="testVersionCompatDest" depends="init" unless="java15+">
>      <dest-rmic compiler="default" stubversion="compat" />
>      <assertBaseCompiledInDest/>
>    </target>
> @@ -385,35 +393,35 @@
>      </javac>
>    </target>
>  
> -  <target name="testAntClasspath" depends="compileAntTimestamp">
> +  <target name="testAntClasspath" depends="compileAntTimestamp" unless="java15+">
>      <base-rmic
>        compiler="default"
>        />
>      <assertAntCompiled/>
>    </target>
>  
> -  <target name="testAntClasspathDest" depends="compileAntTimestamp">
> +  <target name="testAntClasspathDest" depends="compileAntTimestamp" unless="java15+">
>      <dest-rmic
>        compiler="default"
>        />
>      <assertAntCompiledInDest/>
>    </target>
>  
> -  <target name="testForkingAntClasspath" depends="compileAntTimestamp">
> +  <target name="testForkingAntClasspath" depends="compileAntTimestamp" unless="java15+">
>      <base-rmic
>        compiler="forking"
>        />
>      <assertAntCompiled />
>    </target>
>  
> -  <target name="testForkingAntClasspathDest" depends="compileAntTimestamp">
> +  <target name="testForkingAntClasspathDest" depends="compileAntTimestamp" unless="java15+">
>      <dest-rmic
>        compiler="forking"
>        />
>      <assertAntCompiledInDest />
>    </target>
>  
> -  <target name="testDefaultBadClass" depends="init">
> +  <target name="testDefaultBadClass" depends="init" unless="java15+">
>      <rmic-bad-class compiler="default"/>
>    </target>
>  
> @@ -429,7 +437,7 @@
>        />
>    </target>
>  
> -  <target name="testMagicPropertyIsEmptyString" depends="init">
> +  <target name="testMagicPropertyIsEmptyString" depends="init" unless="java15+">
>      <property name="build.rmic" value=""/>
>      <base-rmic />
>      <assertBaseCompiled/>
> @@ -478,23 +486,23 @@
>      <assertBaseCompiledInDest/>
>    </target>
>  
> -  <target name="testIDL" depends="init">
> +  <target name="testIDL" depends="init" unless="java15+">
>      <base-rmic compiler="default" idl="true"/>
>      <assertFileCreated file="RemoteTimestamp.idl"/>
>    </target>
>  
> -  <target name="testIDLDest" depends="init">
> +  <target name="testIDLDest" depends="init" unless="java15+">
>      <dest-rmic compiler="default" idl="true"/>
>      <assertFileCreatedInDest file="RemoteTimestamp.idl"/>
>    </target>
>  
> -  <target name="testIIOP" depends="init">
> +  <target name="testIIOP" depends="init" unless="java15+">
>      <base-rmic compiler="default" iiop="true"/>
>      <assertFileCreated file="_RemoteTimestamp_Stub.class"/>
>      <assertFileCreated file="_RemoteTimestampImpl_Tie.class"/>
>    </target>
>  
> -  <target name="testIIOPDest" depends="init">
> +  <target name="testIIOPDest" depends="init" unless="java15+">
>      <dest-rmic compiler="default" iiop="true"/>
>      <assertFileCreatedInDest file="_RemoteTimestamp_Stub.class"/>
>      <assertFileCreatedInDest file="_RemoteTimestampImpl_Tie.class"/>
> diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java b/src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java
> index 9efc486..5afae42 100644
> --- a/src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java
> +++ b/src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java
> @@ -71,6 +71,11 @@ public class ForkingSunRmic extends DefaultRmicAdapter {
>          Project project = owner.getProject();
>          String executable = owner.getExecutable();
>          if (executable == null) {
> +            if (JavaEnvUtils.isAtLeastJavaVersion("15")) {
> +                throw new BuildException("rmic does not exist under Java 15 and higher,"
> +                    + " use rmic of an older JDK and explicitly set the executable attribute");
> +            }
> +
>              // no explicitly specified executable
>              // rely on RMIC being on the path
>              executable = JavaEnvUtils.getJdkExecutable(getExecutableName());
> diff --git a/src/tests/antunit/taskdefs/rmic-test.xml b/src/tests/antunit/taskdefs/rmic-test.xml
> index 67b4afc..3fdf5a5 100644
> --- a/src/tests/antunit/taskdefs/rmic-test.xml
> +++ b/src/tests/antunit/taskdefs/rmic-test.xml
> @@ -76,8 +76,13 @@ public class Adapter implements RmicAdapter {
>      <au:assertLogContains text="adapter called"/>
>    </target>
>  
> -  <target name="testSourceBase"
> -          description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48970">
> +  <target name="-check-jdk">
> +    <condition property="java15+">
> +      <javaversion atleast="15"/>
> +    </condition>
> +  </target>
> +
> +  <target name="-setup-real-test">
>      <mkdir dir="${input}/org/example"/>
>      <mkdir dir="${output}"/>
>      <echo file="${input}/org/example/Foo.java"><![CDATA[
> @@ -96,10 +101,23 @@ public class FooImpl implements Foo {
>      }
>  }]]></echo>
>      <javac srcdir="${input}" destdir="${output}"/>
> +  </target>
> +
> +  <target name="testSourceBase" depends="-check-jdk, -setup-real-test" unless="java15+"
> +          description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48970">
>      <rmic sourcebase="${input}" base="${output}">
>        <include name="**/*Impl.class"/>
>      </rmic>
>      <au:assertFileExists file="${input}/org/example/FooImpl_Stub.java"/>
>      <au:assertFileDoesntExist file="${output}/org/example/FooImpl_Stub.java"/>
>    </target>
> +
> +  <target name="testSimpleCompileFailsOnJava15+" depends="-check-jdk, -setup-real-test"
> +          if="java15+">
> +    <au:expectfailure>
> +      <rmic sourcebase="${input}" base="${output}">
> +        <include name="**/*Impl.class"/>
> +      </rmic>
> +    </au:expectfailure>
> +  </target>
>  </project>
> diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
> index 676eda4..4ca4fe2 100644
> --- a/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
> +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
> @@ -25,6 +25,7 @@ import org.apache.tools.ant.BuildException;
>  import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory;
>  import org.apache.tools.ant.taskdefs.rmic.DefaultRmicAdapter;
>  import org.apache.tools.ant.util.JavaEnvUtils;
> +import org.junit.Assume;
>  import org.junit.Before;
>  import org.junit.Ignore;
>  import org.junit.Rule;
> @@ -232,6 +233,7 @@ public class RmicAdvancedTest {
>       */
>      @Test
>      public void testDefaultBadClass() throws Exception {
> +        Assume.assumeFalse(JavaEnvUtils.isAtLeastJavaVersion("15"));
>          try {
>              buildRule.executeTarget("testDefaultBadClass");
>              fail("expected the class to fail");
> @@ -445,7 +447,9 @@ public class RmicAdvancedTest {
>      }
>  
>      private void xnewTest(String target) {
> -        if (!JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)) {
> +        if (!JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)
> +            || JavaEnvUtils.isAtLeastJavaVersion("15")) {
> +            // target is skipped with Java 15+
>              buildRule.executeTarget(target);
>          } else {
>              try {
> @@ -458,7 +462,9 @@ public class RmicAdvancedTest {
>      }
>  
>      private void corbaTest(String target) {
> -        if (!JavaEnvUtils.isAtLeastJavaVersion("11")) {
> +        if (!JavaEnvUtils.isAtLeastJavaVersion("11")
> +            || JavaEnvUtils.isAtLeastJavaVersion("15")) {
> +            // target is skipped with Java 15+
>              buildRule.executeTarget(target);
>          } else {
>              try {
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message