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

ai.digital.integration.server.release.internals.ReleaseExtensionUtil.kt Maven / Gradle / Ivy

There is a newer version: 23.3.0-1025.941
Show newest version
package ai.digital.integration.server.release.internals

import ai.digital.integration.server.common.domain.DevOpsAsCode
import ai.digital.integration.server.common.domain.Server
import ai.digital.integration.server.release.ReleaseIntegrationServerExtension
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project


class ReleaseExtensionUtil {

    companion object {
        private const val RELEASE_IS_EXTENSION_NAME: String = "releaseIntegrationServer"

        fun getExtension(project: Project): ReleaseIntegrationServerExtension {
            return project.extensions.getByType(ReleaseIntegrationServerExtension::class.java)
        }

        fun createReleaseExtension(project: Project) {
            val servers: NamedDomainObjectContainer = project.container(Server::class.java)

            servers.forEach { server ->
                server.devOpsAsCodes = project.container(DevOpsAsCode::class.java)
            }

            project.extensions.create(
                RELEASE_IS_EXTENSION_NAME,
                ReleaseIntegrationServerExtension::class.java,
                project,
                servers
            )
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy