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

ai.digital.integration.server.deploy.tasks.centralConfiguration.CentralConfigurationServerOverlaysTask.kt Maven / Gradle / Ivy

There is a newer version: 23.3.0-1025.941
Show newest version
package ai.digital.integration.server.deploy.tasks.centralConfiguration

import ai.digital.integration.server.common.constant.PluginConstant
import ai.digital.integration.server.deploy.internals.CentralConfigurationServerUtil
import ai.digital.integration.server.common.util.OverlaysUtil
import org.gradle.api.DefaultTask

open class CentralConfigurationServerOverlaysTask : DefaultTask() {

    companion object {
        const val NAME = "centralConfigurationServerOverlays"
        const val PREFIX = "ccServerOverlays"
    }

    init {
        this.group = PluginConstant.PLUGIN_GROUP
        this.onlyIf {
            CentralConfigurationServerUtil.hasCentralConfigurationServer(project)
        }

        this.mustRunAfter(PrepareCentralConfigurationServerTask.NAME)
        this.mustRunAfter(DownloadAndExtractCentralConfigurationServerDistTask.NAME)
        val currentTask = this

        project.afterEvaluate {
            val server = CentralConfigurationServerUtil.getCentralConfigurationServer(project)
            project.logger.lifecycle("Copying overlays on central configuration server ${server.name}")
            server.overlays.forEach { overlay ->
                OverlaysUtil.defineOverlay(project,
                        currentTask,
                        CentralConfigurationServerUtil.getServerPath(project, server).toString(),
                        PREFIX,
                        overlay,
                        arrayListOf("${DownloadAndExtractCentralConfigurationServerDistTask.NAME}Exec"))
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy