[Gradle] Document KotlinCompilationTask
Remove KotlinCompilationTask from KotlinCompile class as it anyway comes via KotlinJvmCompile interface. ^KT-58858 In Progress
This commit is contained in:
committed by
Space Team
parent
73bfc88613
commit
2e8d2800f5
+19
@@ -10,14 +10,33 @@ import org.gradle.api.Task
|
|||||||
import org.gradle.api.tasks.Nested
|
import org.gradle.api.tasks.Nested
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
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 {
|
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
|
@get:Nested
|
||||||
val compilerOptions: CO
|
val compilerOptions: CO
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the [compilerOptions] with the provided configuration.
|
||||||
|
*/
|
||||||
fun compilerOptions(configure: CO.() -> Unit) {
|
fun compilerOptions(configure: CO.() -> Unit) {
|
||||||
configure(compilerOptions)
|
configure(compilerOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the [compilerOptions] with the provided configuration.
|
||||||
|
*/
|
||||||
fun compilerOptions(configure: Action<in CO>) {
|
fun compilerOptions(configure: Action<in CO>) {
|
||||||
configure.execute(compilerOptions)
|
configure.execute(compilerOptions)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -61,8 +61,7 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
objectFactory: ObjectFactory
|
objectFactory: ObjectFactory
|
||||||
) : AbstractKotlinCompile<K2JVMCompilerArguments>(objectFactory, workerExecutor),
|
) : AbstractKotlinCompile<K2JVMCompilerArguments>(objectFactory, workerExecutor),
|
||||||
K2MultiplatformCompilationTask,
|
K2MultiplatformCompilationTask,
|
||||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") KotlinJvmCompileDsl,
|
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") KotlinJvmCompileDsl {
|
||||||
KotlinCompilationTask<KotlinJvmCompilerOptions> {
|
|
||||||
|
|
||||||
final override val kotlinOptions: KotlinJvmOptions = KotlinJvmOptionsCompat(
|
final override val kotlinOptions: KotlinJvmOptions = KotlinJvmOptionsCompat(
|
||||||
{ this },
|
{ this },
|
||||||
|
|||||||
Reference in New Issue
Block a user