Add a new root of <...>.dsl.KotlinCompile hierarchy in API

This new interface uses a more general type for its kotlinOptions,
KotlinCommonToolOptions rather than KotlinCommonOptions. This is
needed for the Kotlin/Native task to implement a common interface
with the other Kotlin compilation tasks.
This commit is contained in:
Sergey Igushkin
2018-11-12 15:54:17 +03:00
parent ecd54d9b21
commit ae5d59caf0
2 changed files with 24 additions and 15 deletions
@@ -0,0 +1,24 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. 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 groovy.lang.Closure
import org.gradle.api.Task
import org.gradle.api.tasks.Internal
interface KotlinCompile<out T : KotlinCommonOptions> : Task {
@get:Internal
val kotlinOptions: T
fun kotlinOptions(fn: T.() -> Unit) {
kotlinOptions.fn()
}
fun kotlinOptions(fn: Closure<*>) {
fn.delegate = kotlinOptions
fn.call()
}
}
@@ -18,21 +18,6 @@ package org.jetbrains.kotlin.gradle.dsl
import groovy.lang.Closure
import org.gradle.api.Task
import org.gradle.api.tasks.Internal
interface KotlinCompile<T : KotlinCommonOptions> : Task {
@get:Internal
val kotlinOptions: T
fun kotlinOptions(fn: T.() -> Unit) {
kotlinOptions.fn()
}
fun kotlinOptions(fn: Closure<*>) {
fn.delegate = kotlinOptions
fn.call()
}
}
interface KotlinJsCompile : KotlinCompile<KotlinJsOptions>