This message was deleted.
# community-support
s
This message was deleted.
a
Will
:modulea:moduleb
inherit plugins in the parent module
:modulea
?
If using the plugins DSL, then no, plugins aren't 'inherited' from parent modules. Plugins are only 'inherited' if using `subprojects {}`/`allprojects {}` (or some other funky way which Gradle probably allows), which is why `subprojects {}`/`allprojects {}` is discouraged.
c
hmm I wonder if the plugin I'm adding is walking the project tree and adding it's tasks in every project it finds below the project I applied the plugin to then
a
If so, how can I apply a plugin only if it hasn't already been applied
If using the plugins DSL, it's not possible to apply a plugin twice afaik
hmm I wonder if the plugin I'm adding is walking the project tree and adding it's tasks in every project it finds below the project I applied the plugin to then
that's possible 😬. A lot of Gradle plugins aren't good citizens.
c
I'm using https://github.com/Kotlin/binary-compatibility-validator and I've added the plugin to modulea and when I add to moduleb it complains that the apiBuild/Check/Dump tasks have already been registered
well... fiddlesticks
a
that's why I re-wrote BCV to be compatible 😁 https://github.com/adamko-dev/kotlin-binary-compatibility-validator-mu
c
how fortuitous this meeting has been 😂
a
BCV-classic does have an option for excluding subprojects though, which isn't great, but it'll be a quick fix for your problem
Copy code
apiValidation {
    /**
     * Sub-projects that are excluded from API validation
     */
    ignoredProjects.addAll(listOf("benchmarks", "examples"))
}
c
oh blimey
can I get a list of subprojects from a
project
instance at least?
trying to do this using conventions as best as i can
a
yeah, it's 'allowed' to use
subprojects
to get a list of subprojects
it's just not 'allowed' for one subproject to affect the configuration (e.g. apply a plugin, modify a task) of another subproject
c
for exactly this reason I bet
cheers Adam, that little snippet seems to have been the duct tape being slapped right over my leak
a
nice!
v
If using the plugins DSL, it's not possible to apply a plugin twice afaik
Just scratch the first half of the sentence. 🙂 Plugins are never applied multiple times, no matter how you apply them. If you try to apply a plugin in any way that is already applied, it is a no-op.