Author: bodewig
Date: Fri Sep 19 08:28:34 2008
New Revision: 697133
URL: http://svn.apache.org/viewvc?rev=697133&view=rev
Log:
allow executable of signjar and verifyjat to be configured. PR 39189.
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/CoreTasks/signjar.html
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
Modified: ant/core/trunk/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=697133&r1=697132&r2=697133&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Sep 19 08:28:34 2008
@@ -371,6 +371,10 @@
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
=============================================
Modified: ant/core/trunk/docs/manual/CoreTasks/signjar.html
URL:
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/signjar.html?rev=697133&r1=697132&r2=697133&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/signjar.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/signjar.html Fri Sep 19 08:28:34 2008
@@ -141,7 +141,17 @@
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">
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java?rev=697133&r1=697132&r2=697133&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
Fri Sep 19 08:28:34 2008
@@ -104,6 +104,13 @@
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
*
* @param max a string indicating the maximum memory according to the JVM
@@ -251,6 +258,16 @@
}
/**
+ * 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 @@
*/
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);