All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlin.gradle.plugin.KotlinProjectSetupAction.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC
Show newest version
@file:Suppress("FunctionName")

package org.jetbrains.kotlin.gradle.plugin

import org.gradle.api.Project

/**
 * Generic action to configure/set up a Kotlin Gradle Project.
 * Will be invoked after the KotlinPluginWrapper applied the underlying Kotlin Gradle Plugin
 */
internal fun interface KotlinProjectSetupAction {
    fun Project.invoke()

    companion object {
        val extensionPoint = KotlinGradlePluginExtensionPoint()
    }
}

internal fun KotlinProjectSetupCoroutine(action: suspend Project.() -> Unit) = KotlinProjectSetupAction {
    project.launch { action() }
}

internal fun Project.runKotlinProjectSetupActions() {
    KotlinProjectSetupAction.extensionPoint[this].forEach { action ->
        with(action) { invoke() }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy