Skip to content

Support using plugin as settings plugin #234

Description

@jjohannes

If a project does not have a buildSrc / build-logic folder, it would be good if global patching rules can be defined without that. For that, this plugin could support to be applied in settings.gradle and then offer the extraJavaModuleInfo {} extension block there.

If that is used, everything configured in the settings extension can be forwarded to the extensions in all subprojects via gradle.lifecycle.beforeProject. In a project, individual details could still be added/overridden.

Note: users can already do this today, but it is kind of ugly:

gradle.lifecycle.beforeProject {
    plugins.withId("org.gradlex.extra-java-module-info") {
        configure<ExtraJavaModuleInfoPluginExtension> {
            module("io.micrometer:micrometer-registry-otlp", "micrometer.registry.otlp")
            module("io.opentelemetry.proto:opentelemetry-proto", "io.opentelemetry.proto")
        }
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions