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

net.nemerosa.ontrack.kdsl.spec.extension.git.GitCommitPropertyExtensions.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.kdsl.spec.extension.git

import net.nemerosa.ontrack.kdsl.spec.Build
import net.nemerosa.ontrack.kdsl.spec.deleteProperty
import net.nemerosa.ontrack.kdsl.spec.getProperty
import net.nemerosa.ontrack.kdsl.spec.setProperty

const val GIT_COMMIT_PROPERTY = "net.nemerosa.ontrack.extension.git.property.GitCommitPropertyType"

var Build.gitCommitProperty: String?
    get() = getProperty(GIT_COMMIT_PROPERTY)?.path("commit")?.asText()
    set(value) {
        if (value != null) {
            setProperty(GIT_COMMIT_PROPERTY, mapOf("commit" to value))
        } else {
            deleteProperty(GIT_COMMIT_PROPERTY)
        }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy