You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2004/10/21 12:31:07 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecTask.java

peterreilly    2004/10/21 03:31:06

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs ExecTask.java
  Log:
  ExecTask executes checkConfiguration() even though os does not match.
  PR: 31805
  Obtained from: David Boon
  
  Revision  Changes    Path
  1.674     +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.673
  retrieving revision 1.674
  diff -u -r1.673 -r1.674
  --- WHATSNEW	20 Oct 2004 08:38:04 -0000	1.673
  +++ WHATSNEW	21 Oct 2004 10:31:06 -0000	1.674
  @@ -124,6 +124,9 @@
   * Execution of top level tasks in imported files get delayed by targets.
     Bugzilla report 31487.
   
  +* ExecTask executes checkConfiguration() even though os does not match.
  +  Bugzilla report 31805.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===================================
   
  
  
  
  1.73      +8 -6      ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java
  
  Index: ExecTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- ExecTask.java	10 Sep 2004 15:16:11 -0000	1.72
  +++ ExecTask.java	21 Oct 2004 10:31:06 -0000	1.73
  @@ -455,15 +455,17 @@
        * </ul>
        */
       public void execute() throws BuildException {
  +        // Quick fail if this is not a valid OS for the command
  +        if (!isValidOs()) {
  +            return;
  +        }
           File savedDir = dir; // possibly altered in prepareExec
           cmdl.setExecutable(resolveExecutable(executable, searchPath));
           checkConfiguration();
  -        if (isValidOs()) {
  -            try {
  -                runExec(prepareExec());
  -            } finally {
  -                dir = savedDir;
  -            }
  +        try {
  +            runExec(prepareExec());
  +        } finally {
  +            dir = savedDir;
           }
       }
   
  
  
  

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