ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs SignJarTest.java
Date Thu, 16 Jan 2003 11:09:44 GMT
conor       2003/01/16 03:09:43

  Modified:    .        WHATSNEW build.xml
               src/etc/testcases/taskdefs signjar.xml
               src/main/org/apache/tools/ant/taskdefs SignJar.java
               src/testcases/org/apache/tools/ant/taskdefs SignJarTest.java
  Log:
  Restore ability of signjar keystore to take a URL
  
  PR:     10672
  
  Revision  Changes    Path
  1.341     +4 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.340
  retrieving revision 1.341
  diff -u -w -u -r1.340 -r1.341
  --- WHATSNEW	15 Jan 2003 14:02:49 -0000	1.340
  +++ WHATSNEW	16 Jan 2003 11:09:42 -0000	1.341
  @@ -17,6 +17,10 @@
   * The <script> task now requires Apache BSF instead of the older IBM
     version.  See <http://jakarta.apache.org/bsf/>
   
  +* The signjar keystore attribute has been reverted to a String allowing
  +  it to once again accept URLs. This should not affect current FIle based usage
  +  unless you are extending the Signjar task.
  +
   * <xmlproperty> will no longer fail if the file to be loaded doesn't exist.
   
   Fixed bugs:
  
  
  
  1.342     +9 -8      jakarta-ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.xml,v
  retrieving revision 1.341
  retrieving revision 1.342
  diff -u -w -u -r1.341 -r1.342
  --- build.xml	13 Jan 2003 12:05:51 -0000	1.341
  +++ build.xml	16 Jan 2003 11:09:42 -0000	1.342
  @@ -289,6 +289,7 @@
     </selector>
     <patternset id="onlinetests">
       <exclude name="**/GetTest.java" if="offline"/>
  +    <exclude name="**/SignJarTest.java" if="offline"/>
     </patternset>
     <patternset id="teststhatfail">
       <exclude name="${optional.package}/BeanShellScriptTest.java"/>
  
  
  
  1.2       +17 -5     jakarta-ant/src/etc/testcases/taskdefs/signjar.xml
  
  Index: signjar.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/signjar.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- signjar.xml	23 Dec 2002 13:29:16 -0000	1.1
  +++ signjar.xml	16 Jan 2003 11:09:43 -0000	1.2
  @@ -1,24 +1,36 @@
  -<project name="signjartest" default="help">
  -  <property name="classes.dir" value="../../../../build/classes"/>
  +<project name="signjartest" default="help" basedir="..">
  +  <property name="classes.dir" value="../../../build/classes"/>
   
     <target name="basic">
       <jar jarfile="signtest.jar" basedir="${classes.dir}" includes="**/Task.class"/>
  -    <signjar jar="signtest.jar" alias="testonly" keystore="../testkeystore"
  +    <signjar jar="signtest.jar" alias="testonly" keystore="testkeystore"
                storepass="apacheant"/>
     </target>
   
     <target name="sigfile">
       <jar jarfile="signtest.jar" basedir="${classes.dir}" includes="**/Task.class"/>
  -    <signjar jar="signtest.jar" alias="testonly" keystore="../testkeystore"
  +    <signjar jar="signtest.jar" alias="testonly" keystore="testkeystore"
                storepass="apacheant" sigfile="TEST"/>
     </target>
   
     <target name="maxmemory">
       <jar jarfile="signtest.jar" basedir="${classes.dir}" includes="**/Task.class"/>
  -    <signjar jar="signtest.jar" alias="testonly" keystore="../testkeystore"
  +    <signjar jar="signtest.jar" alias="testonly" keystore="testkeystore"
                storepass="apacheant" maxmemory="128m"/>
     </target>
   
  +  <target name="urlKeystoreFile">
  +    <jar jarfile="signtest.jar" basedir="${classes.dir}" includes="**/Task.class"/>
  +    <signjar jar="signtest.jar" alias="testonly" keystore="file://../testkeystore"
  +             storepass="apacheant" maxmemory="128m"/>
  +  </target>
  +
  +  <target name="urlKeystoreHTTP">
  +    <jar jarfile="signtest.jar" basedir="${classes.dir}" includes="**/Task.class"/>
  +    <signjar jar="signtest.jar" alias="testonly"
  +             keystore="http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-ant/src/etc/testcases/testkeystore?rev=HEAD"
  +             storepass="apacheant" maxmemory="128m"/>
  +  </target>
   
     <target name="clean">
       <delete file="signtest.jar"/>
  
  
  
  1.26      +14 -5     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.25
  retrieving revision 1.26
  diff -u -w -u -r1.25 -r1.26
  --- SignJar.java	23 Dec 2002 13:29:16 -0000	1.25
  +++ SignJar.java	16 Jan 2003 11:09:43 -0000	1.26
  @@ -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
  @@ -97,7 +97,7 @@
       /**
        * The name of keystore file.
        */
  -    protected File keystore;
  +    private String keystore;
   
       protected String storepass;
       protected String storetype;
  @@ -115,6 +115,7 @@
        * 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.
  @@ -149,7 +150,7 @@
       /**
        * keystore location; required
        */
  -    public void setKeystore(final File keystore) {
  +    public void setKeystore(final String keystore) {
           this.keystore = keystore;
       }
   
  @@ -286,8 +287,16 @@
           }
   
           if (null != keystore) {
  +            // is the keystore a file
  +            File keystoreFile = getProject().resolveFile(keystore);
  +            if (keystoreFile.exists()) {
  +                cmd.createArg().setValue("-keystore");
  +                cmd.createArg().setValue(keystoreFile.getPath());
  +            } else {
  +                // must be a URL - just pass as is
               cmd.createArg().setValue("-keystore");
  -            cmd.createArg().setValue(keystore.toString());
  +                cmd.createArg().setValue(keystore);
  +            }
           }
   
           if (null != storepass) {
  
  
  
  1.2       +7 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/SignJarTest.java
  
  Index: SignJarTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/SignJarTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- SignJarTest.java	23 Dec 2002 13:29:16 -0000	1.1
  +++ SignJarTest.java	16 Jan 2003 11:09:43 -0000	1.2
  @@ -97,4 +97,11 @@
           executeTarget("maxmemory");
       }
   
  +    public void testURLKeystoreFile() {
  +        executeTarget("urlKeystoreFile");
  +    }
  +
  +    public void testURLKeystoreHTTP() {
  +        executeTarget("urlKeystoreHTTP");
  +    }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message