conor       2003/01/16 04:00:39

  Modified:    docs/manual/CoreTasks Tag: ANT_15_BRANCH signjar.html
               src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
                        SignJar.java
  Log:
  Mereg of Signjar fixes from CVS HEAD
  
  PR:   1284, 10754, 10672, 11175
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.2   +10 -4     jakarta-ant/docs/manual/CoreTasks/signjar.html
  
  Index: signjar.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/signjar.html,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -w -u -r1.6.2.1 -r1.6.2.2
  --- signjar.html      3 May 2002 09:40:28 -0000       1.6.2.1
  +++ signjar.html      16 Jan 2003 12:00:39 -0000      1.6.2.2
  @@ -86,6 +86,12 @@
        file means a JAR is signed</td>
       <td valign="top" align="center">No; default false</td>
     </tr>  
  +  <tr>
  +    <td valign="top">maxmemory</td>
  +    <td valign="top">Specifies the maximum memory the jarsigner VM will use. 
Specified in the
  +                     style of standard java memory specs (e.g. 128m = 128 
MBytes)</td>
  +    <td valign="top" align="center">No</td>
  +  </tr>
   </table>
   <h3>Parameters as nested elements</h3>
   <table border="1" cellpadding="2" cellspacing="0">
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.21.2.2  +43 -16    
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SignJar.java
  
  Index: SignJar.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SignJar.java,v
  retrieving revision 1.21.2.1
  retrieving revision 1.21.2.2
  diff -u -w -u -r1.21.2.1 -r1.21.2.2
  --- SignJar.java      20 Jun 2002 07:37:21 -0000      1.21.2.1
  +++ SignJar.java      16 Jan 2003 12:00:39 -0000      1.21.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -99,27 +99,42 @@
       /**
        * The name of keystore file.
        */
  -    protected File keystore;
  +    private String keystore;
   
       protected String storepass;
       protected String storetype;
       protected String keypass;
  -    protected File sigfile;
  +    protected String sigfile;
       protected File signedjar;
       protected boolean verbose;
       protected boolean internalsf;
       protected boolean sectionsonly;
   
  +    /** The maximum amount of memory to use for Jar signer */
  +    private String maxMemory;
  +
       /**
        * the filesets of the jars to sign
        */
       protected Vector filesets = new Vector();
  +
       /**
        * Whether to assume a jar which has an appropriate .SF file in is 
already
        * signed.
        */
       protected boolean lazy;
   
  +
  +    /**
  +     * Set the maximum memory to be used by the jarsigner process
  +     *
  +     * @param max a string indicating the maximum memory according to the
  +     *        JVM conventions (e.g. 128m is 128 Megabytes)
  +     */
  +    public void setMaxmemory(String max) {
  +        maxMemory = max;
  +    }
  +
       /**
        * the jar file to sign; required
        */
  @@ -137,7 +152,7 @@
       /**
        * keystore location; required
        */
  -    public void setKeystore(final File keystore) {
  +    public void setKeystore(final String keystore) {
           this.keystore = keystore;
       }
   
  @@ -165,7 +180,7 @@
       /**
        * name of .SF/.DSA file; optional
        */
  -    public void setSigfile(final File sigfile) {
  +    public void setSigfile(final String sigfile) {
           this.sigfile = sigfile;
       }
   
  @@ -266,12 +281,24 @@
             return;
           }
   
  -        final ExecTask cmd = (ExecTask) project.createTask("exec");
  -        cmd.setExecutable("jarsigner");
  +        final ExecTask cmd = (ExecTask) getProject().createTask("exec");
  +        cmd.setExecutable(JavaEnvUtils.getJdkExecutable("jarsigner"));
  +
  +        if (maxMemory != null) {
  +            cmd.createArg().setValue("-J-Xmx" + maxMemory);
  +        }
   
           if (null != keystore) {
  +            // is the keystore a file
  +            File keystoreFile = getProject().resolveFile(keystore);
  +            if (keystoreFile.exists()) {
               cmd.createArg().setValue("-keystore");
  -            cmd.createArg().setValue(keystore.toString());
  +                cmd.createArg().setValue(keystoreFile.getPath());
  +            } else {
  +                // must be a URL - just pass as is
  +                cmd.createArg().setValue("-keystore");
  +                cmd.createArg().setValue(keystore);
  +            }
           }
   
           if (null != storepass) {
  @@ -291,7 +318,7 @@
   
           if (null != sigfile) {
               cmd.createArg().setValue("-sigfile");
  -            cmd.createArg().setValue(sigfile.toString());
  +            cmd.createArg().setValue(sigfile);
           }
   
           if (null != jarTarget) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to