Browse Source

Add an executable attribute to rmic. PR 42132

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@793605 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
4de20278c2
4 changed files with 42 additions and 2 deletions
  1. +4
    -0
      WHATSNEW
  2. +10
    -0
      docs/manual/CoreTasks/rmic.html
  3. +21
    -0
      src/main/org/apache/tools/ant/taskdefs/Rmic.java
  4. +7
    -2
      src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java

+ 4
- 0
WHATSNEW View File

@@ -765,6 +765,10 @@ Other changes:
executable.
Bugzilla Report 46230.

* <rmic>'s new executable attribute can be used to specify a
different executable.
Bugzilla Report 42132.

Changes from Ant 1.7.0 TO Ant 1.7.1
=============================================



+ 10
- 0
docs/manual/CoreTasks/rmic.html View File

@@ -208,6 +208,16 @@ please consult miniRMI's documentation to learn how to use it.</p>
compilers.)</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">executable</td>
<td valign="top">Complete path to the <code>rmic</code>
executable to use in case of the <code>forking</code>
or <code>xnew</code> compiler.
Defaults to the rmic compiler of the Java version that is currently
running Ant.<br/>
<em>Since Ant 1.8.0</em>.</td>
<td align="center" valign="top">No</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>classpath and extdirs</h4>


+ 21
- 0
src/main/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -123,6 +123,8 @@ public class Rmic extends MatchingTask {

private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();

private String executable = null;

/**
* Constructor for Rmic.
*/
@@ -488,6 +490,25 @@ public class Rmic extends MatchingTask {
return facade.getArgs();
}

/**
* Name of the executable to use when forking.
*
* @since Ant 1.8.0
*/
public void setExecutable(String ex) {
executable = ex;
}

/**
* Explicitly specified name of the executable to use when forking
* - if any.
*
* @since Ant 1.8.0
*/
public String getExecutable() {
return executable;
}

/**
* execute by creating an instance of an implementation
* class and getting to do the work


+ 7
- 2
src/main/org/apache/tools/ant/taskdefs/rmic/ForkingSunRmic.java View File

@@ -54,8 +54,13 @@ public class ForkingSunRmic extends DefaultRmicAdapter {
Rmic owner = getRmic();
Commandline cmd = setupRmicCommand();
Project project = owner.getProject();
//rely on RMIC being on the path
cmd.setExecutable(JavaEnvUtils.getJdkExecutable(getExecutableName()));
String executable = owner.getExecutable();
if (executable == null) {
// no explicitly specified executable
// rely on RMIC being on the path
executable = JavaEnvUtils.getJdkExecutable(getExecutableName());
}
cmd.setExecutable(executable);

//set up the args
String[] args = cmd.getCommandline();


Loading…
Cancel
Save