Skip to content

Commit

Permalink
[Gradle, JS] Use JAR archive task type for js ir
Browse files Browse the repository at this point in the history
(cherry picked from commit 7794998)

^KT-57285 fixed
  • Loading branch information
ilgonmic authored and qodana-bot committed Mar 15, 2023
1 parent a7e5906 commit 82904fe
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,16 @@ class NewMultiplatformIT : BaseGradleIT() {
}
}

@Test
fun testPublishEmptySourceSets() = with(Project("mpp-empty-sources")) {
setupWorkingDir()
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)

build("publish") {
assertSuccessful()
}
}

private fun detectNativeEnabledCompilation(): String = when {
HostManager.hostIsLinux -> "linuxX64"
HostManager.hostIsMingw -> "mingwX64"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
plugins {
kotlin("multiplatform") version "<pluginMarkerVersion>"
`maven-publish`
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
mavenLocal()
}

kotlin {
jvm {
jvmToolchain(8)
withJava()
}
js(IR) {
binaries.executable()
browser {
}
}
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["kotlin"])
}
}
repositories {
maven { setUrl("${rootProject.buildDir}/repo") }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.gradle.targets.js.ir

import org.gradle.api.attributes.Usage
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.bundling.Zip
import org.jetbrains.kotlin.gradle.dsl.JsModuleKind
import org.jetbrains.kotlin.gradle.dsl.JsSourceMapEmbedMode
Expand All @@ -29,7 +30,7 @@ open class KotlinJsIrTargetConfigurator() :
get() = KLIB_TYPE

override val archiveTaskType: Class<out Zip>
get() = Zip::class.java
get() = Jar::class.java

override fun createTestRun(
name: String,
Expand Down

0 comments on commit 82904fe

Please sign in to comment.