Slackbot
07/12/2022, 1:54 PMephemient
07/12/2022, 5:24 PMignoreExitValue property on Exec and JavaExec tasks (such as run). but I think it won't be passed on to the callerephemient
07/12/2022, 5:26 PMapplication plugin, try ./gradlew :myscript:install && myscript/build/install/myscript/bin/myscript "$@" - this runs the program outside of GradleBerik Visschers
07/12/2022, 8:31 PMtasks.withType<Exec>().forEach {
it.isIgnoreExitValue = true
}
Adjusting the launcher script did the trick:
# shellcheck disable=SC2086
# shellcheck disable=SC2048
./gradlew :myscrip:install -q && ./build/install/myscript/bin/myscript $*
Looking at these options, I think the launcher script adjustment makes a lot of sense. Just for reference, did I make a mistake in the gradle.build.kts adjustment?ephemient
07/12/2022, 8:57 PMtasks.run {
isIgnoreExitValue = true
}
1. run is JavaExec, not Exec
2. use configureEach to maintain lazy configuration… but better yet, only configure the specific task
but the script approach is probably better for you anyway, because Gradle will still exit with success when the process exits with failure with ignoreExitValue, so the caller won't see it