From d7dc3ddfafd127527f7b6c33aa39da3dd2af03b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 22 Jul 2023 11:36:45 +0100 Subject: [PATCH 1/3] Make the artifact ID explicit rather than relying on implicit naming. This allows naming the rootProject whatever we want. Improving developer experience in IDE for example. --- build.gradle.kts | 2 +- settings.gradle.kts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d2815a54..d40d9b83 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -266,6 +266,7 @@ publishing { publications { afterEvaluate { named("pluginMaven") { + artifactId = "publish-plugin" pom { name = readableName description = project.description @@ -292,4 +293,3 @@ publishing { } } } - diff --git a/settings.gradle.kts b/settings.gradle.kts index 311e0eea..6321f571 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,6 +13,4 @@ gradleEnterprise { } } -// this needs to stay this way since it's used as the plugin's artifact id -// for generating the plugin marker -rootProject.name = "publish-plugin" +rootProject.name = "gradle-nexus-publish-plugin" From 2b2013eaa440e207846710390c3c3fac52d3c6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 22 Jul 2023 11:55:20 +0100 Subject: [PATCH 2/3] Set module name explicitly --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index d40d9b83..2ab7d98e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -171,6 +171,7 @@ kotlin.target.compilations.configureEach { val usedKotlinVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_3 compilerOptions.configure { + if (this@configureEach.name == "main") moduleName = "publish-plugin" // Gradle fully supports running on Java 8: https://docs.gradle.org/current/userguide/compatibility.html, // so we should allow users to do that too. jvmTarget = JvmTarget.fromTarget(JavaVersion.VERSION_1_8.toString()) From 9cf2bb68a434d21f1ffcdbd731864194b08057cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 22 Jul 2023 11:58:40 +0100 Subject: [PATCH 3/3] Set everything based on a central value. --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2ab7d98e..d2c0ad12 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,7 @@ plugins { id("org.ajoberstar.stutter") version "0.7.2" } +base { archivesName = "publish-plugin" } group = "io.github.gradle-nexus" version = "2.0.0-SNAPSHOT" @@ -171,7 +172,6 @@ kotlin.target.compilations.configureEach { val usedKotlinVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_3 compilerOptions.configure { - if (this@configureEach.name == "main") moduleName = "publish-plugin" // Gradle fully supports running on Java 8: https://docs.gradle.org/current/userguide/compatibility.html, // so we should allow users to do that too. jvmTarget = JvmTarget.fromTarget(JavaVersion.VERSION_1_8.toString()) @@ -267,7 +267,7 @@ publishing { publications { afterEvaluate { named("pluginMaven") { - artifactId = "publish-plugin" + artifactId = base.archivesName.get() pom { name = readableName description = project.description