[Gradle, JS] Fix mpp generator
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ private fun generatePresetFunctions(
|
|||||||
): ${presetEntry.targetType.renderShort()} =
|
): ${presetEntry.targetType.renderShort()} =
|
||||||
$configureOrCreateFunctionName(
|
$configureOrCreateFunctionName(
|
||||||
name,
|
name,
|
||||||
$getPresetsExpression.getByName("$presetName") as ${presetEntry.presetType.renderErased()},
|
$getPresetsExpression.getByName("$presetName") as ${presetEntry.presetType.renderShort()},
|
||||||
configure
|
configure
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+3
-10
@@ -20,7 +20,6 @@ internal class KotlinPresetEntry(
|
|||||||
internal fun KotlinPresetEntry.typeNames(): Set<TypeName> = setOf(presetType, targetType)
|
internal fun KotlinPresetEntry.typeNames(): Set<TypeName> = setOf(presetType, targetType)
|
||||||
|
|
||||||
internal const val MPP_PACKAGE = "org.jetbrains.kotlin.gradle.plugin.mpp"
|
internal const val MPP_PACKAGE = "org.jetbrains.kotlin.gradle.plugin.mpp"
|
||||||
internal const val JS_IR_PACKAGE = "org.jetbrains.kotlin.gradle.targets.js.ir"
|
|
||||||
|
|
||||||
internal object NativeFQNames {
|
internal object NativeFQNames {
|
||||||
object Targets {
|
object Targets {
|
||||||
@@ -44,14 +43,9 @@ internal val jvmPresetEntry = KotlinPresetEntry(
|
|||||||
|
|
||||||
internal val jsPresetEntry = KotlinPresetEntry(
|
internal val jsPresetEntry = KotlinPresetEntry(
|
||||||
"js",
|
"js",
|
||||||
typeName("$MPP_PACKAGE.KotlinJsTargetPreset"),
|
// need for commonization KotlinJsTargetPreset and KotlinJsIrTargetPreser
|
||||||
typeName("org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget")
|
typeName("org.jetbrains.kotlin.gradle.plugin.KotlinTargetPreset", "org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl"),
|
||||||
)
|
typeName("org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl")
|
||||||
|
|
||||||
internal val jsIrPresetEntry = KotlinPresetEntry(
|
|
||||||
"jsIr",
|
|
||||||
typeName("$JS_IR_PACKAGE.KotlinJsIrTargetPreset"),
|
|
||||||
typeName("$JS_IR_PACKAGE.KotlinJsIrTarget")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
internal val androidPresetEntry = KotlinPresetEntry(
|
internal val androidPresetEntry = KotlinPresetEntry(
|
||||||
@@ -84,6 +78,5 @@ internal val nativePresetEntries = HostManager().targets
|
|||||||
internal val allPresetEntries = listOf(
|
internal val allPresetEntries = listOf(
|
||||||
jvmPresetEntry,
|
jvmPresetEntry,
|
||||||
jsPresetEntry,
|
jsPresetEntry,
|
||||||
jsIrPresetEntry,
|
|
||||||
androidPresetEntry
|
androidPresetEntry
|
||||||
) + nativePresetEntries
|
) + nativePresetEntries
|
||||||
-15
@@ -42,21 +42,6 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP
|
|||||||
fun js(name: String, configure: Closure<*>) = js(name) { ConfigureUtil.configure(configure, this) }
|
fun js(name: String, configure: Closure<*>) = js(name) { ConfigureUtil.configure(configure, this) }
|
||||||
fun js(configure: Closure<*>) = js { ConfigureUtil.configure(configure, this) }
|
fun js(configure: Closure<*>) = js { ConfigureUtil.configure(configure, this) }
|
||||||
|
|
||||||
// fun jsIr(
|
|
||||||
// name: String = "jsIr",
|
|
||||||
// configure: KotlinJsIrTarget.() -> Unit = { }
|
|
||||||
// ): KotlinJsIrTarget =
|
|
||||||
// configureOrCreate(
|
|
||||||
// name,
|
|
||||||
// presets.getByName("jsIr") as KotlinJsIrTargetPreset,
|
|
||||||
// configure
|
|
||||||
// )
|
|
||||||
//
|
|
||||||
// fun jsIr() = jsIr("jsIr") { }
|
|
||||||
// fun jsIr(name: String) = jsIr(name) { }
|
|
||||||
// fun jsIr(name: String, configure: Closure<*>) = jsIr(name) { ConfigureUtil.configure(configure, this) }
|
|
||||||
// fun jsIr(configure: Closure<*>) = jsIr { ConfigureUtil.configure(configure, this) }
|
|
||||||
|
|
||||||
fun android(
|
fun android(
|
||||||
name: String = "android",
|
name: String = "android",
|
||||||
configure: KotlinAndroidTarget.() -> Unit = { }
|
configure: KotlinAndroidTarget.() -> Unit = { }
|
||||||
|
|||||||
Reference in New Issue
Block a user