[Gradle] Add compiler options DSL for Kotlin targets
Restore compiler options DSL for all Kotlin targets. 'KotlinTarget' interface does not provide any common way to configuring options - this is the responsibility of related plugin extensions. From the hierarchical standpoint of view target DSL overrides options configured in the extension. ^KT-57292 In Progress
This commit is contained in:
committed by
Space Team
parent
e527781772
commit
facc9cdb58
+8
-2
@@ -5,10 +5,10 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.android
|
||||
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.NamedDomainObjectContainer
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.HasConfigurableCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.external.DecoratedExternalKotlinTarget
|
||||
@@ -17,13 +17,19 @@ data class PrototypeAndroidDsl(
|
||||
var compileSdk: Int
|
||||
)
|
||||
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
class PrototypeAndroidTarget(
|
||||
delegate: Delegate,
|
||||
val androidDsl: PrototypeAndroidDsl
|
||||
) : DecoratedExternalKotlinTarget(delegate) {
|
||||
) : DecoratedExternalKotlinTarget(delegate),
|
||||
HasConfigurableCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
internal val kotlin = super.project.extensions.getByType<KotlinMultiplatformExtension>()
|
||||
|
||||
@Suppress("unchecked_cast")
|
||||
override val compilations: NamedDomainObjectContainer<PrototypeAndroidCompilation>
|
||||
get() = super.compilations as NamedDomainObjectContainer<PrototypeAndroidCompilation>
|
||||
|
||||
@ExperimentalKotlinGradlePluginApi
|
||||
override val compilerOptions: KotlinJvmCompilerOptions
|
||||
get() = super.compilerOptions as KotlinJvmCompilerOptions
|
||||
}
|
||||
Reference in New Issue
Block a user