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

main.name.remal.gradle_plugins.plugins.ci.CIExtension.kt Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package name.remal.gradle_plugins.plugins.ci

import groovy.lang.Closure
import name.remal.gradle_plugins.dsl.extensions.toRunnable

interface CIExtension {

    var isBuildOnCI: Boolean

    var isBuildOnLocal: Boolean
        get() = !isBuildOnCI
        set(value) {
            isBuildOnCI = !value
        }

    fun forBuildOnCI(action: Runnable)

    fun forBuildOnCI(action: Closure<*>) = forBuildOnCI(action.toRunnable())

    fun forBuildOnLocal(action: Runnable)

    fun forBuildOnLocal(action: Closure<*>) = forBuildOnLocal(action.toRunnable())


    var pipelineId: String?
    var buildId: String?
    var stageName: String?
    var jobName: String?

}

fun CIExtension.forBuildOnCI(action: () -> Unit) = forBuildOnCI(Runnable(action))
fun CIExtension.forBuildOnLocal(action: () -> Unit) = forBuildOnLocal(Runnable(action))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy