I have a complex project that actually creates a new project dynamically and runs gradle on it. (The code is fairly old so there may be a better way now.)
task buildThing(type:Exec) {
workingDir = buildDir
if(isWindows) {
executable = System.getenv('COMSPEC')
args = ['/c', 'call', 'gradle', 'allRelease']
} else {
executable = 'gradle'
args = ['allRelease']
}
// Override SDK folder for building this project (we are bootstrapping the SDK itself)
environment('PRIVATE_SDK', stagingDir)
}
So when I run with gradle 2.7 on OS X I get “command ‘gradle’ not found” when it gets to this task.
With gradle 2.6 it works.
My first guess is that the environment is different and I’ve lost the ~/bin (where I have gradle symlinked to the real gradle executable) from the $PATH ?