Skip to content

Commit 08d1be5

Browse files
committed
Fix Build to Add Missing Tests
Issue gh-11658
1 parent 96682a1 commit 08d1be5

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

saml2/saml2-service-provider/spring-security-saml2-service-provider.gradle

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
apply plugin: 'io.spring.convention.spring-module'
22

33
configurations {
4-
opensaml4Main { extendsFrom(optional, provided) }
5-
opensaml5Main { extendsFrom(optional, provided) }
6-
opensaml4Test { extendsFrom(opensaml4Main, tests) }
7-
opensaml5Test { extendsFrom(opensaml5Main, tests) }
4+
opensamlFiveMain { extendsFrom(optional, provided) }
5+
opensamlFiveTest { extendsFrom(opensamlFiveMain, testImplementation) }
86
}
97

108
sourceSets {
119
opensaml4Main {
1210
java {
13-
compileClasspath += main.output + configurations.opensaml4Main
11+
compileClasspath += main.output
1412
srcDir 'src/opensaml4Main/java'
1513
}
1614
}
1715
opensaml5Main {
1816
java {
19-
compileClasspath += main.output + configurations.opensaml5Main
17+
compileClasspath = main.output + configurations.opensamlFiveMain
2018
srcDir 'src/opensaml5Main/java'
2119
}
2220
}
2321
opensaml4Test {
2422
java {
25-
compileClasspath += main.output + test.output + opensaml4Main.output + configurations.opensaml4Test
23+
compileClasspath += main.output + test.output + opensaml4Main.output + test.compileClasspath
24+
runtimeClasspath += main.output + test.output + opensaml4Main.output + test.runtimeClasspath
2625
srcDir 'src/opensaml4Test/java'
2726
}
2827
}
2928
opensaml5Test {
3029
java {
31-
compileClasspath += main.output + test.output + opensaml5Main.output + configurations.opensaml5Test
30+
compileClasspath = main.output + test.output + opensaml5Main.output + configurations.opensamlFiveTest
31+
runtimeClasspath = main.output + test.output + opensaml5Main.output + configurations.opensamlFiveTest
3232
srcDir 'src/opensaml5Test/java'
3333
}
3434
}
@@ -88,20 +88,18 @@ sourceSets.configureEach { set ->
8888
dependencies {
8989
management platform(project(":spring-security-dependencies"))
9090
api project(':spring-security-web')
91-
api 'org.opensaml:opensaml-core'
91+
9292
api ('org.opensaml:opensaml-saml-api') {
9393
exclude group: 'commons-logging', module: 'commons-logging'
9494
}
9595
api ('org.opensaml:opensaml-saml-impl') {
9696
exclude group: 'commons-logging', module: 'commons-logging'
9797
}
9898

99-
opensaml5MainImplementation libs.org.opensaml.opensaml5.core.api
100-
opensaml5MainImplementation libs.org.opensaml.opensaml5.core.impl
101-
opensaml5MainImplementation (libs.org.opensaml.opensaml5.saml.api) {
99+
opensamlFiveMain (libs.org.opensaml.opensaml5.saml.api) {
102100
exclude group: 'commons-logging', module: 'commons-logging'
103101
}
104-
opensaml5MainImplementation (libs.org.opensaml.opensaml5.saml.impl) {
102+
opensamlFiveMain (libs.org.opensaml.opensaml5.saml.impl) {
105103
exclude group: 'commons-logging', module: 'commons-logging'
106104
}
107105

@@ -139,22 +137,23 @@ testJar {
139137
}
140138

141139
javadoc {
142-
classpath += sourceSets.opensaml4Main.runtimeClasspath + sourceSets.opensaml5Main.runtimeClasspath
143-
source += sourceSets.opensaml4Main.allJava + sourceSets.opensaml5Main.allJava
140+
classpath += configurations.opensamlFiveMain
141+
source = sourceSets.main.allJava + sourceSets.opensaml4Main.allJava + sourceSets.opensaml5Main.allJava
144142
}
145143

146144
tasks.register("opensaml4Test", Test) {
147145
useJUnitPlatform()
148-
classpath += sourceSets.opensaml4Test.output
146+
testClassesDirs = sourceSets.opensaml4Test.output.classesDirs
147+
classpath = sourceSets.opensaml4Test.runtimeClasspath
149148
}
150149

151150
tasks.register("opensaml5Test", Test) {
152151
useJUnitPlatform()
153-
classpath += sourceSets.opensaml5Test.output
152+
testClassesDirs = sourceSets.opensaml5Test.output.classesDirs
153+
classpath = sourceSets.opensaml5Test.output + sourceSets.opensaml5Test.runtimeClasspath
154154
}
155155

156156
tasks.named("test") {
157157
dependsOn opensaml4Test
158158
dependsOn opensaml5Test
159159
}
160-

0 commit comments

Comments
 (0)