From 8431ffa9d932014925ba008b9a48f599b2f6ecf9 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Wed, 23 Aug 2006 12:36:46 +0000 Subject: [PATCH] bug ID#38732 , rmic task doesn't work with -Xnew and JDK 6.0 Fixed by writing a new adapter, xnew, that extends the forking adapter and sets the -Xnew argument. Tests supplied, though the old test, the one that would fail on java1.6, is still there. Also made the name matching code of rmic locale-independent. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@434030 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/taskdefs/rmic/XNewRmic.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/main/org/apache/tools/ant/taskdefs/rmic/XNewRmic.java diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/XNewRmic.java b/src/main/org/apache/tools/ant/taskdefs/rmic/XNewRmic.java new file mode 100644 index 000000000..a050cdd41 --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/rmic/XNewRmic.java @@ -0,0 +1,33 @@ +package org.apache.tools.ant.taskdefs.rmic; + +import org.apache.tools.ant.types.Commandline; + +/** + * Run rmic in a new process with -Xnew set. + * This switches rmic to use a new compiler, one that doesnt work in-process + * on ant on java1.6 + * @see: http://issues.apache.org/bugzilla/show_bug.cgi?id=38732 + */ +public class XNewRmic extends ForkingSunRmic { + + /** + * the name of this adapter for users to select + */ + public static final String COMPILER_NAME = "xnew"; + + public XNewRmic() { + } + + /** + * Create a normal command line, then with -Xnew at the front + * @return a command line that hands off to thw + */ + protected Commandline setupRmicCommand() { + String options[]=new String[] { + "-Xnew" + }; + Commandline commandline = super.setupRmicCommand(options); + return commandline; + } + +}