[Gradle] Create kotlinOptions during task init and keep outputFile for js
This is so that existing build scripts using withType() do not break. Also, fix the failing test. It was necessary to keep outputFile for the js compile task as it was accessed from the build scripts. Instead, a new property is introduced which uses Gradle lazy properties.
This commit is contained in:
committed by
teamcityserver
parent
80181c1091
commit
4994cb3774
+7
-2
@@ -6,8 +6,10 @@
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.util.ConfigureUtil
|
||||
|
||||
interface KotlinCompile<out T : KotlinCommonOptions> : Task {
|
||||
@get:Internal
|
||||
@@ -17,8 +19,11 @@ interface KotlinCompile<out T : KotlinCommonOptions> : Task {
|
||||
kotlinOptions.fn()
|
||||
}
|
||||
|
||||
fun kotlinOptions(fn: Action<in T>) {
|
||||
fn.execute(kotlinOptions)
|
||||
}
|
||||
|
||||
fun kotlinOptions(fn: Closure<*>) {
|
||||
fn.delegate = kotlinOptions
|
||||
fn.call()
|
||||
ConfigureUtil.configure(fn, kotlinOptions)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user