[Gradle, JS] Extract JS presets container, no js in codegen since now
This commit is contained in:
+5
-10
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.generators.gradle.dsl
|
||||
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.util.ConfigureUtil
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerTypeHolder
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetsContainerWithPresets
|
||||
import java.io.File
|
||||
|
||||
@@ -15,10 +14,7 @@ fun main() {
|
||||
generateKotlinTargetContainerWithPresetFunctionsInterface()
|
||||
}
|
||||
|
||||
private val parentInterfaces = listOf(
|
||||
KotlinTargetsContainerWithPresets::class,
|
||||
KotlinJsCompilerTypeHolder::class
|
||||
)
|
||||
private val parentInterface = KotlinTargetsContainerWithPresets::class
|
||||
|
||||
private val presetsProperty = KotlinTargetsContainerWithPresets::presets.name
|
||||
|
||||
@@ -28,16 +24,15 @@ private fun generateKotlinTargetContainerWithPresetFunctionsInterface() {
|
||||
generatePresetFunctions(it, presetsProperty, "configureOrCreate")
|
||||
}
|
||||
|
||||
val parentInterfaceNames =
|
||||
parentInterfaces.map { typeName(it.java.canonicalName) }
|
||||
|
||||
val parentInterfaceName =
|
||||
typeName(parentInterface.java.canonicalName)
|
||||
|
||||
val className =
|
||||
typeName("org.jetbrains.kotlin.gradle.dsl.KotlinTargetContainerWithPresetFunctions")
|
||||
|
||||
val imports = allPresetEntries
|
||||
.flatMap { it.typeNames() }
|
||||
.plus(parentInterfaceNames)
|
||||
.plus(parentInterfaceName)
|
||||
.plus(typeName(ConfigureUtil::class.java.canonicalName))
|
||||
.plus(typeName(Closure::class.java.canonicalName))
|
||||
.filter { it.packageName() != className.packageName() }
|
||||
@@ -51,7 +46,7 @@ private fun generateKotlinTargetContainerWithPresetFunctionsInterface() {
|
||||
"package ${className.packageName()}",
|
||||
imports,
|
||||
generatedCodeWarning,
|
||||
"interface ${className.renderShort()} : ${parentInterfaceNames.joinToString { it.renderShort() }} {",
|
||||
"interface ${className.renderShort()} : ${parentInterfaceName.renderShort()} {",
|
||||
functions.joinToString("\n\n") { it.indented(4) },
|
||||
"}"
|
||||
).joinToString("\n\n")
|
||||
|
||||
+1
-4
@@ -2,16 +2,13 @@ package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.util.ConfigureUtil
|
||||
import org.jetbrains.kotlin.gradle.plugin.JsCompilerType
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerTypeHolder
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetPreset
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetsContainerWithPresets
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
||||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
||||
|
||||
// DO NOT EDIT MANUALLY! Generated by org.jetbrains.kotlin.generators.gradle.dsl.MppPresetFunctionsCodegenKt
|
||||
|
||||
interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithPresets, KotlinJsCompilerTypeHolder {
|
||||
interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithPresets {
|
||||
|
||||
fun jvm(
|
||||
name: String = "jvm",
|
||||
|
||||
Reference in New Issue
Block a user