[Gradle] Document KotlinCompilationTask

Remove KotlinCompilationTask from KotlinCompile class as it anyway comes
via KotlinJvmCompile interface.

^KT-58858 In Progress
This commit is contained in:
Yahor Berdnikau
2023-07-18 22:21:09 +02:00
committed by Space Team
parent 73bfc88613
commit 2e8d2800f5
2 changed files with 20 additions and 2 deletions
@@ -10,14 +10,33 @@ import org.gradle.api.Task
import org.gradle.api.tasks.Nested
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
/**
* Represents a Kotlin task compiling using configurable [compilerOptions].
*
* See [KotlinCommonCompilerOptions] and its inheritors for possible compiler options.
*
* @see [KotlinCommonCompilerOptions]
*/
interface KotlinCompilationTask<out CO : KotlinCommonCompilerOptions> : Task {
/**
* 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.
*/
@get:Nested
val compilerOptions: CO
/**
* Configures the [compilerOptions] with the provided configuration.
*/
fun compilerOptions(configure: CO.() -> Unit) {
configure(compilerOptions)
}
/**
* Configures the [compilerOptions] with the provided configuration.
*/
fun compilerOptions(configure: Action<in CO>) {
configure.execute(compilerOptions)
}
@@ -61,8 +61,7 @@ abstract class KotlinCompile @Inject constructor(
objectFactory: ObjectFactory
) : AbstractKotlinCompile<K2JVMCompilerArguments>(objectFactory, workerExecutor),
K2MultiplatformCompilationTask,
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") KotlinJvmCompileDsl,
KotlinCompilationTask<KotlinJvmCompilerOptions> {
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") KotlinJvmCompileDsl {
final override val kotlinOptions: KotlinJvmOptions = KotlinJvmOptionsCompat(
{ this },