Niels Doucet
07/29/2024, 12:35 PMgradle module
\-- convention plugin
\-- in-house published plugin
\-- helm plugin
See thread for more detail.Niels Doucet
07/29/2024, 12:35 PM/**
* Configures the `helm` extension.
*
* `helm` is not accessible in a type safe way because:
* - `com.citi.gradle.plugins.helm.dsl.HelmExtension` is not available
*/
internal
fun org.gradle.api.Project.`helm`(configure: Action<Any>): Unit =
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("helm", configure)Niels Doucet
07/29/2024, 12:36 PMimplementation to api, but that didn't seem to make the extension available. Or perhaps I have to force the regeneration of the accessor somehow?Niels Doucet
07/29/2024, 12:45 PMoverride fun apply(project: Project) {
project.apply<HelmPlugin>()Niels Doucet
07/29/2024, 12:47 PMVampire
07/29/2024, 6:05 PMI suppose it's because of how the helm plugin is applied by our in-house plugin:No, that should be fine. And if that were the issue, you would not have any accessor at all. But you have the accessor, just not typed.
implementation vs. api should not be important I think, because this distinction is when you compile something against the in-house plugin.
But here you use the in-house plugin, so the runtime classpath is the relevant thing.
Why your accessor is untyped I don't know just from this snippet.
I've seen such a situation exactly once before.
In https://github.com/gradle/gradle/issues/27979 where a plugin was added to init script classpath and applied to root project.
Then in the root project you had the accessor for the extension, but as the plugin was only present in the init script classloader which is not a parent of the root project classloader, the extension was untyped like in your case.
But why it happens in your exact case is hard to tell without an MCVE.Niels Doucet
07/30/2024, 11:41 AM