ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Exec.java
Date Sat, 15 Jul 2000 06:31:43 GMT
conor       00/07/14 23:31:43

  Modified:    .        build.bat
               src/main/org/apache/tools/ant/taskdefs Exec.java
  Added:       src/bin  antRun.bat
  Log:
  Restore antRun.bat for Win9x users.
  
  This should allow the exec task to execute on Win9x. I have changed Glen's
  patch to test for platfrom != NT rather than == 98 so it will
  support 95.
  
  NOTE: There is an important limitation. Only 9 arguments can be
  passed to the command being exec'ed when the antRun.bat file is used. This
  should only occur when the directory is not . and the platform is not NT.
  This was the original reason this was changed (and antRun.bat) deleted.
  
  Submitted by:	Glen Stampoultzis <trinexus@one.net.au>
  
  Revision  Changes    Path
  1.11      +3 -3      jakarta-ant/build.bat
  
  Index: build.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.bat,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- build.bat	2000/07/12 22:22:43	1.10
  +++ build.bat	2000/07/15 06:31:41	1.11
  @@ -2,10 +2,10 @@
   
   set REALANTHOME=%ANT_HOME%
   set ANT_HOME=.
  -if not exist lib\ant.jar call bootstrap.bat
  -if not exist bin\ant.bat call bootstrap.bat
  -if not exist bin\lcp.bat call bootstrap.bat
  +if exist lib\ant.jar if exist bin\ant.bat if exist bin\lcp.bat if exist bin\antRun.bat
goto runAnt
  +call bootstrap.bat
   
  +:runAnt
   set ANT_INSTALL=
   if not "%REALANTHOME%" == "" set ANT_INSTALL=-Dant.install %REALANTHOME%
   call .\bin\ant.bat %ANT_INSTALL% %1 %2 %3 %4 %5 %6 %7 %8 %9
  
  
  
  1.4       +7 -2      jakarta-ant/src/bin/antRun.bat
  
  
  
  
  1.15      +14 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java
  
  Index: Exec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Exec.java	2000/07/07 11:24:00	1.14
  +++ Exec.java	2000/07/15 06:31:42	1.15
  @@ -63,7 +63,6 @@
    * @author duncan@x180.com
    * @author rubys@us.ibm.com
    */
  -
   public class Exec extends Task {
       private String os;
       private String out;
  @@ -95,8 +94,20 @@
           if (dir == null) dir = project.getBaseDir();
   
           if (myos.toLowerCase().indexOf("windows") >= 0) {
  -            if (!dir.equals(project.resolveFile(".")))
  -                command = "cmd /c cd " + dir + " && " + command;
  +            if (!dir.equals(project.resolveFile("."))) {
  +                if (myos.toLowerCase().indexOf("nt") >= 0) {
  +                    command = "cmd /c cd " + dir + " && " + command;
  +                }
  +                else {
  +                    String ant = project.getProperty("ant.home");
  +                    if (ant == null) {
  +                        throw new BuildException("Property 'ant.home' not found", location);
  +                    }
  +                
  +                    String antRun = project.resolveFile(ant + "/bin/antRun.bat").toString();
  +                    command = antRun + " " + dir + " " + command;
  +                }
  +            }
           } else {
               String ant = project.getProperty("ant.home");
               if (ant == null) throw new BuildException("Property 'ant.home' not found",
location);
  
  
  

Mime
View raw message