Slackbot
08/22/2023, 8:45 AMAdam
08/22/2023, 8:51 AMWillIf 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.inherit plugins in the parent module:modulea:moduleb?:modulea
Chris Sawczuk
08/22/2023, 8:52 AMAdam
08/22/2023, 8:52 AMIf so, how can I apply a plugin only if it hasn't already been appliedIf using the plugins DSL, it's not possible to apply a plugin twice afaik
Adam
08/22/2023, 8:53 AMhmm 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 thenthat's possible 😬. A lot of Gradle plugins aren't good citizens.
Chris Sawczuk
08/22/2023, 8:53 AMChris Sawczuk
08/22/2023, 8:53 AMAdam
08/22/2023, 8:54 AMAdam
08/22/2023, 8:55 AMChris Sawczuk
08/22/2023, 8:55 AMAdam
08/22/2023, 8:57 AMapiValidation {
/**
* Sub-projects that are excluded from API validation
*/
ignoredProjects.addAll(listOf("benchmarks", "examples"))
}Chris Sawczuk
08/22/2023, 8:57 AMChris Sawczuk
08/22/2023, 8:57 AMproject instance at least?Chris Sawczuk
08/22/2023, 8:57 AMAdam
08/22/2023, 8:58 AMsubprojects to get a list of subprojectsAdam
08/22/2023, 8:58 AMChris Sawczuk
08/22/2023, 9:01 AMChris Sawczuk
08/22/2023, 9:01 AMAdam
08/22/2023, 9:05 AMVampire
08/22/2023, 9:56 AMIf using the plugins DSL, it's not possible to apply a plugin twice afaikJust 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.