提交 2b9fbcde 编写于 作者: K kohsuke

fixed #280.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2092 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d6f052dd
......@@ -58,10 +58,10 @@ public class Ant extends Builder {
String cmd;
String execName;
if(onWindows)
execName = "ant.bat";
else
if(launcher.isUnix())
execName = "ant";
else
execName = "ant.bat";
String normalizedTarget = targets.replaceAll("[\t\r\n]+"," ");
......@@ -81,7 +81,7 @@ public class Ant extends Builder {
if(ai!=null)
env.put("ANT_HOME",ai.getAntHome());
if(onWindows) {
if(!launcher.isUnix()) {
// on Windows, executing batch file can't return the correct error code,
// so we need to wrap it into cmd.exe.
// double %% is needed because we want ERRORLEVEL to be expanded after
......@@ -228,6 +228,4 @@ public class Ant extends Builder {
return getExecutable().exists();
}
}
private static final boolean onWindows = File.separatorChar == '\\';
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册