forked from apereo/cas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
306 lines (253 loc) · 9.2 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
description = "Apereo Central Authentication Service $version"
defaultTasks "clean", "build"
ext {
publishSnapshots = Boolean.getBoolean("publishSnapshots")
publishReleases = Boolean.getBoolean("publishReleases")
sonatypeUsername = System.getProperty("sonatypeUsername")
sonatypePassword = System.getProperty("sonatypePassword")
}
def isArtifactSigningRequired = {
if (publishReleases && sonatypeUsername != null && sonatypePassword != null) {
return true
}
return false
}
apply from: rootProject.file("gradle/overrides.gradle")
apply from: rootProject.file("gradle/dependencies.gradle")
apply plugin: "com.gradle.build-scan"
buildScan {
licenseAgreementUrl = "https://gradle.com/terms-of-service"
licenseAgree = "yes"
}
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://maven.eveoh.nl/content/repositories/releases" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.spring.io/plugins-release" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/snapshot" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "com.netflix.nebula:gradle-lint-plugin:5.1.3"
classpath "org.standardout:gradle-versioneye-plugin:1.4.0"
classpath "org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath "com.gradle:build-scan-plugin:1.0"
}
}
allprojects {
apply plugin: "idea"
apply plugin: "eclipse"
apply plugin: "maven"
apply plugin: "signing"
apply plugin: "org.standardout.versioneye"
apply plugin: "nebula.lint"
if (project.name == "cas-server-support-bom") {
println "Skipping pom generation for [$project.name], letting it create <dependency-management> entries."
} else {
apply from: rootProject.file("gradle/maven.gradle")
}
gradleLint.rules = ["dependency-parentheses", "dependency-tuple"]
signing {
required = isArtifactSigningRequired
sign configurations.archives
}
idea {
module {
downloadSources = false
downloadJavadoc = false
}
}
signArchives.enabled = rootProject.publishReleases || rootProject.publishSnapshots
/*
Do NOT publish test dependencies into the final POM.
*/
conf2ScopeMappings.mappings.remove(configurations.findByName("testCompile"))
conf2ScopeMappings.mappings.remove(configurations.findByName("testRuntime"))
}
subprojects {
task allDependenciesInsight(type: DependencyInsightReportTask, description: "Produce insight information for all dependencies") {
doLast {}
}
task allDependencies(type: DependencyReportTask, description: "Display a graph of all project dependencies") {
doLast {}
}
apply plugin: "java"
apply plugin: "checkstyle"
apply plugin: "findbugs"
apply plugin: "project-report"
apply plugin: "propdeps"
apply plugin: "propdeps-maven"
apply plugin: "propdeps-idea"
apply plugin: "propdeps-eclipse"
apply from: rootProject.file("gradle/tasks.gradle")
ext.libraries = rootProject.ext.libraries;
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://raw.github.com/vt-middleware/maven-repo/master" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://oss.sonatype.org/content/repositories/releases" }
maven { url "http://repo.maven.apache.org/maven2" }
maven { url "https://jitpack.io" }
maven { url "http://developer.jasig.org/repo/content/groups/m2-legacy/" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases" }
maven { url "http://files.couchbase.com/maven2" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/libs-snapshot" }
maven { url "https://dl.bintray.com/uniconiam/maven" }
}
test {
enabled = !Boolean.getBoolean("skipTests")
useJUnit()
scanForTestClasses = false
ignoreFailures = Boolean.getBoolean("ignoreTestFailures")
include "**/*Tests.*"
exclude "**/*Abstract*.*"
classpath = it.classpath + files("${projectDir}/src/main/resources") +
files("${projectDir}/src/test/resources")
testLogging {
events = ["FAILED", "STANDARD_OUT"]
exceptionFormat = "full"
showStandardStreams = Boolean.getBoolean("showStandardStreams")
showExceptions = true
showCauses = true
}
}
configurations {
tests
}
configurations.all {
resolutionStrategy {
if (!Boolean.getBoolean("skipVersionConflict")) {
failOnVersionConflict()
}
cacheDynamicVersionsFor 24, 'hours'
cacheChangingModulesFor 24, 'hours'
}
exclude(group: "ch.qos.logback", module: "logback-core")
exclude(group: "ch.qos.logback", module: "logback-classic")
exclude(group: "cglib", module: "cglib")
exclude(group: "cglib", module: "cglib-full")
}
artifacts {
tests testJar
archives sourcesJar
archives javadocJar
archives resourcesJar
archives testJar
}
sourceSets {
test.resources.srcDirs = ["${projectDir}/src/test/resources", "${projectDir}/src/test/java"]
}
ext.buildDate = null
ext.buildJarFile = new File(project.buildDir, "libs/${project.name}-${project.version}.jar")
compileJava.options.fork = true
if (Boolean.getBoolean("enableIncremental")) {
compileJava.options.incremental = true
}
def currentTime = java.time.ZonedDateTime.now()
compileJava.doLast {
buildDate = currentTime
jar.manifest {
attributes("Implementation-Date": project.buildDate)
}
}
tasks.jar.onlyIf {
project.buildDate != null || !project.buildJarFile.exists()
}
jar {
manifest {
attributes("Implementation-Title": project.name,
"Implementation-Vendor": project.group,
"Created-By": project.group,
"Implementation-Version": project.version)
}
}
checkstyle {
configFile new File(rootDir, "checkstyle-rules.xml")
configProperties = ["checkstyle.suppressions.file": new File(rootDir, "checkstyle-suppressions.xml")]
ignoreFailures false
showViolations true
toolVersion "${checkstyleVersion}"
}
checkstyleTest {
enabled = !Boolean.getBoolean("skipCheckstyle")
}
checkstyleMain {
enabled = !Boolean.getBoolean("skipCheckstyle")
}
versioneye {
includePlugins = false
includeSubProjects = true
}
findbugs {
toolVersion = "${findbugsVersion}"
sourceSets = [sourceSets.main]
ignoreFailures = false
reportsDir = file("$project.buildDir/findbugsReports")
effort = "max"
reportLevel = "low"
includeFilter = file("$rootProject.projectDir/findbugs-rules.xml")
}
findbugsMain {
enabled = !Boolean.getBoolean("skipFindbugs")
reports {
xml.enabled = false
html.enabled = true
}
}
findbugsTest {
enabled = !Boolean.getBoolean("skipFindbugs")
}
dependencies {
compile libraries.aspectj
compile libraries.validationapi
compile libraries.log4j
compile libraries.guava
compile libraries.commons
compile libraries.jodatime
compile libraries.inspektr
compileOnly libraries.javax
if (Boolean.getBoolean("genConfigMetadata")) {
optional libraries.springbootconfigmetadata
}
if (!Boolean.getBoolean("skipFindbugs")) {
findbugs libraries.findbugs
findbugs configurations.findbugsPlugins.dependencies
findbugsPlugins libraries.findbugscontrib
findbugsPlugins libraries.findbugssec
}
testCompile libraries.tests
runtime libraries.javaximpl
}
if (Boolean.getBoolean("genConfigMetadata")) {
compileJava.dependsOn(processResources)
}
}
task wrapper(type: Wrapper, description: "Gradle wrapper") {
gradleVersion = project.gradleVersion
}
task javadoc(type: Javadoc, description: "Aggregate all Javadocs into a single directory") {
source subprojects.collect { project -> project.sourceSets.main.allJava }
destinationDir = new File(buildDir, "javadoc")
classpath = files(subprojects.collect { project -> project.sourceSets.main.compileClasspath })
}
task aggregateJavadocsIntoJar(type: Jar, dependsOn: javadoc,
description: "Aggregate all Javadocs into a single directory") {
classifier = "javadoc"
from javadoc
}
task rootSourcesJar(type: Jar, description: "Build JAR for the root CAS module") {
baseName = "${project.archivesBaseName}"
from rootProject.file("src")
}
artifacts {
archives aggregateJavadocsIntoJar
archives rootSourcesJar
}