Skip to content

nmcpSettings accessor not available in a settings convention plugin #241

@bric3

Description

@bric3

Expected and Results

I create a settings convention plugin, in order to configure nmcp over there. However, I found out that the nmcpSettings accessor to be not generated.

There is a simple workaround by using

configure<nmcp.internal.DefaultNmcpSettings> { }

But this expose the "internal" type. So I suppose this could be a bug.

Related environment and versions

Gradle 9.2.1, nmcp 1.4.3

Reproduction steps

Here's what I wrote:

./build-settings/src/main/kotlin/fireplace.central-publication.settings.gradle.kts

plugins {
    id("com.gradleup.nmcp.settings")
}

configure<nmcp.internal.DefaultNmcpSettings>() {
    centralPortal {
        username.set(providers.gradleProperty("mavenCentralUsername"))
        //...
    }
}

./gradle/libs.versions.toml

[versions]
nmcp = "1.4.3"

[libraries]
gradlePlugin-nmcp = { module = "com.gradleup.nmcp:nmcp", version.ref = "nmcp" }

`./build-settings/build.gradle.kts

plugins {
    `kotlin-dsl`
}

repositories {
    gradlePluginPortal()
    mavenCentral()
}

dependencies {
    implementation(libs.gradlePlugin.nmcp)
}

./build-settings/settings.gradle.kts

pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
}

rootProject.name = "build-settings"

dependencyResolutionManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
    versionCatalogs {
        create("libs") {
            from(files("../gradle/libs.versions.toml"))
        }
    }
}

`./settings.gradle.kts

pluginManagement {
    includeBuild("build-settings")
}

plugins {
    id("fireplace.central-publication")
}

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions