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

pcimcioch.gitlabci.dsl.workflow.WorkflowDsl.kt Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
package pcimcioch.gitlabci.dsl.workflow

import kotlinx.serialization.Serializable
import pcimcioch.gitlabci.dsl.DslBase
import pcimcioch.gitlabci.dsl.job.RuleListDsl

@Serializable
class WorkflowDsl : DslBase() {
    var rules: RuleListDsl? = null

    fun rules(block: RuleListDsl.() -> Unit = {}) = ensureRules().apply(block)

    override fun validate(errors: MutableList) {
        addErrors(errors, "[workflow]", rules)
    }

    private fun ensureRules() = rules ?: RuleListDsl().also { rules = it }

    companion object {
        init {
            addSerializer(WorkflowDsl::class, serializer())
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy