Add and generate Groovy-friendly DSL members
As Gradle Groovy DSL does out-of-the box not allow working with SAM-receiving functions in the same way as those accepting a Closure, and, moreover, does not work with Kotlin default parameters, we need to provide Groovy-friendly DSL functions along with Kotlin DSL functions This commit adds those additional members for all of the newly introduced MPP DSL members.
This commit is contained in:
+3
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.plugin
|
||||
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.api.Named
|
||||
import org.gradle.api.attributes.HasAttributes
|
||||
import org.gradle.api.file.ConfigurableFileCollection
|
||||
@@ -32,6 +33,7 @@ interface KotlinCompilation<out T : KotlinCommonOptions> : Named, HasAttributes,
|
||||
val defaultSourceSet: KotlinSourceSet
|
||||
|
||||
fun defaultSourceSet(configure: KotlinSourceSet.() -> Unit)
|
||||
fun defaultSourceSet(configure: Closure<*>) = defaultSourceSet { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
val compileDependencyConfigurationName: String
|
||||
|
||||
@@ -48,6 +50,7 @@ interface KotlinCompilation<out T : KotlinCommonOptions> : Named, HasAttributes,
|
||||
val kotlinOptions: T
|
||||
|
||||
fun kotlinOptions(configure: T.() -> Unit)
|
||||
fun kotlinOptions(configure: Closure<*>) = kotlinOptions { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
val compileAllTaskName: String
|
||||
|
||||
|
||||
Reference in New Issue
Block a user