forked from spring-attic/spring-security-saml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
295 lines (246 loc) · 8.27 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
buildscript {
repositories {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
classpath("org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE")
classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
classpath("org.gradle.api.plugins:gradle-tomcat-plugin:1.2.4")
}
}
def coreProjects = subprojects.findAll { !it.name.contains("sample") }
configure(allprojects) { project ->
group = "org.springframework.security.extensions"
ext.slf4jVersion = "1.7.29"
ext.springVersion = "4.3.25.RELEASE"
ext.springSecurityVersion = "4.2.13.RELEASE"
ext.bcprovVersion = "1.64"
ext.bcpkixVersion = "1.64"
ext.openSamlVersion = "2.6.6"
ext.openSamlXmlSec = "1.5.8"
ext.esapiVersion = "2.2.0.0"
ext.xalanVersion = "2.7.2"
ext.xmlApisVersion = "1.4.01"
ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
apply plugin: "propdeps"
apply plugin: "java"
apply from: "${gradleScriptDir}/ide.gradle"
compileJava {
sourceCompatibility=1.6
targetCompatibility=1.6
}
compileTestJava {
sourceCompatibility=1.6
targetCompatibility=1.6
}
test {
systemProperty("java.awt.headless", "true")
maxParallelForks = project.maxParallelForks as int
}
repositories {
mavenCentral()
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
maven { url 'https://repository.mulesoft.org/releases/'}
}
ext.javadocLinks = [
"https://docs.oracle.com/javase/6/docs/api",
"https://docs.oracle.com/javaee/6/api",
] as String[]
}
configure(coreProjects) { p ->
apply plugin: 'spring-io'
ext.springIoVersion = project.hasProperty('platformVersion') ? platformVersion : 'Brussels-SR6'
configurations {
springIoTestRuntime {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'servlet-api') {
details.useTarget 'javax.servlet:javax.servlet-api:3.0.1'
}
}
}
// springIo knows all transitive dependencies for Spring Security 4
springSecurity4TestRuntime.extendsFrom springIoTestRuntime
// springIo does not yet use Spring Security 4, so force it to be Spring Security 4
springSecurity4TestRuntime.incoming.beforeResolve { resolvable ->
springSecurity4TestRuntime.resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'org.springframework.security') {
details.useVersion '4.0.0.RELEASE'
}
}
}
}
task springSecurity4Test(type: Test) {
jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=128M']
classpath = sourceSets.test.output + sourceSets.main.output + configurations.springSecurity4TestRuntime
reports {
html.destination = project.file("$project.buildDir/reports/spring-io-springsecurity4-tests/")
junitXml.destination = project.file("$project.buildDir/spring-io-springsecurity4-test-results/")
}
}
check.dependsOn springSecurity4Test
dependencies {
springIoVersions "io.spring.platform:platform-versions:${springIoVersion}@properties"
}
jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = p.name
manifest.attributes["Implementation-Version"] = p.version
from("${rootProject.projectDir}/docs/dist") {
include "license.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.links(project.ext.javadocLinks)
// suppress warnings due to cross-module @see and @link references;
// note that global 'api' task does display all warnings.
logging.captureStandardError LogLevel.INFO
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = "sources"
from sourceSets.main.allJava.srcDirs
include "**/*.java", "**/*.aj"
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
configure(rootProject) {
description = "Spring Security SAML"
apply plugin: "docbook-reference"
reference {
sourceDir = file("docs/reference/docbook")
pdfFilename = "spring-security-saml-reference.pdf"
}
// don't publish the default jar for the root project
configurations.archives.artifacts.clear()
task api(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadoc API documentation."
title = "${rootProject.description} ${version} API"
dependsOn {
coreProjects.collect {
it.tasks.getByName("jar")
}
}
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.splitIndex = true
options.links(project.ext.javadocLinks)
source coreProjects.collect { project ->
project.sourceSets.main.allJava
}
maxMemory = "1024m"
destinationDir = new File(buildDir, "api")
doFirst {
classpath += files(coreProjects.collect { it.sourceSets.main.compileClasspath })
}
}
task docsZip(type: Zip) {
group = "Distribution"
baseName = "spring-security-saml"
classifier = "docs"
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at https://docs.spring.io/spring-security-saml/docs."
from (api) {
into "api"
}
from (reference) {
into "reference"
}
}
task distZip(type: Zip, dependsOn: [docsZip]) {
group = "Distribution"
baseName = "spring-security-saml"
classifier = "dist"
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${baseName}-${project.version}";
from("docs/dist") {
include "readme.txt"
include "license.txt"
include "notice.txt"
into "${baseDir}"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
from(zipTree(docsZip.archivePath)) {
into "${baseDir}/docs"
}
from("sample") {
include "src/**/*"
include "pom.xml"
into "${baseDir}/sample"
}
coreProjects.each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
if (subproject.tasks.findByPath("sourcesJar")) {
from subproject.sourcesJar
}
if (subproject.tasks.findByPath("javadocJar")) {
from subproject.javadocJar
}
}
}
}
// Create an distribution that contains all dependencies (required and optional).
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
group = "Distribution"
baseName = "spring-security-saml"
classifier = "dist-with-deps"
description = "Builds -${classifier} archive, containing everything " +
"in the -${distZip.classifier} archive plus all runtime dependencies."
from zipTree(distZip.archivePath)
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":${zipTask.name}")) {
def projectNames = rootProject.subprojects*.name
def artifacts = new HashSet()
coreProjects.each { subproject ->
(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
def dependency = artifact.moduleVersion.id
if (!projectNames.contains(dependency.name)) {
artifacts << artifact.file
}
}
}
zipTask.from(artifacts) {
into "${distZip.baseDir}/deps"
}
}
}
}
artifacts {
archives docsZip
archives distZip
}
task wrapper(type: Wrapper) {
description = "Generates gradlew[.bat] scripts"
gradleVersion = "2.3"
doLast() {
def gradleOpts = "-XX:MaxPermSize=1024m -Xmx1024m"
def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
File wrapperFile = file("gradlew")
wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
File wrapperBatFile = file("gradlew.bat")
wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
}
}
}