Skip to content

Commit e9becb5

Browse files
authored
Update publish-plugin to published signed plugin artifacts (#295)
Closes #115
1 parent 6b14c81 commit e9becb5

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ kotlinx-binaryCompatibilityValidator = "0.16.2"
77
kotlinx-teamInfra = "0.4.0-dev-85"
88
squareup-kotlinpoet = "1.3.0"
99
jmh = "1.37"
10-
gradle-pluginPublish = "0.21.0"
10+
gradle-pluginPublish = "1.3.1"
1111

1212
# Note: This version can be overridden by passing `-Pmin_supported_gradle_version=<version>`
1313
minSupportedGradle = "7.4"

plugin/build.gradle.kts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,17 @@ repositories {
5252
}
5353
}
5454

55-
pluginBundle {
55+
gradlePlugin {
5656
website = "https://github.com/Kotlin/kotlinx-benchmark"
5757
vcsUrl = "https://github.com/Kotlin/kotlinx-benchmark.git"
58-
tags = listOf("benchmarking", "multiplatform", "kotlin")
59-
}
6058

61-
gradlePlugin {
6259
plugins {
6360
register("benchmarkPlugin") {
6461
id = "org.jetbrains.kotlinx.benchmark"
6562
implementationClass = "kotlinx.benchmark.gradle.BenchmarksPlugin"
6663
displayName = "Gradle plugin for benchmarking"
6764
description = "Toolkit for running benchmarks for multiplatform Kotlin code."
65+
tags.set(listOf("benchmarking", "multiplatform", "kotlin"))
6866
}
6967
}
7068
}
@@ -182,6 +180,19 @@ if (project.findProperty("publication_repository") == "space") {
182180
}
183181
}
184182

183+
// Both kotlinx.team.infra and Gradle publish plugins register their own javadocJar artifacts.
184+
// We remove one of them here to avoid the collision leading to a build failure.
185+
tasks.withType<AbstractPublishToMaven>().configureEach {
186+
doFirst {
187+
this as AbstractPublishToMaven
188+
val artifactsSet = publication.artifacts
189+
val javadocJars = artifactsSet.filter { it.classifier == "javadoc" }.toList()
190+
javadocJars.drop(1).forEach {
191+
artifactsSet.remove(it)
192+
}
193+
}
194+
}
195+
185196
apiValidation {
186197
nonPublicMarkers += listOf("kotlinx.benchmark.gradle.internal.KotlinxBenchmarkPluginInternalApi")
187198
}

0 commit comments

Comments
 (0)