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
  • Loading branch information
ilgonmic authored and qodana-bot committed Mar 14, 2023
1 parent 5cf1c01 commit 7794998
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 @@ -2045,6 +2045,16 @@ open 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 @@ -32,7 +33,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 7794998

Please sign in to comment.