Improved: Use `in` and spread operator in `gradlewSubprocess`
No functional change. The idea of using the spread operator is to have less
mutation involved. In Groovy, using operator overloads like in is more idiomatic
than using explicitly the associated method.
Thanks: Mathieu Lirzin
@@ -1041,8 +1041,6 @@ def taskExistsInproject(fullyQualifiedProject, taskName) {
}
def gradlewSubprocess(commandList) {
- def gradleRunner = os.contains('windows') ? 'gradlew.bat' : './gradlew'
- def fullCommand = [gradleRunner, "--no-daemon"]
- fullCommand.addAll(commandList)
- exec { commandLine fullCommand }
+ def gradlew = os.contains('windows') ? 'gradlew.bat' : './gradlew'
+ exec { commandLine(gradlew, "--no-daemon", *commandList) }
}
\ No newline at end of file
