[Gradle] Introduce HasConfigurableCompilerOptions DSL interface
This interface should be attached to the KGP DSL entities that want to provide an ability to configure Kotlin compiler options. ^KT-60733 In Progress
This commit is contained in:
committed by
Space Team
parent
58fd558308
commit
e527781772
@@ -8,6 +8,17 @@ public final class org/jetbrains/kotlin/gradle/dsl/ExplicitApiMode : java/lang/E
|
||||
public static fun values ()[Lorg/jetbrains/kotlin/gradle/dsl/ExplicitApiMode;
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/gradle/dsl/HasConfigurableCompilerOptions {
|
||||
public abstract fun compilerOptions (Lkotlin/jvm/functions/Function1;)V
|
||||
public abstract fun compilerOptions (Lorg/gradle/api/Action;)V
|
||||
public abstract fun getCompilerOptions ()Lorg/jetbrains/kotlin/gradle/dsl/KotlinCommonCompilerOptions;
|
||||
}
|
||||
|
||||
public final class org/jetbrains/kotlin/gradle/dsl/HasConfigurableCompilerOptions$DefaultImpls {
|
||||
public static fun compilerOptions (Lorg/jetbrains/kotlin/gradle/dsl/HasConfigurableCompilerOptions;Lkotlin/jvm/functions/Function1;)V
|
||||
public static fun compilerOptions (Lorg/jetbrains/kotlin/gradle/dsl/HasConfigurableCompilerOptions;Lorg/gradle/api/Action;)V
|
||||
}
|
||||
|
||||
public final class org/jetbrains/kotlin/gradle/dsl/JsDiagnosticMode : java/lang/Enum {
|
||||
public static final field Companion Lorg/jetbrains/kotlin/gradle/dsl/JsDiagnosticMode$Companion;
|
||||
public static final field RUNTIME_DIAGNOSTIC_EXCEPTION Lorg/jetbrains/kotlin/gradle/dsl/JsDiagnosticMode;
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.ExperimentalKotlinGradlePluginApi
|
||||
|
||||
/**
|
||||
* DSL entity with the ability to configure Kotlin compiler options.
|
||||
*/
|
||||
@ExperimentalKotlinGradlePluginApi
|
||||
interface HasConfigurableCompilerOptions<CO : KotlinCommonCompilerOptions> {
|
||||
|
||||
/**
|
||||
* Represents the compiler options used by a Kotlin compilation process.
|
||||
*
|
||||
* This can be used to get the values of currently configured options or modify them.
|
||||
*/
|
||||
@ExperimentalKotlinGradlePluginApi
|
||||
val compilerOptions: CO
|
||||
|
||||
/**
|
||||
* Configures the [compilerOptions] with the provided configuration.
|
||||
*/
|
||||
@ExperimentalKotlinGradlePluginApi
|
||||
fun compilerOptions(configure: CO.() -> Unit) {
|
||||
configure(compilerOptions)
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures the [compilerOptions] with the provided configuration.
|
||||
*/
|
||||
@ExperimentalKotlinGradlePluginApi
|
||||
fun compilerOptions(configure: Action<CO>) {
|
||||
configure.execute(compilerOptions)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user