[Gradle] Implement KotlinProjectSetupCoroutine
as util to easily launch configure action as suspending code KT-61634
This commit is contained in:
committed by
Space Team
parent
628bd7a6be
commit
c7b4057dab
+6
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("FunctionName")
|
||||
|
||||
package org.jetbrains.kotlin.gradle.plugin
|
||||
|
||||
import org.gradle.api.Project
|
||||
@@ -14,6 +16,10 @@ internal fun interface KotlinProjectSetupAction {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun KotlinProjectSetupCoroutine(action: suspend Project.() -> Unit) = KotlinProjectSetupAction {
|
||||
project.launch { action() }
|
||||
}
|
||||
|
||||
internal fun Project.runKotlinProjectSetupActions() {
|
||||
KotlinProjectSetupAction.extensionPoint[this].forEach { action ->
|
||||
with(action) { invoke() }
|
||||
|
||||
Reference in New Issue
Block a user