From b22e573ad2a2459a047bf740b141a6ebf727039d Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Mon, 27 Jan 2003 15:10:36 +0000 Subject: [PATCH] Make default not to resolve executable git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273896 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/ExecTask.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecTask.java b/src/main/org/apache/tools/ant/taskdefs/ExecTask.java index 77b390cc0..06653937d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecTask.java @@ -99,6 +99,7 @@ public class ExecTask extends Task { private boolean failIfExecFails = true; private boolean append = false; private String executable; + private boolean resolveExecutable = false; /** * Controls whether the VM (1.3 and above) is used to execute the @@ -186,6 +187,13 @@ public class ExecTask extends Task { newEnvironment = newenv; } + /** + * Attempt to resolve the executable to a file + */ + public void setResolveExecutable(boolean resolveExecutable) { + this.resolveExecutable = resolveExecutable; + } + /** * Add an environment variable to the launched process. */ @@ -240,6 +248,8 @@ public class ExecTask extends Task { this.append = append; } + + /** * Attempt to figure out where the executable is so that we can feed * the full path - first try basedir, then the exec dir and then @@ -248,6 +258,10 @@ public class ExecTask extends Task { * @return the executable as a full path if it can be determined. */ private String resolveExecutable() { + if (!resolveExecutable) { + return executable; + } + // try to find the executable File executableFile = getProject().resolveFile(executable); if (executableFile.exists()) {