
ai.digital.integration.server.util.SatelliteUtil.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of integratoin-server-gradle-plugin Show documentation
Show all versions of integratoin-server-gradle-plugin Show documentation
The easy way to get custom setup for Deploy up and running
The newest version!
package ai.digital.integration.server.util
import ai.digital.integration.server.domain.Satellite
import org.gradle.api.Project
import java.nio.file.Paths
import static ai.digital.integration.server.constant.PluginConstant.DIST_DESTINATION_NAME
class SatelliteUtil {
static def hasSatellites(Project project) {
getSatellites(project).size() > 0
}
static List getSatellites(Project project) {
ExtensionUtil.getExtension(project).satellites.collect { Satellite satellite ->
enrichSatellite(project, satellite)
}
}
private static Satellite enrichSatellite(Project project, Satellite satellite) {
satellite.setDebugPort(getDebugPort(project, satellite))
satellite.setVersion(getServerVersion(project, satellite))
satellite
}
static def getSatelliteWorkingDir(Project project, Satellite satellite) {
def targetDir = project.buildDir.toPath().resolve(DIST_DESTINATION_NAME).toAbsolutePath().toString()
Paths.get(targetDir, "xl-satellite-server-${satellite.version}").toAbsolutePath().toString()
}
static def getBinDir(Project project, Satellite satellite) {
Paths.get(getSatelliteWorkingDir(project, satellite), "bin").toFile()
}
static def getSatelliteLog(Project project, Satellite satellite) {
project.file("${getSatelliteWorkingDir(project, satellite)}/log/xl-satellite.log")
}
private static String getServerVersion(Project project, Satellite satellite) {
project.hasProperty("xlSatelliteVersion") ? project.property("xlSatelliteVersion") : satellite.version
}
private static Integer getDebugPort(Project project, Satellite satellite) {
project.hasProperty("satelliteDebugPort") ? Integer.valueOf(project.property("satelliteDebugPort").toString()) : satellite.debugPort
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy