From 4dc45a411821b9c3e816c373bb5c85623bb92d16 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Thu, 11 Nov 2021 15:18:22 +0300 Subject: [PATCH] Drop sources and javadoc artifacts for kotlin-test-wasm There's a source and javadoc validation in sonatype that once *-sources.jar or *-javadoc.jar is found expect main jar must be present as well. This doesn't work when instead of jar we publish klib. --- libraries/kotlin.test/build.gradle.kts | 7 +++++-- libraries/kotlin.test/wasm/build.gradle.kts | 7 ------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/libraries/kotlin.test/build.gradle.kts b/libraries/kotlin.test/build.gradle.kts index eb29cc71693..bf0081abe5e 100644 --- a/libraries/kotlin.test/build.gradle.kts +++ b/libraries/kotlin.test/build.gradle.kts @@ -338,6 +338,7 @@ publishing { create("main", MavenPublication::class) { from(rootComponent) artifact(combinedSourcesJar) + artifact(emptyJavadocJar) // Remove all optional dependencies from the root pom pom.withXml { val dependenciesNode = (asNode().get("dependencies") as NodeList).filterIsInstance().single() @@ -353,6 +354,7 @@ publishing { artifactId = "kotlin-test-$framework" from(components[framework]) artifact(tasks.getByPath(":kotlin-test:kotlin-test-$framework:sourcesJar") as Jar) + artifact(emptyJavadocJar) configureKotlinPomAttributes(project, "Kotlin Test Support for $framework") } } @@ -360,30 +362,31 @@ publishing { artifactId = "kotlin-test-js" from(jsComponent) artifact(tasks.getByPath(":kotlin-test:kotlin-test-js:sourcesJar") as Jar) + artifact(emptyJavadocJar) configureKotlinPomAttributes(project, "Kotlin Test for JS") } create("wasm", MavenPublication::class) { pom.packaging = "klib" artifactId = "kotlin-test-wasm" from(wasmComponent) - artifact(tasks.getByPath(":kotlin-test:kotlin-test-wasm:sourcesJar") as Jar) configureKotlinPomAttributes(project, "Kotlin Test for WASM") } create("common", MavenPublication::class) { artifactId = "kotlin-test-common" from(commonMetadataComponent) artifact(tasks.getByPath(":kotlin-test:kotlin-test-common:sourcesJar") as Jar) + artifact(emptyJavadocJar) configureKotlinPomAttributes(project, "Kotlin Test Common") } create("annotationsCommon", MavenPublication::class) { artifactId = "kotlin-test-annotations-common" from(annotationsMetadataComponent) artifact(tasks.getByPath(":kotlin-test:kotlin-test-annotations-common:sourcesJar") as Jar) + artifact(emptyJavadocJar) configureKotlinPomAttributes(project, "Kotlin Test Common") } withType { suppressAllPomMetadataWarnings() - artifact(emptyJavadocJar) } } } diff --git a/libraries/kotlin.test/wasm/build.gradle.kts b/libraries/kotlin.test/wasm/build.gradle.kts index 7fda3e050a3..a1f5dd85f18 100644 --- a/libraries/kotlin.test/wasm/build.gradle.kts +++ b/libraries/kotlin.test/wasm/build.gradle.kts @@ -45,10 +45,3 @@ tasks.named("compileKotlinWasm") { (this as KotlinCompile<*>).kotlinOptions.freeCompilerArgs += "-Xir-module-name=kotlin-test" dependsOn(commonMainSources) } - -tasks.register("sourcesJar") { - dependsOn(commonMainSources) - archiveClassifier.set("sources") - from(kotlin.sourceSets["commonMain"].kotlin) - from(kotlin.sourceSets["wasmMain"].kotlin) -}