Browse Source

allow executable of signjar and verifyjat to be configured. PR 39189.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@697133 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
d51fbdd73d
3 changed files with 37 additions and 2 deletions
  1. +4
    -0
      WHATSNEW
  2. +11
    -1
      docs/manual/CoreTasks/signjar.html
  3. +22
    -1
      src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java

+ 4
- 0
WHATSNEW View File

@@ -371,6 +371,10 @@ Other changes:
ProjectHelper2 will be used just like in ant 1.7.1.
Bugzilla Report 42208.

* It is now possible to explicitly set the executable used by
<signjar>.
Bugzilla Report 39189.

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



+ 11
- 1
docs/manual/CoreTasks/signjar.html View File

@@ -141,7 +141,17 @@ block</td>
timestamped JAR files in Java1.5+</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">executable</td>
<td valign="top">Specify a particular <code>jarsigner</code> executable
to use in place of the default binary (found in the same JDK as
Ant is running in).<br/>
Must support the same command line options as the Sun JDK
jarsigner command.
<em>since Ant 1.8.0</em>.</td>
<td align="center" valign="top">all</td>
<td align="center" valign="top">No</td>
</tr>
</table>
<h3>Parameters as nested elements</h3>
<table border="1" cellpadding="2" cellspacing="0">


+ 22
- 1
src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java View File

@@ -103,6 +103,13 @@ public abstract class AbstractJarSignerTask extends Task {
*/
private Path path = null;

/**
* The executable to use instead of jarsigner.
*
* @since Ant 1.8.0
*/
private String executable;

/**
* Set the maximum memory to be used by the jarsigner process
*
@@ -250,6 +257,16 @@ public abstract class AbstractJarSignerTask extends Task {
return redirector;
}

/**
* Sets the actual executable command to invoke, instead of the binary
* <code>jarsigner</code> found in Ant's JDK.
* @param executable the command to invoke.
* @since Ant 1.8.0
*/
public void setExecutable(String executable) {
this.executable = executable;
}

/**
* these are options common to signing and verifying
* @param cmd command to configure
@@ -315,7 +332,11 @@ public abstract class AbstractJarSignerTask extends Task {
*/
protected ExecTask createJarSigner() {
final ExecTask cmd = new ExecTask(this);
cmd.setExecutable(JavaEnvUtils.getJdkExecutable(JARSIGNER_COMMAND));
if (executable == null) {
cmd.setExecutable(JavaEnvUtils.getJdkExecutable(JARSIGNER_COMMAND));
} else {
cmd.setExecutable(executable);
}
cmd.setTaskType(JARSIGNER_COMMAND);
cmd.setFailonerror(true);
cmd.addConfiguredRedirector(redirector);


Loading…
Cancel
Save