Thanks! Running it with the forkIntegTest task does work.
Now I'm trying to get it to run in forked mode all the time. I tried both
of the following:
- executer.usingExecutable('gradle')
- executer.usingExecutable("${distribution.gradleHomeDir}/bin/gradle")
Both of which failed with a IOException: No such file or directory.
It looks like the issue is that it is prepending the executable with the
working directory (for the Unix command builder). I really just want the
gradle that's in the Gradle home directory.
I haven't booted into Windows to try this, but it looks like Windows is
assembling the path differently and, I think, correctly.
>From WindowsCommandBuilder (which also adds the gradleHome/bin dir to the
PATH):
if (getExecutable() != null) {
cmd = getExecutable().replace('/', File.separatorChar);
} else {
cmd = "gradle";
}
>From UnixCommandBuilder:
if (getExecutable() != null) {
builder.executable(String.format("%s/%s", getWorkingDir().getAbsolutePath(),
getExecutable()));
} else {
builder.executable(String.format("%s/bin/gradle",
gradleHomeDir.getAbsolutePath()));
}
What I tried to get around the problem was switching the Unix handling to
this:
builder.executable(getExecutable());
This did work, but rather than needing to set the executable (and then
having to hack around the command builder) it would be nice to have a way to
put it into fork mode without having to change the executable, because the
default executable does work.
Ultimately your approach of fixing the test fixture would be ideal, just
wondering what the best approach for now of getting these tests to execute
consistently is. Does the EXECUTER property of GradleDistributionExecuter
need to be final? Allowing that to be overridden would make this easy
enough for my use case.
Andy Oberstar