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

ai.digital.integration.server.common.domain.profiles.DefaultProfileContainer.kt Maven / Gradle / Ivy

There is a newer version: 23.3.0-1025.941
Show newest version
package ai.digital.integration.server.common.domain.profiles

import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.internal.NamedDomainObjectContainerConfigureDelegate
import org.gradle.util.internal.ConfigureUtil

@Suppress("UnstableApiUsage")
internal class DefaultProfileContainer(delegate: NamedDomainObjectContainer) :
    ProfileContainer, NamedDomainObjectContainer by delegate {

    override fun dockerCompose(): DockerComposeProfile = dockerCompose {}

    override fun dockerCompose(closure: Closure<*>): DockerComposeProfile {
        return dockerCompose(ConfigureUtil.configureUsing(closure))
    }

    override fun dockerCompose(action: Action): DockerComposeProfile {
        return (findByName("dockerCompose")
            ?: create("dockerCompose") {
                action.execute(this)
            }) as DockerComposeProfile
    }

    override fun operator(): OperatorProfile = operator {}

    override fun operator(closure: Closure<*>): OperatorProfile {
        return operator(ConfigureUtil.configureUsing(closure))
    }

    override fun operator(action: Action): OperatorProfile {
        return (findByName("operator")
            ?: create("operator") {
                action.execute(this)
            }) as OperatorProfile
    }

    override fun helm(): HelmProfile = helm {}

    override fun helm(closure: Closure<*>): HelmProfile {
        return helm(ConfigureUtil.configureUsing(closure))
    }

    override fun helm(action: Action): HelmProfile {
        return (findByName("helm")
                ?: create("helm") {
                    action.execute(this)
                }) as HelmProfile
    }

    override fun terraform(): TerraformProfile = terraform {}

    override fun terraform(closure: Closure<*>): TerraformProfile {
        return terraform(ConfigureUtil.configureUsing(closure))
    }

    override fun terraform(action: Action): TerraformProfile {
        return (findByName("terraform")
            ?: create("terraform") {
                action.execute(this)
            }) as TerraformProfile
    }

    override fun configure(configureClosure: Closure<*>): NamedDomainObjectContainer =
        ConfigureUtil.configureSelf(configureClosure,
            this,
            NamedDomainObjectContainerConfigureDelegate(configureClosure, this))

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy