[Gradle, JS] Fix names for js compiler property
This commit is contained in:
+4
-4
@@ -74,7 +74,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
fun testLibAndAppJsIr() = doTestLibAndApp(
|
||||
"sample-lib",
|
||||
"sample-app",
|
||||
JsCompilerType.klib
|
||||
JsCompilerType.ir
|
||||
)
|
||||
|
||||
@Test
|
||||
@@ -95,7 +95,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
fun testLibAndAppWithGradleKotlinDslJsIr() = doTestLibAndApp(
|
||||
"sample-lib-gradle-kotlin-dsl",
|
||||
"sample-app-gradle-kotlin-dsl",
|
||||
JsCompilerType.klib
|
||||
JsCompilerType.ir
|
||||
)
|
||||
|
||||
@Test
|
||||
@@ -165,7 +165,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
Assert.assertTrue("function expectedFun(" in compiledJs)
|
||||
Assert.assertTrue("function main(" in compiledJs)
|
||||
}
|
||||
JsCompilerType.klib -> {
|
||||
JsCompilerType.ir -> {
|
||||
groupDir.resolve(jsJarName).exists()
|
||||
}
|
||||
}
|
||||
@@ -251,7 +251,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
if (jsCompilerType == JsCompilerType.both) {
|
||||
listOf(
|
||||
JsCompilerType.legacy,
|
||||
JsCompilerType.klib
|
||||
JsCompilerType.ir
|
||||
).forEach {
|
||||
build(
|
||||
"assemble",
|
||||
|
||||
+3
-3
@@ -21,7 +21,7 @@ class WorkersIT : BaseGradleIT() {
|
||||
fun testParallelTasksJsIr() {
|
||||
parallelTasksImpl(
|
||||
isParallel = true,
|
||||
jsCompilerType = JsCompilerType.klib
|
||||
jsCompilerType = JsCompilerType.ir
|
||||
)
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class WorkersIT : BaseGradleIT() {
|
||||
fun testNoParallelTasksJsIr() {
|
||||
parallelTasksImpl(
|
||||
isParallel = false,
|
||||
jsCompilerType = JsCompilerType.klib
|
||||
jsCompilerType = JsCompilerType.ir
|
||||
)
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class WorkersIT : BaseGradleIT() {
|
||||
kotlinClassesDir(sourceSet = "metadata/main") + "common/A.kotlin_metadata",
|
||||
kotlinClassesDir(sourceSet = "jvm/main") + "common/A.class",
|
||||
kotlinClassesDir(sourceSet = "js/main") +
|
||||
if (jsCompilerType == JsCompilerType.klib) "default/manifest" else "new-mpp-parallel.js"
|
||||
if (jsCompilerType == JsCompilerType.ir) "default/manifest" else "new-mpp-parallel.js"
|
||||
)
|
||||
expectedKotlinOutputFiles.forEach { assertFileExists(it) }
|
||||
assertSubstringCount("Loaded GradleKotlinCompilerWork", 1)
|
||||
|
||||
+2
-2
@@ -168,7 +168,7 @@ open class KotlinJsPluginWrapper @Inject constructor(
|
||||
val propertiesProvider = PropertiesProvider(project)
|
||||
|
||||
return when (propertiesProvider.jsCompiler) {
|
||||
JsCompilerType.klib -> KotlinJsIrPlugin(kotlinPluginVersion)
|
||||
JsCompilerType.ir -> KotlinJsIrPlugin(kotlinPluginVersion)
|
||||
JsCompilerType.legacy -> KotlinJsPlugin(kotlinPluginVersion, false)
|
||||
JsCompilerType.both -> KotlinJsPlugin(kotlinPluginVersion, true)
|
||||
}
|
||||
@@ -180,7 +180,7 @@ open class KotlinJsPluginWrapper @Inject constructor(
|
||||
val propertiesProvider = PropertiesProvider(project)
|
||||
|
||||
projectExtensionClass = when (propertiesProvider.jsCompiler) {
|
||||
JsCompilerType.klib -> KotlinJsIrProjectExtension::class
|
||||
JsCompilerType.ir -> KotlinJsIrProjectExtension::class
|
||||
JsCompilerType.legacy, JsCompilerType.both -> KotlinJsProjectExtension::class
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
||||
* Use Kotlin/JS backend mode
|
||||
*/
|
||||
val jsCompiler: JsCompilerType
|
||||
get() = property(jsCompilerProperty)?.let { JsCompilerType.byArgument(it) } ?: JsCompilerType.klib
|
||||
get() = property(jsCompilerProperty)?.let { JsCompilerType.byArgument(it) } ?: JsCompilerType.ir
|
||||
|
||||
private fun propertyWithDeprecatedVariant(propName: String, deprecatedPropName: String): String? {
|
||||
val deprecatedProperty = property(deprecatedPropName)
|
||||
|
||||
+1
-1
@@ -453,7 +453,7 @@ fun Configuration.usesPlatformOf(target: KotlinTarget): Configuration {
|
||||
}
|
||||
|
||||
if (target is KotlinJsIrTarget) {
|
||||
attributes.attribute(KotlinJsTarget.jsCompilerAttribute, JsCompilerType.klib)
|
||||
attributes.attribute(KotlinJsTarget.jsCompilerAttribute, JsCompilerType.ir)
|
||||
}
|
||||
|
||||
// TODO: Provide an universal way to copy attributes from the target.
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ class KotlinMultiplatformPlugin(
|
||||
add(KotlinJvmTargetPreset(project, kotlinPluginVersion))
|
||||
when (propertiesProvider.jsCompiler) {
|
||||
JsCompilerType.legacy -> add(KotlinJsTargetPreset(project, kotlinPluginVersion, null))
|
||||
JsCompilerType.klib -> add(KotlinJsIrTargetPreset(project, kotlinPluginVersion, false))
|
||||
JsCompilerType.ir -> add(KotlinJsIrTargetPreset(project, kotlinPluginVersion, false))
|
||||
JsCompilerType.both -> add(
|
||||
KotlinJsTargetPreset(
|
||||
project,
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import java.io.Serializable
|
||||
@Suppress("EnumEntryName")
|
||||
enum class JsCompilerType : Named, Serializable {
|
||||
legacy,
|
||||
klib,
|
||||
ir,
|
||||
both;
|
||||
|
||||
override fun getName(): String =
|
||||
|
||||
Reference in New Issue
Block a user