Skip to content

Commit

Permalink
MONDRIAN: Hard-code path to ant command for when running on hudson.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 13146]
  • Loading branch information
julianhyde committed Oct 30, 2009
1 parent 9e9a83d commit 3cb1c28
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion testsrc/main/mondrian/test/build/AntTestBase.java
Expand Up @@ -77,9 +77,23 @@ protected void runAntTest(String target)
return;
}

// On hudson, ant is not on the path but is at /opt/ant1.7. If that
// file exists, assume that we are on hudson. Otherwise, require ant
// to be on the path.
final File antFile = new File("/opt/ant1.7/bin/ant");
String antCommand;
if (antFile.exists()
&& antFile.canExecute())
{
antCommand = antFile.getAbsolutePath();
} else {
antCommand = "ant";
}

Runtime runtime = Runtime.getRuntime();
Process proc =
runtime.exec(new String[] { "ant", "-find", "build.xml", target });
runtime.exec(
new String[] { antCommand, "-find", "build.xml", target });

final Sucker outSucker =
new Sucker(proc.getInputStream(), DEBUG ? System.out : null);
Expand Down

0 comments on commit 3cb1c28

Please sign in to comment.