Slackbot
06/21/2022, 10:42 PMChris Lee
06/21/2022, 10:51 PMChris Lee
06/21/2022, 10:52 PMJavi
06/21/2022, 11:16 PMVampire
06/21/2022, 11:16 PMmyExtension {
configure {
...
}
}Vampire
06/21/2022, 11:17 PMconfigure is a method of your extension in which you can verify that it is only called once and in which you can do your logic after applying the given closureJavi
06/21/2022, 11:18 PMVampire
06/21/2022, 11:19 PMVampire
06/21/2022, 11:20 PMJavi
06/21/2022, 11:20 PMJavi
06/21/2022, 11:21 PMJavi
06/21/2022, 11:26 PMafterEvaluate is the only solution which can work with Groovy users without having an additional nesting?Javi
06/21/2022, 11:29 PMafterEvaluate, and that can be problematic with third party plugins I guessVampire
06/21/2022, 11:33 PMafterEvaluate is not a solution but a hack and one that will fail on you as soon as someone configures the extension in an afterEvaluate block that is evaluated after your afterEvaluate block.
The only thing afterEvaluate does, is doing symptom treatment, delaying a problem to arise later again, but that time even harder to debug.
It always introduces nasty race conditions you cannot really avoid except by not using afterEvaluate.Chris Lee
06/22/2022, 12:33 AMJohn
06/22/2022, 1:27 AMVampire
06/22/2022, 7:41 AMor do plugins.withType targeting the plugin that configures the extension, if its configured by a plugin.
If that plugin is not using
afterEvaluate in which case it would break, also if it in a later version adds afterEvaluate for some reason, so there is a risk also with this approach. :-)