Robert Elliot
02/18/2025, 9:37 AMtestImplementation configuration on all projects, as it's too irritating having to import them every time.
Inevitably my top level `build.gradle.kts`'s dependencyAnalysis.issues.all.sourceSet("test").onUnusedDepencencies.exclude call looks basically identical to that default testImplementation configuration, otherwise buildHealth would fail a lot.
Is there a cunning way I can grab the testImplementation configuration from buildlogic.kotlin-common-conventions.gradle.kts and use it in build.gradle.kts?Vampire
02/18/2025, 5:23 PMRobert Elliot
02/18/2025, 6:42 PMyou should either not add those dependencies in the convention plugin if they are not needed everywhereThat's proving way too painful, changing an assertion, adding or removing a test frequently changes the set of kotest libs we depend on, and then the unused ones fail the buildHealth.
make the convention plugin aware of the DAGP and configure it accordinglyI'm unclear how to do that; the build-health plugin "must be applied in a settings script (or to the Settings object)", from where it adds itself to all projects, and the documentation suggests you configure it in the top level
build.gradle.kts. I don't have access to the org.gradle.api.Project.dependencyAnalysis extension DSL in the convention plugin.Vampire
02/18/2025, 6:55 PMpluginManager.withPlugin and then use configure<TheExtensionType> { ... } even without having the type-safe accessor.