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