git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@763661 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -363,6 +363,10 @@ Fixed bugs: | |||||
| * The ant shell script should now support MSYS/MinGW as well. | * The ant shell script should now support MSYS/MinGW as well. | ||||
| Bugzilla Report 46936. | Bugzilla Report 46936. | ||||
| * <signjar> has a new force attribute that allows re-signing of jars | |||||
| that are already signed. | |||||
| Bugzilla Report 46891. | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| * A HostInfo task was added performing information on hosts, including info on | * A HostInfo task was added performing information on hosts, including info on | ||||
| @@ -927,6 +927,10 @@ | |||||
| <first>Paulo</first> | <first>Paulo</first> | ||||
| <last>Gaspar</last> | <last>Gaspar</last> | ||||
| </name> | </name> | ||||
| <name> | |||||
| <first>Pavel</first> | |||||
| <last>Jisl</last> | |||||
| </name> | |||||
| <name> | <name> | ||||
| <first>Paweł</first> | <first>Paweł</first> | ||||
| <last>Zuzelski</last> | <last>Zuzelski</last> | ||||
| @@ -149,9 +149,15 @@ block</td> | |||||
| Must support the same command line options as the Sun JDK | Must support the same command line options as the Sun JDK | ||||
| jarsigner command. | jarsigner command. | ||||
| <em>since Ant 1.8.0</em>.</td> | <em>since Ant 1.8.0</em>.</td> | ||||
| <td align="center" valign="top">all</td> | |||||
| <td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
| </tr> | </tr> | ||||
| <tr> | |||||
| <td valign="top">force</td> | |||||
| <td valign="top">Whether to force signing of the jar file even if | |||||
| it doesn't seem to be out of date or already signed. | |||||
| <em>since Ant 1.8.0</em>.</td> | |||||
| <td align="center" valign="top">No; default false</td> | |||||
| </tr> | |||||
| </table> | </table> | ||||
| <h3>Parameters as nested elements</h3> | <h3>Parameters as nested elements</h3> | ||||
| <table border="1" cellpadding="2" cellspacing="0"> | <table border="1" cellpadding="2" cellspacing="0"> | ||||
| @@ -104,6 +104,11 @@ public class SignJar extends AbstractJarSignerTask { | |||||
| */ | */ | ||||
| protected String tsacert; | protected String tsacert; | ||||
| /** | |||||
| * force signing even if the jar is already signed. | |||||
| */ | |||||
| private boolean force = false; | |||||
| /** | /** | ||||
| * error string for unit test verification: {@value} | * error string for unit test verification: {@value} | ||||
| */ | */ | ||||
| @@ -253,6 +258,23 @@ public class SignJar extends AbstractJarSignerTask { | |||||
| this.tsacert = tsacert; | this.tsacert = tsacert; | ||||
| } | } | ||||
| /** | |||||
| * Whether to force signing of a jar even it is already signed. | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public void setForce(boolean b) { | |||||
| force = b; | |||||
| } | |||||
| /** | |||||
| * Should the task force signing of a jar even it is already | |||||
| * signed? | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public boolean isForce() { | |||||
| return force; | |||||
| } | |||||
| /** | /** | ||||
| * sign the jar(s) | * sign the jar(s) | ||||
| * | * | ||||
| @@ -448,7 +470,7 @@ public class SignJar extends AbstractJarSignerTask { | |||||
| * @return true if the signedjarFile is considered up to date | * @return true if the signedjarFile is considered up to date | ||||
| */ | */ | ||||
| protected boolean isUpToDate(File jarFile, File signedjarFile) { | protected boolean isUpToDate(File jarFile, File signedjarFile) { | ||||
| if (null == jarFile || !jarFile.exists()) { | |||||
| if (isForce() || null == jarFile || !jarFile.exists()) { | |||||
| //these are pathological cases, but retained in case somebody | //these are pathological cases, but retained in case somebody | ||||
| //subclassed us. | //subclassed us. | ||||
| return false; | return false; | ||||