Declare a task's outputs, enabling incremental build and caching
This specific task runs an external command, and we consider the task successful if that command exits without error. We don't actually examine the stdout or stderr of the command being run. However, it is still useful to log the stdout and stderr to a file, and to declare that file to be the output of the task. Otherwise, the task has no declared outputs at all. A task with no outputs is ineligible for caching and is always considered to be out-of-date. squash! Declare a task's outputs, enabling incremental build and caching
This commit is contained in:
parent
e0ad8fd9f7
commit
a7cef8e77a
|
@ -111,6 +111,15 @@ model {
|
|||
|
||||
// all combined as a colon-delimited path list
|
||||
args pathElements.join(':')
|
||||
|
||||
// log output to file, although we don't validate it
|
||||
final def outFile = file("$temporaryDir/stdout-and-stderr.log")
|
||||
outputs.file outFile
|
||||
doFirst {
|
||||
final def fileStream = new FileOutputStream(outFile)
|
||||
standardOutput fileStream
|
||||
errorOutput fileStream
|
||||
}
|
||||
}
|
||||
|
||||
check.dependsOn checkSmoke_main
|
||||
|
|
Loading…
Reference in New Issue