Use receiver syntax for lambda execution (#2508)
This commit is contained in:
committed by
Sergey Igushkin
parent
ddc5a62e4a
commit
45ab07654e
+2
-2
@@ -55,7 +55,7 @@ interface KotlinCompilation<out T : KotlinCommonOptions> : Named, HasAttributes,
|
|||||||
fun kotlinOptions(configure: T.() -> Unit)
|
fun kotlinOptions(configure: T.() -> Unit)
|
||||||
fun kotlinOptions(configure: Closure<*>) = kotlinOptions { ConfigureUtil.configure(configure, this) }
|
fun kotlinOptions(configure: Closure<*>) = kotlinOptions { ConfigureUtil.configure(configure, this) }
|
||||||
|
|
||||||
fun attributes(configure: AttributeContainer.() -> Unit) = configure(attributes)
|
fun attributes(configure: AttributeContainer.() -> Unit) = attributes.configure()
|
||||||
fun attributes(configure: Closure<*>) = attributes { ConfigureUtil.configure(configure, this) }
|
fun attributes(configure: Closure<*>) = attributes { ConfigureUtil.configure(configure, this) }
|
||||||
|
|
||||||
val compileAllTaskName: String
|
val compileAllTaskName: String
|
||||||
@@ -90,4 +90,4 @@ interface KotlinCompilationToRunnableFiles<T : KotlinCommonOptions> : KotlinComp
|
|||||||
|
|
||||||
interface KotlinCompilationWithResources<T : KotlinCommonOptions> : KotlinCompilation<T> {
|
interface KotlinCompilationWithResources<T : KotlinCommonOptions> : KotlinCompilation<T> {
|
||||||
val processResourcesTaskName: String
|
val processResourcesTaskName: String
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -48,7 +48,7 @@ interface KotlinTarget : Named, HasAttributes {
|
|||||||
fun mavenPublication(action: Closure<Unit>)
|
fun mavenPublication(action: Closure<Unit>)
|
||||||
fun mavenPublication(action: Action<MavenPublication>)
|
fun mavenPublication(action: Action<MavenPublication>)
|
||||||
|
|
||||||
fun attributes(configure: AttributeContainer.() -> Unit) = configure(attributes)
|
fun attributes(configure: AttributeContainer.() -> Unit) = attributes.configure()
|
||||||
fun attributes(configure: Closure<*>) = attributes { ConfigureUtil.configure(configure, this) }
|
fun attributes(configure: Closure<*>) = attributes { ConfigureUtil.configure(configure, this) }
|
||||||
|
|
||||||
val preset: KotlinTargetPreset<out KotlinTarget>?
|
val preset: KotlinTargetPreset<out KotlinTarget>?
|
||||||
@@ -64,4 +64,4 @@ interface KotlinTargetWithTests<E : KotlinExecution.ExecutionSource, T : KotlinT
|
|||||||
companion object {
|
companion object {
|
||||||
const val DEFAULT_TEST_RUN_NAME = "test"
|
const val DEFAULT_TEST_RUN_NAME = "test"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -73,8 +73,7 @@ abstract class AbstractKotlinCompilation<T : KotlinCommonOptions>(
|
|||||||
override val defaultSourceSet: KotlinSourceSet
|
override val defaultSourceSet: KotlinSourceSet
|
||||||
get() = target.project.kotlinExtension.sourceSets.getByName(defaultSourceSetName)
|
get() = target.project.kotlinExtension.sourceSets.getByName(defaultSourceSetName)
|
||||||
|
|
||||||
override fun defaultSourceSet(configure: KotlinSourceSet.() -> Unit) =
|
override fun defaultSourceSet(configure: KotlinSourceSet.() -> Unit) = defaultSourceSet.configure()
|
||||||
configure(defaultSourceSet)
|
|
||||||
|
|
||||||
override val output: KotlinCompilationOutput by lazy {
|
override val output: KotlinCompilationOutput by lazy {
|
||||||
DefaultKotlinCompilationOutput(
|
DefaultKotlinCompilationOutput(
|
||||||
|
|||||||
Reference in New Issue
Block a user