[Gradle, JS] Add test with packaged moduleName
[Gradle, JS] WA for moduleName starting with @ ^KT-53288 fixed
This commit is contained in:
committed by
Space Team
parent
c8b6e57c4d
commit
256764f012
+11
@@ -388,6 +388,17 @@ class Kotlin2JsIrGradlePluginIT : AbstractKotlin2JsGradlePluginIT(true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@DisplayName("Kotlin/JS project with module name starting with package")
|
||||
@GradleTest
|
||||
fun testKotlinJsPackageModuleName(gradleVersion: GradleVersion) {
|
||||
project("kotlin-js-package-module-name", gradleVersion) {
|
||||
build("assemble") {
|
||||
assertFileInProjectExists("build/distributions/kotlin-js-package-module-name.js")
|
||||
assertFileInProjectExists("build/js/packages/@foo/bar/kotlin/@foo/bar.js")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JsGradlePluginTests
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
js {
|
||||
moduleName = "@foo/bar"
|
||||
browser {
|
||||
}
|
||||
binaries.executable()
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
expect fun foo(): Int
|
||||
+1
@@ -0,0 +1 @@
|
||||
actual fun foo(): Int = 1
|
||||
+7
@@ -104,6 +104,13 @@ abstract class KotlinJsIrLink @Inject constructor(
|
||||
KotlinBuildStatsService.applyIfInitialised {
|
||||
it.report(BooleanMetrics.JS_IR_INCREMENTAL, incrementalJsIr)
|
||||
val newArgs = K2JSCompilerArguments()
|
||||
// moduleName can start with @ for group of NPM packages
|
||||
// but args parsing @ as start of argfile
|
||||
// so WA we provide moduleName as one parameter
|
||||
if (args.moduleName != null) {
|
||||
args.freeArgs += "-ir-output-name=${args.moduleName}"
|
||||
args.moduleName = null
|
||||
}
|
||||
parseCommandLineArguments(ArgumentUtils.convertArgumentsToStringList(args), newArgs)
|
||||
it.report(
|
||||
StringMetrics.JS_OUTPUT_GRANULARITY,
|
||||
|
||||
Reference in New Issue
Block a user