ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types Path.java
Date Fri, 27 Oct 2000 14:59:38 GMT
bodewig     00/10/27 07:59:34

  Modified:    .        WHATSNEW
               docs     index.html
               src/main/org/apache/tools/ant/taskdefs ExecTask.java
                        Javac.java SignJar.java
               src/main/org/apache/tools/ant/types Path.java
  Log:
  javadoc correction to ExecTask
  
  Submitted by:	Jesse Glick <Jesse.Glick@netbeans.com>
  
  Make Path use getCanonicalPath throughout.
  
  Submitted by:	Vincent Bergbauer <vincent_bergbauer@yahoo.com>
  
  Remove deprecation warnings in SignJar
  
  Submitted by:	KC Baltz <KBaltz@responsenetworks.com>
  
  Give user a clue if the classic compiler can not be found.
  
  Submitted by:	Erik Meade <emeade@geekfarm.org>
  
  Revision  Changes    Path
  1.38      +14 -0     jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- WHATSNEW	2000/10/24 08:45:24	1.37
  +++ WHATSNEW	2000/10/27 14:59:14	1.38
  @@ -1,4 +1,18 @@
  +Changes from Ant 1.2 to the current sources
  +===========================================
  +
  +Other changes:
  +--------------
  +
  +* New tasks: propertyfile
  +
  +Fixed bugs:
  +-----------
  +
  +* <signjar> doesn't use deprectated methods anymore.
  +
   Changes from Ant 1.1 to Ant 1.2
  +===============================
   
   Changes that could break older environments:
   --------------------------------------------
  
  
  
  1.137     +1 -1      jakarta-ant/docs/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/index.html,v
  retrieving revision 1.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- index.html	2000/10/24 08:23:57	1.136
  +++ index.html	2000/10/27 14:59:19	1.137
  @@ -26,7 +26,7 @@
     <li>Dave Walend (<a href="mailto:dwalend@cs.tufts.edu">dwalend@cs.tufts.edu</a>)</li>
   </ul>
   
  -<p>Version 1.2 - 2000/10/24</p>
  +<p>Version 1.3 - 2000/10/27</p>
   
   <hr>
   <h2>Table of Contents</h2>
  
  
  
  1.8       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java
  
  Index: ExecTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ExecTask.java	2000/08/10 15:33:18	1.7
  +++ ExecTask.java	2000/10/27 14:59:25	1.8
  @@ -101,7 +101,7 @@
       }
   
       /**
  -     * Only execute the process if <code>os.name</code> includes this string.
  +     * Only execute the process if <code>os.name</code> is included in this
string.
        */
       public void setOs(String os) {
           this.os = os;
  
  
  
  1.56      +3 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- Javac.java	2000/10/20 11:36:07	1.55
  +++ Javac.java	2000/10/27 14:59:26	1.56
  @@ -481,7 +481,9 @@
               }
           }
           catch (ClassNotFoundException ex) {
  -            throw new BuildException("Cannot use classic compiler, as it is not available",
location);
  +            throw new BuildException("Cannot use classic compiler, as it is not available"+
  +            						 " A common solution is to set the environment variable"+
  +                                     " JAVA_HOME to your jdk directory.", location);
           }
           catch (Exception ex) {
               if (ex instanceof BuildException) {
  
  
  
  1.4       +21 -31    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SignJar.java	2000/08/10 06:51:51	1.3
  +++ SignJar.java	2000/10/27 14:59:27	1.4
  @@ -150,67 +150,57 @@
   
           final StringBuffer sb = new StringBuffer();
   
  -        sb.append("jarsigner ");
  -
  +        final ExecTask cmd = (ExecTask) project.createTask("exec");
  +        cmd.setExecutable("jarsigner");
  +        
           if (null != keystore) {
  -            sb.append("-keystore \"");
  -            sb.append(keystore);
  -            sb.append("\" ");
  +            cmd.createArg().setValue("-keystore");
  +            cmd.createArg().setValue(keystore);
           } 
   
           if (null != storepass) {
  -            sb.append("-storepass \"");
  -            sb.append(storepass);
  -            sb.append("\" ");
  +            cmd.createArg().setValue("-storepass");
  +            cmd.createArg().setValue(storepass);
           } 
   
           if (null != storetype) {
  -            sb.append("-storetype \"");
  -            sb.append(storetype);
  -            sb.append("\" ");
  +            cmd.createArg().setValue("-storetype");
  +            cmd.createArg().setValue(storetype);
           } 
   
           if (null != keypass) {
  -            sb.append("-keypass \"");
  -            sb.append(keypass);
  -            sb.append("\" ");
  +            cmd.createArg().setValue("-keypass");
  +            cmd.createArg().setValue(keypass);
           } 
   
           if (null != sigfile) {
  -            sb.append("-sigfile \"");
  -            sb.append(sigfile);
  -            sb.append("\" ");
  +            cmd.createArg().setValue("-sigfile");
  +            cmd.createArg().setValue(sigfile);
           } 
   
           if (null != signedjar) {
  -            sb.append("-signedjar \"");
  -            sb.append(signedjar);
  -            sb.append("\" ");
  +            cmd.createArg().setValue("-signedjar");
  +            cmd.createArg().setValue(signedjar);
           } 
   
           if (verbose) {
  -            sb.append("-verbose ");
  +            cmd.createArg().setValue("-verbose");
           } 
   
           if (internalsf) {
  -            sb.append("-internalsf ");
  +            cmd.createArg().setValue("-internalsf");
           } 
   
           if (sectionsonly) {
  -            sb.append("-sectionsonly ");
  +            cmd.createArg().setValue("-sectionsonly");
           } 
   
  -        sb.append('\"');
  -        sb.append(jar);
  -        sb.append("\" ");
  +        cmd.createArg().setValue(jar);
           
  -        sb.append('\"');
  -        sb.append(alias);
  -        sb.append("\" ");
   
  +        cmd.createArg().setValue(alias);
  +
           log("Signing Jar : " + (new File(jar)).getAbsolutePath());
  -        final ExecTask cmd = (ExecTask) project.createTask("exec");
  -        cmd.setCommand(new Commandline(sb.toString()));
           cmd.setFailonerror(true);
           cmd.setTaskName( getTaskName() );
           cmd.execute();
  
  
  
  1.10      +27 -5     jakarta-ant/src/main/org/apache/tools/ant/types/Path.java
  
  Index: Path.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Path.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Path.java	2000/09/07 09:50:59	1.9
  +++ Path.java	2000/10/27 14:59:32	1.10
  @@ -60,6 +60,7 @@
   import org.apache.tools.ant.PathTokenizer;
   
   import java.io.File;
  +import java.io.IOException;
   import java.util.Enumeration;
   import java.util.StringTokenizer;
   import java.util.Stack;
  @@ -111,7 +112,16 @@
           private String[] parts;
   
           public void setLocation(File loc) {
  -            parts = new String[] {translateFile(loc.getAbsolutePath())};
  +            try {
  +                parts = new String[] {translateFile(loc.getCanonicalPath())};
  +            } catch(IOException e) {
  +                // XXX I'd like to log something here but if I don't
  +                //     have a Project I can't
  +                if (project != null) {
  +                    project.log(e.getMessage(), Project.MSG_WARN);
  +                }
  +                parts = new String[] {translateFile(loc.getAbsolutePath())};
  +            }
           }
   
           public void setPath(String path) {
  @@ -294,9 +304,15 @@
                   String[] s = ds.getIncludedFiles();
                   File dir = fs.getDir(project);
                   for (int j=0; j<s.length; j++) {
  -                    addUnlessPresent(result, 
  -                                     translateFile((new File(dir, s[j])).getAbsolutePath()));
  -                }
  +                    String canonicalPath;
  +                    File f = new File(dir, s[j]);
  +                    try {
  +                        canonicalPath = f.getCanonicalPath();
  +                    } catch(IOException e) {
  +                        canonicalPath = f.getAbsolutePath();
  +                    }
  +                    addUnlessPresent(result, translateFile(canonicalPath));
  +                } 
               }
           }
           String[] res = new String[result.size()];
  @@ -430,7 +446,13 @@
        */
       private static String resolveFile(Project project, String relativeName) {
           if (project != null) {
  -            return project.resolveFile(relativeName).getAbsolutePath();
  +            File f = project.resolveFile(relativeName);
  +            try {
  +                return f.getCanonicalPath();
  +            } catch(IOException e) {
  +                project.log(e.getMessage(), Project.MSG_WARN);
  +                return f.getAbsolutePath();
  +            }
           }
           return relativeName;
       }
  
  
  

Mime
View raw message