Skip to content

Commit

Permalink
[Wasm] Publish kotlin-test-wasm to maven
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-laevsky authored and teamcity committed Nov 10, 2021
1 parent 6e15ee8 commit 5b9268a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
17 changes: 14 additions & 3 deletions libraries/kotlin.test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,13 @@ dependencies {
}

artifacts {
val wasmJar = tasks.getByPath(":kotlin-test:kotlin-test-wasm:wasmJar")
add(wasmApi.name, wasmJar)
add(wasmRuntime.name, wasmJar)
val wasmKlib = tasks.getByPath(":kotlin-test:kotlin-test-wasm:wasmJar")
add(wasmApi.name, wasmKlib) {
extension = "klib"
}
add(wasmRuntime.name, wasmKlib) {
extension = "klib"
}
}

val wasmComponent = componentFactory.adhoc("wasm").apply {
Expand Down Expand Up @@ -358,6 +362,13 @@ publishing {
artifact(tasks.getByPath(":kotlin-test:kotlin-test-js:sourcesJar") as Jar)
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)
Expand Down
12 changes: 7 additions & 5 deletions libraries/kotlin.test/wasm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/

import org.jetbrains.kotlin.gradle.dsl.KotlinCompile

plugins {
Expand Down Expand Up @@ -50,3 +45,10 @@ tasks.named("compileKotlinWasm") {
(this as KotlinCompile<*>).kotlinOptions.freeCompilerArgs += "-Xir-module-name=kotlin-test"
dependsOn(commonMainSources)
}

tasks.register<Jar>("sourcesJar") {
dependsOn(commonMainSources)
archiveClassifier.set("sources")
from(kotlin.sourceSets["commonMain"].kotlin)
from(kotlin.sourceSets["wasmMain"].kotlin)
}

0 comments on commit 5b9268a

Please sign in to comment.