[Gradle, JS] Configure compiler args for produceKotlinLibrary in IR
This commit is contained in:
+2
@@ -76,6 +76,8 @@ interface KotlinJsIrSubTargetDsl {
|
||||
}
|
||||
}
|
||||
|
||||
fun produceKotlinLibrary()
|
||||
|
||||
val testRuns: NamedDomainObjectContainer<KotlinJsIrPlatformTestRun>
|
||||
}
|
||||
|
||||
|
||||
+18
@@ -49,6 +49,24 @@ abstract class KotlinJsIrSubTarget(
|
||||
}
|
||||
}
|
||||
|
||||
override fun produceKotlinLibrary() {
|
||||
target.compilations
|
||||
.matching { it.name == KotlinCompilation.TEST_COMPILATION_NAME }
|
||||
.all {
|
||||
it.kotlinOptions {
|
||||
freeCompilerArgs += listOf("-Xir-produce-klib-dir", "-Xir-produce-js")
|
||||
}
|
||||
}
|
||||
|
||||
target.compilations
|
||||
.matching { it.name == KotlinCompilation.MAIN_COMPILATION_NAME }
|
||||
.all {
|
||||
it.kotlinOptions {
|
||||
freeCompilerArgs += listOf("-Xir-produce-klib-dir")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun testTask(body: KotlinJsTest.() -> Unit) {
|
||||
testRuns.getByName(KotlinTargetWithTests.DEFAULT_TEST_RUN_NAME).executionTask.configure(body)
|
||||
}
|
||||
|
||||
+2
@@ -57,6 +57,8 @@ open class KotlinJsIrTargetConfigurator(kotlinPluginVersion: String) :
|
||||
moduleKind = "umd"
|
||||
sourceMap = true
|
||||
sourceMapEmbedSources = null
|
||||
|
||||
freeCompilerArgs += listOf("-Xir-only")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user