samuel
01/23/2021, 11:06 PMsettings.gradle
that i’d like to use to short circuit the build during the initialization stage. Currently this is what i have
gradle.settingsEvaluated {
if (failConditionIsTrue) {
throw GradleException("Helpful message explaining the cause of the error")
}
}
Is there a better way to do this? possibly throw the exception as a first step in the initialization phase?Vampire
01/24/2021, 11:52 AMsettingsEvaluated
instead of just doing the check?samuel
01/24/2021, 1:42 PMsettingsEvaluated
stops build in its tracks and displays the error message in the IDEVampire
01/24/2021, 10:17 PMsettingsEvaluated
immediately, with settingsEvaluated
after the settings script was evaluated.
If you execute the build you also see the exception in the IDE either way.
If you just sync the Gradle project, you just get the warning that something happend with the first variante.
But that's an IntelliJ specific "issue".
If you want it changed, you should open an issue with JetBrains.
But as far as Gradle is concerned, my answer stands. 🙂samuel
01/24/2021, 10:52 PMVampire
01/24/2021, 11:04 PMsamuel
01/25/2021, 12:09 AM