Browse Source

Restore support for > 9 parameters on exec calls on Windows

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267582 13f79535-47bb-0310-9956-ffa450edef68
master
Sam Ruby 25 years ago
parent
commit
d84932f8b0
2 changed files with 10 additions and 10 deletions
  1. +0
    -4
      src/bin/antRun.bat
  2. +10
    -6
      src/main/org/apache/tools/ant/taskdefs/Exec.java

+ 0
- 4
src/bin/antRun.bat View File

@@ -1,4 +0,0 @@
@echo off
cd %1
echo %2 %3 %4 %5 %6 %7 %8 %9
%2 %3 %4 %5 %6 %7 %8 %9

+ 10
- 6
src/main/org/apache/tools/ant/taskdefs/Exec.java View File

@@ -87,12 +87,16 @@ public class Exec extends Task {
return; return;
} }


String ant = project.getProperty("ant.home");
if (ant == null) throw new BuildException("Property 'ant.home' not found");

String antRun = project.resolveFile(ant + "/bin/antRun").toString();
if (myos.toLowerCase().indexOf("windows") >= 0) antRun = antRun + ".bat";
command = antRun + " " + project.resolveFile(dir) + " " + command;
if (myos.toLowerCase().indexOf("windows") >= 0) {
if (!dir.equals("."))
command = "cmd /c cd " + project.resolveFile(dir) + " && " + command;
} else {
String ant = project.getProperty("ant.home");
if (ant == null) throw new BuildException("Property 'ant.home' not found");
String antRun = project.resolveFile(ant + "/bin/antRun").toString();

command = antRun + " " + project.resolveFile(dir) + " " + command;
}


try { try {
// show the command // show the command


Loading…
Cancel
Save