forked from apereo/cas-overlay-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (116 loc) · 3.73 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
}
apply from: "https://dl.bintray.com/scalding/generic/waroverlay.gradle"
apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "eclipse"
apply plugin: "idea"
def currentBranch = "master"
def currentVersion = "$System.env.casVersion"
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"
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
war {
includeWarJars = true
entryCompression = ZipEntryCompression.STORED
}
springBoot {
mainClassName = "org.apereo.cas.web.CasWebApplication"
}
bootWar {
if (project.hasProperty('executable')) {
launchScript()
}
archiveName 'cas.war'
baseName 'cas'
excludeDevtools = false
}
bootRun {
sourceResources sourceSets.main
classpath = sourceSets.main.runtimeClasspath
}
dependencies {
if (project.hasProperty("external")) {
compile "org.apereo.cas:cas-server-webapp${project.appServer}:${project.casVersion}@war"
} else {
compile "org.apereo.cas:cas-server-webapp:${project.casVersion}@war"
}
// Other dependencies may be listed here...
}
task explodeWar(type: Copy, group: "build", description: "Explodes the cas.war") {
dependsOn build
from zipTree("build/libs/cas.war")
into "${buildDir}/cas"
}
task run(group: "build", description: "Run the CAS web application in embedded container mode") {
dependsOn build
doLast {
def args = "-Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y"
def casRunArgs = Arrays.asList(args.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 5000") {
dependsOn build
doLast {
def casDebugArgs = Arrays.asList("-Xmx2048M".split(" "))
javaexec {
main = "-jar";
jvmArgs = casDebugArgs
args = ["build/libs/cas.war"]
logger.info "Started ${commandLine}"
}
}
}
task wrapper(type: Wrapper, description: "Update the Gradle wrapper") {
gradleVersion = "${project.gradleVersion}"
}
task casVersion(group: "build", description: "Display the current CAS version") {
doFirst {
println "${project.casVersion}"
}
}
task showConfiguration(group: "build", description: "Show configurations for each dependency, etc") {
doLast() {
def cfg = project.hasProperty("configuration") ? project.property("configuration") : "compile"
configurations.getByName(cfg).each { println it }
}
}
task allDependenciesInsight(type: DependencyInsightReportTask, description: "Produce insight information for all dependencies") {}
task allDependencies(type: DependencyReportTask, description: "Display a graph of all project dependencies") {}