Hi all,

I was wondering if I have found a problem, or if it is my own which is the
problem.

On linux, I was testing my gradle code, and all worked.
Now I am running it in production, but (unfortunately) on windows, and it
doesn't seem to work.

The code calls a gradle script from another gradle script, and uses the exit
value to determine which action to perform.
However, on windows, even though there was an error (and on linux, the
called gradle script would return non-zero)
the return value is '0'.
Is this because on windows, the gradle.bat batch file is used? Is this
somehow different ?

thanks for any insight!

sean

moduleLogFile = new File("${antBuildReportRoot}/moduleBuildProcess.log")
println "Creating log file " + moduleLogFile.getAbsolutePath()
 println "Starting build of modules"
if (moduleLogFile.isFile())
 moduleLogFile.delete()
moduleLogFile.createNewFile()
 def moduleBuildResult
new FileOutputStream(moduleLogFile).withStream { os ->
 moduleBuildResult = exec {
executable = 'gradle.bat'
args = ['build',
 "-p="+root.getAbsolutePath(),
]
standardOutput = os
 errorOutput = os
ignoreExitValue = true
}
 os.close()
}
 println "Exit value for module build is: " +
moduleBuildResult.getExitValue()
 if (moduleBuildResult.getExitValue()==0)
{
getByName('aggregateModuleTests').execute()
 getByName('distributeProducts').execute()
getByName('notifyOfModuleBuildSuccess').execute()
 }
else
{
 println "Error! The module build has NOT been successful. Distributions and
consolidated reports will not be made!"
getByName('notifyOfModuleErrors').execute()
 }

Reply via email to