logging-capabilities
logging-capabilities copied to clipboard
Make plugin compatible with component metadata rules declared in settings.gradle
Currently, the plugin declares component metadata rules in the project, making it impossible to declare other rules in the settings.
I think the plugin should be split to have the alignment rules in a settings plugin (actually, a plugin that could be applied either to a project or the settings, so projets that prefer project-level component metadata rules or have other plugins doing the same –or just because they want to leverage version catalogs and that cannot be done for settings plugins :chicken::egg:– can continue using them).
Or maybe the plugin could detect if it's also been applied to the settings (not sure if it's possible though) so it can conditionally add the rules to the project?
Or maybe the plugin could detect when it's applied to the settings and automatically inject the extension into all projects, so it could be applied to either (but not both), and wouldn't need to be split?
Or just make it applicable to either settings (without registering the extension) and projects, and declare component rules in both cases? but that would make it incompatible with rulesMode FAIL_ON_PROJECT_RULES
, and would warn for any other rulesMode.
Thanks for that report and it is a good point. I'll have to think a bit about the best approach for this one.
Fwiw, working on it at https://github.com/tbroyer/logging-capabilities/tree/settings-plugin
I am going to close this as obsolete. With the move to the jvm-dependency-conflict-resolution plugin, rules defined in settings are an option.