bodewig     2004/01/30 07:37:41

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
                        Execute.java
  Log:
  Merge with HEAD
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.34 +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.33
  retrieving revision 1.503.2.34
  diff -u -r1.503.2.33 -r1.503.2.34
  --- WHATSNEW  30 Jan 2004 14:45:39 -0000      1.503.2.33
  +++ WHATSNEW  30 Jan 2004 15:37:41 -0000      1.503.2.34
  @@ -28,6 +28,9 @@
   * The gcj compiler adapter for <javac> failed if the destination
     directory didn't exist.  Bugzilla Report 25856.
   
  +* Ant now fails with a more useful message if a new process will be
  +  forked in a directory and that directory doesn't exist.
  +
   Other changes:
   --------------
   
  
  
  
  No                   revision
  No                   revision
  1.68.2.3  +12 -3     ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
  retrieving revision 1.68.2.2
  retrieving revision 1.68.2.3
  diff -u -r1.68.2.2 -r1.68.2.3
  --- Execute.java      25 Sep 2003 14:52:52 -0000      1.68.2.2
  +++ Execute.java      30 Jan 2004 15:37:41 -0000      1.68.2.3
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -476,6 +476,9 @@
               launcher = shellLauncher;
           }
   
  +        if (dir != null && !dir.exists()) {
  +            throw new BuildException(dir + " doesn't exists.");
  +        }
           return launcher.exec(project, command, env, dir);
       }
   
  @@ -487,6 +490,9 @@
        *            of the subprocess failed
        */
       public int execute() throws IOException {
  +        if (workingDirectory != null && !workingDirectory.exists()) {
  +            throw new BuildException(workingDirectory + " doesn't exists.");
  +        }
           final Process process = launch(project, getCommandline(),
                                          getEnvironment(), workingDirectory,
                                          useVMLauncher);
  @@ -536,6 +542,9 @@
        * @since ant 1.6
        */
       public void spawn() throws IOException {
  +        if (workingDirectory != null && !workingDirectory.exists()) {
  +            throw new BuildException(workingDirectory + " doesn't exists.");
  +        }
           final Process process = launch(project, getCommandline(),
                                          getEnvironment(), workingDirectory,
                                          useVMLauncher);
  @@ -625,7 +634,7 @@
           // so we only return the new values which then will be set in
           // the generated DCL script, inheriting the parent process 
environment
           if (Os.isFamily("openvms")) {
  -                return env;
  +            return env;
           }
   
           Vector osEnv = (Vector) getProcEnvironment().clone();
  
  
  

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

Reply via email to