ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecTask.java
Date Fri, 21 Nov 2003 11:13:15 GMT
bodewig     2003/11/21 03:13:15

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
                        ExecTask.java
  Log:
  Merge from HEAD
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.61.2.1  +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.61
  retrieving revision 1.61.2.1
  diff -u -r1.61 -r1.61.2.1
  --- ExecTask.java	18 Sep 2003 14:21:41 -0000	1.61
  +++ ExecTask.java	21 Nov 2003 11:13:15 -0000	1.61.2.1
  @@ -363,14 +363,16 @@
        * fallback to the straight executable name (i.e. on ther path)
        *
        * @return the executable as a full path if it can be determined.
  +     *
  +     * @since Ant 1.6
        */
  -    private String resolveExecutable() {
  +    protected String resolveExecutable(String exec) {
           if (!resolveExecutable) {
  -            return executable;
  +            return exec;
           }
   
           // try to find the executable
  -        File executableFile = getProject().resolveFile(executable);
  +        File executableFile = getProject().resolveFile(exec);
           if (executableFile.exists()) {
               return executableFile.getAbsolutePath();
           }
  @@ -378,14 +380,14 @@
           // now try to resolve against the dir if given
           if (dir != null) {
               FileUtils fileUtils = FileUtils.newFileUtils();
  -            executableFile = fileUtils.resolveFile(dir, executable);
  +            executableFile = fileUtils.resolveFile(dir, exec);
               if (executableFile.exists()) {
                   return executableFile.getAbsolutePath();
               }
           }
   
           // couldn't find it - must be on path
  -        return executable;
  +        return exec;
       }
   
       /**
  @@ -400,7 +402,7 @@
        */
       public void execute() throws BuildException {
           File savedDir = dir; // possibly altered in prepareExec
  -        cmdl.setExecutable(resolveExecutable());
  +        cmdl.setExecutable(resolveExecutable(executable));
           checkConfiguration();
           if (isValidOs()) {
               try {
  
  
  

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


Mime
View raw message