From 49fc804d33a9cb8c93eacc9a56911027d128e55b Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Wed, 5 Mar 2025 15:36:39 -0500 Subject: [PATCH 1/2] Update publish-plugin to published signed plugin artifacts Closes #115 --- gradle/libs.versions.toml | 4 ++-- plugin/build.gradle.kts | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6fa09ab4..1815a8a2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,10 +4,10 @@ kotlin = "2.0.20" kotlin-for-gradle-plugin = "2.0.20" # Kotlin 2.1 removes support for the used language version / api version: KT-60521 kotlinx-binaryCompatibilityValidator = "0.16.2" -kotlinx-teamInfra = "0.4.0-dev-81" +kotlinx-teamInfra = "0.4.0-dev-84" squareup-kotlinpoet = "1.3.0" jmh = "1.21" -gradle-pluginPublish = "0.21.0" +gradle-pluginPublish = "1.3.1" # Note: This version can be overridden by passing `-Pmin_supported_gradle_version=` minSupportedGradle = "7.4" diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 13d641d0..d90136fb 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -52,19 +52,17 @@ repositories { } } -pluginBundle { +gradlePlugin { website = "https://github.com/Kotlin/kotlinx-benchmark" vcsUrl = "https://github.com/Kotlin/kotlinx-benchmark.git" - tags = listOf("benchmarking", "multiplatform", "kotlin") -} -gradlePlugin { plugins { register("benchmarkPlugin") { - id = "org.jetbrains.kotlinx.benchmark" + id = "io.github.fzhinkin.benchmark"//"org.jetbrains.kotlinx.benchmark" implementationClass = "kotlinx.benchmark.gradle.BenchmarksPlugin" displayName = "Gradle plugin for benchmarking" description = "Toolkit for running benchmarks for multiplatform Kotlin code." + tags.set(listOf("benchmarking", "multiplatform", "kotlin")) } } } @@ -178,6 +176,19 @@ if (project.findProperty("publication_repository") == "space") { } } +// Both kotlinx.team.infra and Gradle publish plugins register their own javadocJar artifacts. +// We remove one of them here to avoid the collision leading to a build failure. +tasks.withType().configureEach { + doFirst { + this as AbstractPublishToMaven + val artifactsSet = publication.artifacts + val javadocJars = artifactsSet.filter { it.classifier == "javadoc" }.toList() + javadocJars.drop(1).forEach { + artifactsSet.remove(it) + } + } +} + apiValidation { nonPublicMarkers += listOf("kotlinx.benchmark.gradle.internal.KotlinxBenchmarkPluginInternalApi") } From 4b7251e239ec77ee47e9fb6d71da2734fe1a25a6 Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Wed, 5 Mar 2025 15:42:19 -0500 Subject: [PATCH 2/2] fixup! Update publish-plugin to published signed plugin artifacts --- plugin/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index d90136fb..b46c4f7a 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -58,7 +58,7 @@ gradlePlugin { plugins { register("benchmarkPlugin") { - id = "io.github.fzhinkin.benchmark"//"org.jetbrains.kotlinx.benchmark" + id = "org.jetbrains.kotlinx.benchmark" implementationClass = "kotlinx.benchmark.gradle.BenchmarksPlugin" displayName = "Gradle plugin for benchmarking" description = "Toolkit for running benchmarks for multiplatform Kotlin code."