org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtensionTargetFromPresets.kt Maven / Gradle / Ivy
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.dsl
import org.gradle.api.Action
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetPreset
import org.jetbrains.kotlin.gradle.targets.android.internal.internal
internal fun KotlinMultiplatformExtension.targetFromPresetInternal(
preset: KotlinTargetPreset,
name: String = preset.name,
configure: T.() -> Unit = { },
): T = configureOrCreate(name, preset.internal, configure)
internal fun KotlinMultiplatformExtension.targetFromPresetInternal(
preset: KotlinTargetPreset,
name: String,
configure: Action,
) = targetFromPresetInternal(preset, name) { configure.execute(this) }
internal fun KotlinMultiplatformExtension.targetFromPresetInternal(preset: KotlinTargetPreset) =
targetFromPresetInternal(preset, preset.name) { }
internal fun KotlinMultiplatformExtension.targetFromPresetInternal(preset: KotlinTargetPreset, name: String) =
targetFromPresetInternal(preset, name) { }
internal fun KotlinMultiplatformExtension.targetFromPresetInternal(preset: KotlinTargetPreset, configure: Action) =
targetFromPresetInternal(preset, preset.name, configure)