Executing the following task, within a subproject, …
task makeTree(type: Exec) {
//environment taskEnv
workingDir rootProject.getProjectDir()
commandLine perlExec + args
}
Fails, as expected, because the script being called requires specific environment settings.
$ gradlew makeTree
:oldBuildscripts:makeTree
executing set
system(set)=-1
:oldBuildscripts:makeTree FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':oldBuildscripts:makeTree'.
> Process 'command 'cmd'' finished with non-zero exit value 69
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.369 secs
However, when providing the environment for this task, gradlew hangs, indefinitely.
Code:
task makeTree(type: Exec) {
environment taskEnv
workingDir rootProject.getProjectDir()
commandLine perlExec + args
}
Result:
$ gradlew makeTree
> Building > :oldBuildscripts:makeTree
...have to Ctrl-C out of it...
The task is specific to Windows, so I’ve only reproduced this on two different Windows 7 machines, both using the gradle 1.9 wrapper. One with JDK 1.7 and the other with JDK 1.6.
I also verified that I’m setting the environment property, correctly, by passing the current environment:
environment System.getenv()
and the task executes, as expected. So, there is something wrong with the environment map, which I’m passing in, that seems to get gradle (or something deeper) into a bad state. Any ideas? Should I debug deeper?