This message was deleted.
# plugin-development
s
This message was deleted.
c
If you’re dealing with a recent Gradle version you may find it easier to tie your task generation to the registration of a test suite instead, that way you can do this without being forced to realize all the test tasks:
Copy code
plugins.withType<JvmTestSuitePlugin> {
  extensions.configure<TestingExtension> {
    suites.configureEach {
      tasks.register("jacoco${name.uppercase()}") {

      }
    }
  }
}
j
Thanks @Chris. I'd love to take this route, but not all of my builds have migrated to the JvmTestSuitePlugin yet.
c
Then I think you’re stuck (like many of us) with realizing all of the Test tasks as @Vampire outlined.
v
Whoops, didn't answer in thread. 😞 Moving my answer in here:
Iirc if you eagerly iterate through the test tasks using
all
instead of
configureEach
it will work, but then you are of course disturbing task configuration avoidance for those.
> Looks I get to choose between using
all
or using
afterEvaluate
. Any recommendations?
all
, because
afterEvaluate
is more evil. 🙂
2
afterEvaluate
is mostly symptom treatment. The main effect of using
afterEvaluate
is introducing timing problems, ordering problems, and race conditions.
j
That's what I figured. Thanks for the confirmation!
👌 1
e
internal
whenElementKnown()
would work (for now)