Add configuration methods for kotlinOptions in K/N tasks
Issue #KT-26758 fixed.
This commit is contained in:
committed by
Ilya Matveev
parent
ee5bc95da5
commit
85ba5f11d6
+11
-1
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.kotlin.gradle.tasks
|
||||
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.file.FileCollection
|
||||
@@ -161,7 +162,7 @@ open class KotlinNativeCompile : AbstractCompile() {
|
||||
override var suppressWarnings: Boolean = false
|
||||
override var verbose: Boolean = false
|
||||
|
||||
// Delegate for compilations's exptra options.
|
||||
// Delegate for compilations's extra options.
|
||||
override var freeCompilerArgs: List<String>
|
||||
get() = compilation.extraOpts
|
||||
set(value) { compilation.extraOpts = value.toMutableList() }
|
||||
@@ -169,6 +170,15 @@ open class KotlinNativeCompile : AbstractCompile() {
|
||||
|
||||
@Internal val kotlinOptions: KotlinCommonToolOptions = NativeCompilerOpts()
|
||||
|
||||
fun kotlinOptions(fn: KotlinCommonToolOptions.() -> Unit) {
|
||||
kotlinOptions.fn()
|
||||
}
|
||||
|
||||
fun kotlinOptions(fn: Closure<*>) {
|
||||
fn.delegate = kotlinOptions
|
||||
fn.call()
|
||||
}
|
||||
|
||||
// endregion.
|
||||
|
||||
val kotlinNativeVersion: String
|
||||
|
||||
Reference in New Issue
Block a user