This message was deleted.
# general
s
This message was deleted.
j
You can use Gradle properties and/or plugin extensions like a normal plugin
j
@Javi what do you mean by “plugin extensions” So if I apply in one of my modules
Copy code
plugins {
    id 'my.convention.plugin'
}
How can I then use the plugin extensions? I assume I can in some way use something like
Copy code
MyConventionPlugin {
// set some properties on the plugin here
}
(it is also ok to point to the documentation, I could not find it)
j
you can create extensions like in normal plugins, not sure if there are docs about extensions in precompiled plugins tho
j
I was looking at that page, but as far as I can see, they do not suggest the possibility of using extensions together with script / precompiled plugins in buildSrc
g
Just create extension class not in script plugin itself (like in
buildSrc/src/main/kotlin/MyExtension.kt
) and create it using
project.extensions.create("myExtension", MyExtension::class)
as usual. All classes defined in precompiled script plugin are scoped to that plugin, iirc. So you need separate class and not precompiled script.
2
j
I will try that, tnx