[Gradle, JS] Reformat code
This commit is contained in:
+8
@@ -20,6 +20,7 @@ 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 {
|
||||||
@@ -47,6 +48,12 @@ internal val jsPresetEntry = KotlinPresetEntry(
|
|||||||
typeName("org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget")
|
typeName("org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
internal val jsIrPresetEntry = KotlinPresetEntry(
|
||||||
|
"jsIr",
|
||||||
|
typeName("$JS_IR_PACKAGE.KotlinJsIrTargetPreset"),
|
||||||
|
typeName("$JS_IR_PACKAGE.KotlinJsIrTarget")
|
||||||
|
)
|
||||||
|
|
||||||
internal val androidPresetEntry = KotlinPresetEntry(
|
internal val androidPresetEntry = KotlinPresetEntry(
|
||||||
"android",
|
"android",
|
||||||
typeName("$MPP_PACKAGE.KotlinAndroidTargetPreset"),
|
typeName("$MPP_PACKAGE.KotlinAndroidTargetPreset"),
|
||||||
@@ -77,5 +84,6 @@ internal val nativePresetEntries = HostManager().targets
|
|||||||
internal val allPresetEntries = listOf(
|
internal val allPresetEntries = listOf(
|
||||||
jvmPresetEntry,
|
jvmPresetEntry,
|
||||||
jsPresetEntry,
|
jsPresetEntry,
|
||||||
|
jsIrPresetEntry,
|
||||||
androidPresetEntry
|
androidPresetEntry
|
||||||
) + nativePresetEntries
|
) + nativePresetEntries
|
||||||
+2
-6
@@ -344,10 +344,6 @@ internal class KotlinJsIrSourceSetProcessor(
|
|||||||
|
|
||||||
registerCleanSourceMapTask()
|
registerCleanSourceMapTask()
|
||||||
|
|
||||||
if (kotlinCompilation is KotlinWithJavaCompilation<*>) {
|
|
||||||
kotlinCompilation.javaSourceSet.clearJavaSrcDirs()
|
|
||||||
}
|
|
||||||
|
|
||||||
// outputFile can be set later during the configuration phase, get it only after the phase:
|
// outputFile can be set later during the configuration phase, get it only after the phase:
|
||||||
project.runOnceAfterEvaluated("Kotlin2JsSourceSetProcessor.doTargetSpecificProcessing", kotlinTask) {
|
project.runOnceAfterEvaluated("Kotlin2JsSourceSetProcessor.doTargetSpecificProcessing", kotlinTask) {
|
||||||
val kotlinTaskInstance = kotlinTask.get()
|
val kotlinTaskInstance = kotlinTask.get()
|
||||||
@@ -377,12 +373,12 @@ internal class KotlinJsIrSourceSetProcessor(
|
|||||||
|
|
||||||
private fun registerCleanSourceMapTask() {
|
private fun registerCleanSourceMapTask() {
|
||||||
val taskName = kotlinCompilation.composeName("clean", "sourceMap")
|
val taskName = kotlinCompilation.composeName("clean", "sourceMap")
|
||||||
project.createOrRegisterTask(taskName, {
|
project.createOrRegisterTask(taskName) {
|
||||||
it.onlyIf { kotlinTask.get().kotlinOptions.sourceMap }
|
it.onlyIf { kotlinTask.get().kotlinOptions.sourceMap }
|
||||||
it.delete(object : Closure<String>(this) {
|
it.delete(object : Closure<String>(this) {
|
||||||
override fun call(): String? = (kotlinTask.get().property("outputFile") as File).canonicalPath + ".map"
|
override fun call(): String? = (kotlinTask.get().property("outputFile") as File).canonicalPath + ".map"
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
project.tasks.findByName("clean")?.dependsOn(taskName)
|
project.tasks.findByName("clean")?.dependsOn(taskName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -32,6 +32,7 @@ import org.jetbrains.kotlin.gradle.plugin.sources.checkSourceSetVisibilityRequir
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.sources.sourceSetDependencyConfigurationByScope
|
import org.jetbrains.kotlin.gradle.plugin.sources.sourceSetDependencyConfigurationByScope
|
||||||
import org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatsService
|
import org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatsService
|
||||||
import org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin
|
import org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin
|
||||||
|
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTargetPreset
|
||||||
import org.jetbrains.kotlin.gradle.targets.metadata.isKotlinGranularMetadataEnabled
|
import org.jetbrains.kotlin.gradle.targets.metadata.isKotlinGranularMetadataEnabled
|
||||||
import org.jetbrains.kotlin.gradle.utils.*
|
import org.jetbrains.kotlin.gradle.utils.*
|
||||||
import org.jetbrains.kotlin.konan.target.HostManager
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
|
|||||||
+2
-2
@@ -3,10 +3,10 @@
|
|||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
|
package org.jetbrains.kotlin.gradle.targets.js.ir
|
||||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
|
||||||
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
||||||
|
|
||||||
class KotlinJsIrCompilation(
|
class KotlinJsIrCompilation(
|
||||||
|
|||||||
-1
@@ -11,7 +11,6 @@ import org.gradle.api.plugins.JavaBasePlugin
|
|||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJsIrProjectExtension
|
import org.jetbrains.kotlin.gradle.dsl.KotlinJsIrProjectExtension
|
||||||
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
||||||
import org.jetbrains.kotlin.gradle.plugin.configureDefaultVersionsResolutionStrategy
|
import org.jetbrains.kotlin.gradle.plugin.configureDefaultVersionsResolutionStrategy
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsIrSingleTargetPreset
|
|
||||||
import org.jetbrains.kotlin.gradle.utils.checkGradleCompatibility
|
import org.jetbrains.kotlin.gradle.utils.checkGradleCompatibility
|
||||||
|
|
||||||
open class KotlinJsIrPlugin(
|
open class KotlinJsIrPlugin(
|
||||||
|
|||||||
+5
-6
@@ -3,15 +3,14 @@
|
|||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@file:Suppress("PackageDirectoryMismatch")
|
package org.jetbrains.kotlin.gradle.targets.js.ir
|
||||||
|
|
||||||
// Old package for compatibility
|
|
||||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
|
||||||
|
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTargetConfigurator
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilationFactory
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinOnlyTarget
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinOnlyTargetPreset
|
||||||
|
|
||||||
open class KotlinJsIrTargetPreset(
|
open class KotlinJsIrTargetPreset(
|
||||||
project: Project,
|
project: Project,
|
||||||
|
|||||||
Reference in New Issue
Block a user