This repository has been archived by the owner on Aug 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
/
build.gradle
114 lines (96 loc) · 2.99 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
apply plugin: "org.springframework.boot"
apply from: "https://dl.bintray.com/scalding/generic/waroverlay.gradle"
def currentBranch = "master"
def currentVersion = "${project.'cas.version'}"
if (!currentVersion.contains("RC")) {
def matcher = currentVersion =~ /(\d+\.\d+\.).+/
if (matcher.find()) {
currentBranch = matcher.group(1) + "x"
}
}
logger.info "Using CAS branch [${currentBranch}] to handle overrides"
apply from: "https://raw.githubusercontent.com/apereo/cas/${currentBranch}/gradle/overrides.gradle"
apply plugin: 'eclipse'
apply plugin: 'idea'
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
springBoot {
mainClass = "org.springframework.boot.loader.WarLauncher"
}
bootRepackage {
mainClass = "org.apereo.cas.web.CasWebApplication"
executable = false
excludeDevtools = false
}
bootRun {
addResources = true
classpath = sourceSets.main.compileClasspath
}
repositories {
mavenLocal()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
}
dependencies {
compile "org.apereo.cas:cas-server-webapp-tomcat:${project.'cas.version'}@war"
if (!project.hasProperty('bootiful')) {
// Other dependencies may be listed here...
} else {
println "Running CAS in Bootiful mode; all dependencies except the CAS web application are ignored."
}
}
task copyConfig(type: Copy, description: "Copy CAS configuration over to /etc/cas/config") {
doLast {
from "${project.rootDir}/etc/cas/config"
into '/etc/cas/config'
println "Copied configuration files into /etc/cas/config"
}
}
war {
dependsOn copyConfig
baseName 'cas'
includeWarJars = true
entryCompression = ZipEntryCompression.STORED
}
task explodeWar(type: Copy, group: "build", description: "Explodes the cas.war") {
doLast {
from zipTree(project.war.outputs.files.singleFile)
into "${buildDir}/cas"
println "CAS web application artifact exploded into [cas/build/cas]"
}
}
task run(group: "build", description: "Run the CAS web application in embedded container mode") {
dependsOn build
doLast {
def casRunArgs = Arrays.asList(project.'cas.run.jvmArgs'.split(" "))
javaexec {
main = "-jar";
jvmArgs = casRunArgs
args = ["build/libs/cas.war"]
logger.info "Started ${commandLine}"
}
}
}
task debug(group: "build", description: "Debug the CAS web application in embedded mode on port 5005") {
dependsOn build
doLast {
def casDebugArgs = Arrays.asList(project.'cas.debug.jvmArgs'.split(" "))
javaexec {
main = "-jar";
jvmArgs = casDebugArgs
args = ["build/libs/cas.war"]
logger.info "Started ${commandLine}"
}
}
}