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

net.nemerosa.ontrack.kdsl.spec.extension.github.GitHubProjectConfigurationPropertyExtensions.kt Maven / Gradle / Ivy

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

import net.nemerosa.ontrack.json.parse
import net.nemerosa.ontrack.kdsl.spec.Project
import net.nemerosa.ontrack.kdsl.spec.deleteProperty
import net.nemerosa.ontrack.kdsl.spec.getProperty
import net.nemerosa.ontrack.kdsl.spec.setProperty

/**
 * Sets a GitHub property on a project.
 */
var Project.gitHubConfigurationProperty: GitHubProjectConfigurationProperty?
    get() = getProperty(GITHUB_PROJECT_CONFIGURATION_PROPERTY)?.parse()
    set(value) {
        if (value != null) {
            setProperty(GITHUB_PROJECT_CONFIGURATION_PROPERTY, value)
        } else {
            deleteProperty(GITHUB_PROJECT_CONFIGURATION_PROPERTY)
        }
    }


class GitHubProjectConfigurationProperty(
    val configuration: String,
    val repository: String,
    val indexationInterval: Int = 0,
    val issueServiceConfigurationIdentifier: String? = null,
)

const val GITHUB_PROJECT_CONFIGURATION_PROPERTY =
    "net.nemerosa.ontrack.extension.github.property.GitHubProjectConfigurationPropertyType"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy