bodewig     2002/10/16 22:57:05

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
                        Pack.java
  Log:
  Provide more meaningfull message if source doesn't exist in <.+zip>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.2   +8 -5      
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Pack.java
  
  Index: Pack.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Pack.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- Pack.java 18 Jun 2002 05:51:10 -0000      1.8.2.1
  +++ Pack.java 17 Oct 2002 05:57:05 -0000      1.8.2.2
  @@ -99,21 +99,21 @@
        */
       private void validate() throws BuildException {
           if (zipFile == null) {
  -            throw new BuildException("zipfile attribute is required", 
location);
  +            throw new BuildException("zipfile attribute is required", 
getLocation());
           }
   
           if (zipFile.isDirectory()) {
               throw new BuildException("zipfile attribute must not " +
  -                                     "represent a directory!", location);
  +                                     "represent a directory!", 
getLocation());
           }
   
           if (source == null) {
  -            throw new BuildException("src attribute is required", location);
  +            throw new BuildException("src attribute is required", 
getLocation());
           }
   
           if (source.isDirectory()) {
               throw new BuildException("Src attribute must not " +
  -                                     "represent a directory!", location);
  +                                     "represent a directory!", 
getLocation());
           }
       }
   
  @@ -124,7 +124,10 @@
       public void execute() throws BuildException {
           validate();
   
  -        if (zipFile.lastModified() < source.lastModified()) {
  +        if (!source.exists()) {
  +            log("Nothing to do: " + source.getAbsolutePath() +
  +                " doesn't exist.");
  +        } else if (zipFile.lastModified() < source.lastModified()) {
               log("Building: " + zipFile.getAbsolutePath());
               pack();
           } else {
  
  
  

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

Reply via email to