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

net.nemerosa.ontrack.kdsl.spec.extension.general.ReleasePropertyExtensions.kt Maven / Gradle / Ivy

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

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

/**
 * Sets a release property (label) on a build.
 *
 * Alias for [setReleaseProperty].
 */
var Build.label: String?
    get() = releaseProperty
    set(value) {
        releaseProperty = value
    }

/**
 * Sets a release property (label) on a build.
 */
var Build.releaseProperty: String?
    get() = getProperty(RELEASE_PROPERTY)?.path("name")?.asText()
    set(value) {
        if (value != null) {
            setProperty(RELEASE_PROPERTY, mapOf("name" to value))
        } else {
            deleteProperty(RELEASE_PROPERTY)
        }
    }

const val RELEASE_PROPERTY = "net.nemerosa.ontrack.extension.general.ReleasePropertyType"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy