Fix Build to Add Missing Tests

Issue gh-11658
This commit is contained in:
Josh Cummings 2024-08-05 16:16:05 -06:00
parent 96682a1d5c
commit 08d1be5774
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
1 changed files with 17 additions and 18 deletions

View File

@ -1,34 +1,34 @@
apply plugin: 'io.spring.convention.spring-module' apply plugin: 'io.spring.convention.spring-module'
configurations { configurations {
opensaml4Main { extendsFrom(optional, provided) } opensamlFiveMain { extendsFrom(optional, provided) }
opensaml5Main { extendsFrom(optional, provided) } opensamlFiveTest { extendsFrom(opensamlFiveMain, testImplementation) }
opensaml4Test { extendsFrom(opensaml4Main, tests) }
opensaml5Test { extendsFrom(opensaml5Main, tests) }
} }
sourceSets { sourceSets {
opensaml4Main { opensaml4Main {
java { java {
compileClasspath += main.output + configurations.opensaml4Main compileClasspath += main.output
srcDir 'src/opensaml4Main/java' srcDir 'src/opensaml4Main/java'
} }
} }
opensaml5Main { opensaml5Main {
java { java {
compileClasspath += main.output + configurations.opensaml5Main compileClasspath = main.output + configurations.opensamlFiveMain
srcDir 'src/opensaml5Main/java' srcDir 'src/opensaml5Main/java'
} }
} }
opensaml4Test { opensaml4Test {
java { java {
compileClasspath += main.output + test.output + opensaml4Main.output + configurations.opensaml4Test compileClasspath += main.output + test.output + opensaml4Main.output + test.compileClasspath
runtimeClasspath += main.output + test.output + opensaml4Main.output + test.runtimeClasspath
srcDir 'src/opensaml4Test/java' srcDir 'src/opensaml4Test/java'
} }
} }
opensaml5Test { opensaml5Test {
java { java {
compileClasspath += main.output + test.output + opensaml5Main.output + configurations.opensaml5Test compileClasspath = main.output + test.output + opensaml5Main.output + configurations.opensamlFiveTest
runtimeClasspath = main.output + test.output + opensaml5Main.output + configurations.opensamlFiveTest
srcDir 'src/opensaml5Test/java' srcDir 'src/opensaml5Test/java'
} }
} }
@ -88,7 +88,7 @@ sourceSets.configureEach { set ->
dependencies { dependencies {
management platform(project(":spring-security-dependencies")) management platform(project(":spring-security-dependencies"))
api project(':spring-security-web') api project(':spring-security-web')
api 'org.opensaml:opensaml-core'
api ('org.opensaml:opensaml-saml-api') { api ('org.opensaml:opensaml-saml-api') {
exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'commons-logging', module: 'commons-logging'
} }
@ -96,12 +96,10 @@ dependencies {
exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'commons-logging', module: 'commons-logging'
} }
opensaml5MainImplementation libs.org.opensaml.opensaml5.core.api opensamlFiveMain (libs.org.opensaml.opensaml5.saml.api) {
opensaml5MainImplementation libs.org.opensaml.opensaml5.core.impl
opensaml5MainImplementation (libs.org.opensaml.opensaml5.saml.api) {
exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'commons-logging', module: 'commons-logging'
} }
opensaml5MainImplementation (libs.org.opensaml.opensaml5.saml.impl) { opensamlFiveMain (libs.org.opensaml.opensaml5.saml.impl) {
exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'commons-logging', module: 'commons-logging'
} }
@ -139,22 +137,23 @@ testJar {
} }
javadoc { javadoc {
classpath += sourceSets.opensaml4Main.runtimeClasspath + sourceSets.opensaml5Main.runtimeClasspath classpath += configurations.opensamlFiveMain
source += sourceSets.opensaml4Main.allJava + sourceSets.opensaml5Main.allJava source = sourceSets.main.allJava + sourceSets.opensaml4Main.allJava + sourceSets.opensaml5Main.allJava
} }
tasks.register("opensaml4Test", Test) { tasks.register("opensaml4Test", Test) {
useJUnitPlatform() useJUnitPlatform()
classpath += sourceSets.opensaml4Test.output testClassesDirs = sourceSets.opensaml4Test.output.classesDirs
classpath = sourceSets.opensaml4Test.runtimeClasspath
} }
tasks.register("opensaml5Test", Test) { tasks.register("opensaml5Test", Test) {
useJUnitPlatform() useJUnitPlatform()
classpath += sourceSets.opensaml5Test.output testClassesDirs = sourceSets.opensaml5Test.output.classesDirs
classpath = sourceSets.opensaml5Test.output + sourceSets.opensaml5Test.runtimeClasspath
} }
tasks.named("test") { tasks.named("test") {
dependsOn opensaml4Test dependsOn opensaml4Test
dependsOn opensaml5Test dependsOn opensaml5Test
} }