clean up dependencies

parent 979a3ddc
......@@ -41,6 +41,16 @@ apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "com.google.cloud.tools.jib"
dependencies {
def external = project.hasProperty("external") && Boolean.valueOf(project.getProperty("external"))
if (external) {
compile "org.apereo.cas:cas-server-webapp:${casServerVersion}"
} else {
compile "org.apereo.cas:cas-server-webapp${project.appServer}:${casServerVersion}"
}
// Other CAS dependencies/modules may be listed here...
}
tasks.findByName("jibDockerBuild")
.dependsOn(copyWebAppIntoJib, copyConfigIntoJib)
.finalizedBy(deleteWebAppFromJib)
......@@ -51,7 +61,7 @@ configurations.all {
cacheDynamicVersionsFor 0, "seconds"
preferProjectModules()
failOnVersionConflict()
// failOnVersionConflict()
}
}
......@@ -103,15 +113,6 @@ wrapper {
gradleVersion = "${project.gradleVersion}"
}
dependencies {
if (project.hasProperty("external")) {
compile "org.apereo.cas:cas-server-webapp:${casServerVersion}"
} else {
compile "org.apereo.cas:cas-server-webapp${project.appServer}:${casServerVersion}"
}
// Other dependencies may be listed here...
}
jib {
from {
image = project.baseDockerImage
......
......@@ -3,6 +3,7 @@ cas.version=6.0.0-RC4-SNAPSHOT
springBootVersion=2.1.0.RELEASE
appServer=-tomcat
external=false
executable=false
gradleVersion=5.0
......
......@@ -138,27 +138,17 @@ task downloadShell (group: "shell", description: "Download CAS shell jar from sn
task runShell (group: "shell", description: "Run the CAS shell") {
dependsOn downloadShell
doLast {
def casShellArgs = Arrays.asList("-Xmx1500M".split(" "))
javaexec {
main = "-jar"
jvmArgs = casShellArgs
standardInput = System.in
args = ["${project.shellDir}/cas-server-support-shell-${casServerVersion}.jar", "--shell"]
}
println "Run the following command to launch the shell:\n\tjava -jar ${project.shellDir}/cas-server-support-shell-${casServerVersion}.jar"
}
}
task debugShell (group: "shell", description: "Run the CAS shell with debug options, wait for debugger on port 5005") {
dependsOn downloadShell
doLast {
def casArgs = Arrays.asList("-Xmx1500M ".split(" "))
javaexec {
main = "-jar"
jvmArgs = casArgs
debug = true
standardInput = System.in
args = ["${project.shellDir}/cas-server-support-shell-${casServerVersion}.jar", "--shell"]
}
println """
Run the following command to launch the shell:\n\t
java -Xrunjdwp:transport=dt_socket,address=5000,server=y,suspend=y -jar ${project.shellDir}/cas-server-support-shell-${casServerVersion}.jar
"""
}
}
......@@ -248,7 +238,7 @@ task getResource(group: "build", description: "Fetch a CAS resource and move it
mkdir parent
Files.copy(Paths.get(resourceFile), Paths.get(toResourceFile), StandardCopyOption.REPLACE_EXISTING)
println "Copied file to ${toResourceFile}"
println "Copied file ${resourceFile} to ${toResourceFile}"
}
}
......@@ -256,6 +246,13 @@ def isRunningCasServerSnapshot(casServerVersion) {
return "${casServerVersion}".contains("-SNAPSHOT")
}
task setExternal(group: "build", description: "Configure the project to run in an external container") {
doFirst {
project.setProperty("external", "true")
logger.info "Configuring the project as external"
}
}
task downloadTomcat(type: Download) {
def tomcatMajorVersion = "${tomcatVersion}".substring(0, "${tomcatVersion}".indexOf("."))
def downloadFile = "https://www.apache.org/dist/tomcat/tomcat-${tomcatMajorVersion}/v${tomcatVersion}/bin/apache-tomcat-${tomcatVersion}.zip"
......@@ -282,7 +279,7 @@ task shutdownTomcat(type:Exec) {
}
task tomcatDeploy(type:Exec) {
dependsOn build, downloadTomcat, unzipTomcat, shutdownTomcat
dependsOn setExternal, build, downloadTomcat, unzipTomcat, shutdownTomcat
doFirst {
Files.copy(Paths.get(bootWar.archivePath.canonicalPath),
......@@ -299,9 +296,12 @@ task tomcatDeploy(type:Exec) {
tail {
log = files("${tomcatDirectory}/logs/catalina.out")
showColors = true
doFirst {
println "Type 'quit' to exit"
}
}
build.mustRunAfter(setExecutable)
build.mustRunAfter(setExternal, setExecutable)
unzipTomcat.mustRunAfter(downloadTomcat)
shutdownTomcat.mustRunAfter(unzipTomcat)
tomcatDeploy.mustRunAfter(shutdownTomcat).finalizedBy(tail)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment