From notifications-return-30307-archive-asf-public=cust-asf.ponee.io@ant.apache.org Mon Mar 5 12:50:33 2018
Return-Path:
X-Original-To: archive-asf-public@cust-asf.ponee.io
Delivered-To: archive-asf-public@cust-asf.ponee.io
Received: from mail.apache.org (hermes.apache.org [140.211.11.3])
by mx-eu-01.ponee.io (Postfix) with SMTP id D42A2180608
for ; Mon, 5 Mar 2018 12:50:32 +0100 (CET)
Received: (qmail 7308 invoked by uid 500); 5 Mar 2018 11:50:31 -0000
Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: dev@ant.apache.org
Delivered-To: mailing list notifications@ant.apache.org
Received: (qmail 7299 invoked by uid 99); 5 Mar 2018 11:50:31 -0000
Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23)
by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2018 11:50:31 +0000
Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33)
id CC0C9F17E2; Mon, 5 Mar 2018 11:50:31 +0000 (UTC)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: bodewig@apache.org
To: notifications@ant.apache.org
Date: Mon, 05 Mar 2018 11:50:31 -0000
Message-Id: <3681a6b82ac344a19459c2c860f54924@git.apache.org>
X-Mailer: ASF-Git Admin Mailer
Subject: [1/2] ant git commit: Java11 removes support for rmic -idl/-iiop
Repository: ant
Updated Branches:
refs/heads/master 8425ca927 -> 1ab832724
Java11 removes support for rmic -idl/-iiop
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/5aa1e8ef
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/5aa1e8ef
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/5aa1e8ef
Branch: refs/heads/master
Commit: 5aa1e8eff81ad6005e62587cdaaa962fce1105ea
Parents: e50fdd7
Author: Stefan Bodewig
Authored: Mon Mar 5 12:45:56 2018 +0100
Committer: Stefan Bodewig
Committed: Mon Mar 5 12:45:56 2018 +0100
----------------------------------------------------------------------
WHATSNEW | 7 ++++++
manual/Tasks/rmic.html | 16 +++++++++++--
.../ant/taskdefs/rmic/DefaultRmicAdapter.java | 18 ++++++++++++++
.../tools/ant/taskdefs/rmic/ForkingSunRmic.java | 15 ++++++++++++
.../tools/ant/taskdefs/rmic/KaffeRmic.java | 10 ++++++++
.../apache/tools/ant/taskdefs/rmic/WLRmic.java | 10 ++++++++
.../tools/ant/taskdefs/RmicAdvancedTest.java | 25 ++++++++++++++++----
7 files changed, 95 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/5aa1e8ef/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 8c2af62..6dd00fe 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -17,6 +17,13 @@ Fixed bugs:
Bugzilla Report 62076
+Other changes:
+--------------
+
+ * when running on Java 11+ rmic will fail early if iiop or idl are
+ requested. Java11 removes support for CORBA and the switches have
+ been removed from the rmic tool.
+
Changes from Ant 1.9.9 TO Ant 1.9.10
====================================
http://git-wip-us.apache.org/repos/asf/ant/blob/5aa1e8ef/manual/Tasks/rmic.html
----------------------------------------------------------------------
diff --git a/manual/Tasks/rmic.html b/manual/Tasks/rmic.html
index fa927bf..c0d6daf 100644
--- a/manual/Tasks/rmic.html
+++ b/manual/Tasks/rmic.html
@@ -74,6 +74,14 @@ attribute. or a nested element.
project contains a compiler implementation for this task as well,
please consult miniRMI's documentation to learn how to use it.
+CORBA support
+
+Java 11 removes the CORBA and JavaEE packages and rmic no longer
+ supports either iiop
nor idl
. Starting
+ with Ant 1.9.11 the rmic task will fail when using either while
+ running Java11+ unless you fork the task and explicitly specify an
+ executable.
+
Parameters
@@ -168,7 +176,10 @@ please consult miniRMI's documentation to learn how to use it.
iiop |
- indicates that portable (RMI/IIOP) stubs should be generated |
+ indicates that portable (RMI/IIOP) stubs should
+ be generated.
+ See the note on CORBA support above.
+ |
No |
@@ -178,7 +189,8 @@ please consult miniRMI's documentation to learn how to use it.
idl |
- indicates that IDL output files should be generated |
+ indicates that IDL output files should be
+ generated. See the note on CORBA support above. |
No |
http://git-wip-us.apache.org/repos/asf/ant/blob/5aa1e8ef/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java b/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
index d4483d9..37a14cb 100644
--- a/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
@@ -177,6 +177,18 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
}
/**
+ * Whether the iiop and idl switches are supported.
+ *
+ * This implementation returns false if running on Java 11
+ * onwards and true otherwise.
+ * @return true if the iiop and idl switches are supported
+ * @since Ant 1.9.11
+ */
+ protected boolean areIiopAndIdlSupported() {
+ return !JavaEnvUtils.isAtLeastJavaVersion("11");
+ }
+
+ /**
* Setup rmic argument for rmic.
* @return the command line
*/
@@ -223,6 +235,9 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
}
if (attributes.getIiop()) {
+ if (!areIiopAndIdlSupported()) {
+ throw new BuildException("this rmic implementation doesn't support the -iiop switch");
+ }
attributes.log("IIOP has been turned on.", Project.MSG_INFO);
cmd.createArgument().setValue("-iiop");
if (attributes.getIiopopts() != null) {
@@ -233,6 +248,9 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
}
if (attributes.getIdl()) {
+ if (!areIiopAndIdlSupported()) {
+ throw new BuildException("this rmic implementation doesn't support the -idl switch");
+ }
cmd.createArgument().setValue("-idl");
attributes.log("IDL has been turned on.", Project.MSG_INFO);
if (attributes.getIdlopts() != null) {
http://git-wip-us.apache.org/repos/asf/ant/blob/5aa1e8ef/src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java
----------------------------------------------------------------------
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 81bd797..9efc486 100644
--- a/src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java
+++ b/src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java
@@ -46,6 +46,21 @@ public class ForkingSunRmic extends DefaultRmicAdapter {
public static final String COMPILER_NAME = "forking";
/**
+ * @since Ant 1.9.11
+ */
+ @Override
+ protected boolean areIiopAndIdlSupported() {
+ boolean supported = !JavaEnvUtils.isAtLeastJavaVersion("11");
+ if (!supported && getRmic().getExecutable() != null) {
+ getRmic().getProject()
+ .log("Allowing -iiop and -idl for forked rmic even though this version of Java doesn't support it.",
+ Project.MSG_INFO);
+ return true;
+ }
+ return supported;
+ }
+
+ /**
* exec by creating a new command
* @return true if the command ran successfully
* @throws BuildException on error
http://git-wip-us.apache.org/repos/asf/ant/blob/5aa1e8ef/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java b/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
index ff72ad4..f5f0bff 100644
--- a/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
+++ b/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
@@ -43,6 +43,16 @@ public class KaffeRmic extends DefaultRmicAdapter {
*/
public static final String COMPILER_NAME = "kaffe";
+ /**
+ * @since Ant 1.9.11
+ */
+ @Override
+ protected boolean areIiopAndIdlSupported() {
+ // actually I don't think Kaffee supports either, but we've
+ // accepted the flags prior to 1.9.11
+ return true;
+ }
+
/** {@inheritDoc} */
public boolean execute() throws BuildException {
getRmic().log("Using Kaffe rmic", Project.MSG_VERBOSE);
http://git-wip-us.apache.org/repos/asf/ant/blob/5aa1e8ef/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java b/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
index 3b1f2a1..a4236d2 100644
--- a/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
+++ b/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
@@ -53,6 +53,16 @@ public class WLRmic extends DefaultRmicAdapter {
public static final String UNSUPPORTED_STUB_OPTION = "Unsupported stub option: ";
/**
+ * @since Ant 1.9.11
+ */
+ @Override
+ protected boolean areIiopAndIdlSupported() {
+ // actually I don't think Weblogic's rmic supports either, but
+ // we've accepted the flags prior to 1.9.11
+ return true;
+ }
+
+ /**
* Carry out the rmic compilation.
* @return true if the compilation succeeded
* @throws BuildException on error
http://git-wip-us.apache.org/repos/asf/ant/blob/5aa1e8ef/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
----------------------------------------------------------------------
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 138712d..4991143 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
@@ -411,7 +411,7 @@ public class RmicAdvancedTest {
*/
@Test
public void testIDL() throws Exception {
- buildRule.executeTarget("testIDL");
+ corbaTest("testIDL");
}
/**
@@ -421,7 +421,7 @@ public class RmicAdvancedTest {
*/
@Test
public void testIDLDest() throws Exception {
- buildRule.executeTarget("testIDLDest");
+ corbaTest("testIDLDest");
}
/**
@@ -431,7 +431,7 @@ public class RmicAdvancedTest {
*/
@Test
public void testIIOP() throws Exception {
- buildRule.executeTarget("testIIOP");
+ corbaTest("testIIOP");
}
/**
@@ -441,7 +441,7 @@ public class RmicAdvancedTest {
*/
@Test
public void testIIOPDest() throws Exception {
- buildRule.executeTarget("testIIOPDest");
+ corbaTest("testIIOPDest");
}
private void xnewTest(String target) {
@@ -457,6 +457,23 @@ public class RmicAdvancedTest {
}
}
+ private void corbaTest(String target) {
+ if (!JavaEnvUtils.isAtLeastJavaVersion("11")) {
+ buildRule.executeTarget(target);
+ } else {
+ try {
+ buildRule.executeTarget(target);
+ fail("Target should have thrown a BuildException");
+ } catch (BuildException ex) {
+ if (target.indexOf("IDL") > -1) {
+ 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());
+ }
+ }
+ }
+ }
+
/**
* this little bunny verifies that we can load stuff, and that
* a failure to execute is turned into a fault