2
0

spring-security-saml2-service-provider.gradle 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. apply plugin: 'io.spring.convention.spring-module'
  2. configurations {
  3. opensamlFiveMain { extendsFrom(optional, provided) }
  4. opensamlFiveTest { extendsFrom(opensamlFiveMain, testImplementation) }
  5. }
  6. sourceSets {
  7. opensaml4Main {
  8. java {
  9. compileClasspath += main.output
  10. srcDir 'src/opensaml4Main/java'
  11. }
  12. }
  13. opensaml5Main {
  14. java {
  15. compileClasspath = main.output + configurations.opensamlFiveMain
  16. srcDir 'src/opensaml5Main/java'
  17. }
  18. }
  19. opensaml4Test {
  20. java {
  21. compileClasspath += main.output + test.output + opensaml4Main.output + test.compileClasspath
  22. runtimeClasspath += main.output + test.output + opensaml4Main.output + test.runtimeClasspath
  23. srcDir 'src/opensaml4Test/java'
  24. }
  25. }
  26. opensaml5Test {
  27. java {
  28. compileClasspath = main.output + test.output + opensaml5Main.output + configurations.opensamlFiveTest
  29. runtimeClasspath = main.output + test.output + opensaml5Main.output + configurations.opensamlFiveTest
  30. srcDir 'src/opensaml5Test/java'
  31. }
  32. }
  33. }
  34. sourceSets.configureEach { set ->
  35. if (!set.name.containsIgnoreCase("main")) {
  36. return
  37. }
  38. def from = copySpec {
  39. from("$projectDir/src/$set.name/java/org/springframework/security/saml2/internal")
  40. }
  41. copy {
  42. into "$projectDir/src/$set.name/java/org/springframework/security/saml2/provider/service/authentication/logout"
  43. filter { line -> line.replaceAll(".saml2.internal", ".saml2.provider.service.authentication.logout") }
  44. with from
  45. }
  46. copy {
  47. into "$projectDir/src/$set.name/java/org/springframework/security/saml2/provider/service/authentication"
  48. filter { line -> line.replaceAll(".saml2.internal", ".saml2.provider.service.authentication") }
  49. with from
  50. }
  51. copy {
  52. into "$projectDir/src/$set.name/java/org/springframework/security/saml2/provider/service/metadata"
  53. filter { line -> line.replaceAll(".saml2.internal", ".saml2.provider.service.metadata") }
  54. with from
  55. }
  56. copy {
  57. into "$projectDir/src/$set.name/java/org/springframework/security/saml2/provider/service/web/authentication/logout"
  58. filter { line -> line.replaceAll(".saml2.internal", ".saml2.provider.service.web.authentication.logout") }
  59. with from
  60. }
  61. copy {
  62. into "$projectDir/src/$set.name/java/org/springframework/security/saml2/provider/service/web/authentication"
  63. filter { line -> line.replaceAll(".saml2.internal", ".saml2.provider.service.web.authentication") }
  64. with from
  65. }
  66. copy {
  67. into "$projectDir/src/$set.name/java/org/springframework/security/saml2/provider/service/web"
  68. filter { line -> line.replaceAll(".saml2.internal", ".saml2.provider.service.web") }
  69. with from
  70. }
  71. copy {
  72. into "$projectDir/src/$set.name/java/org/springframework/security/saml2/provider/service/registration"
  73. filter { line -> line.replaceAll(".saml2.internal", ".saml2.provider.service.registration") }
  74. with from
  75. }
  76. }
  77. dependencies {
  78. management platform(project(":spring-security-dependencies"))
  79. api project(':spring-security-web')
  80. api ('org.opensaml:opensaml-saml-api') {
  81. exclude group: 'commons-logging', module: 'commons-logging'
  82. }
  83. api ('org.opensaml:opensaml-saml-impl') {
  84. exclude group: 'commons-logging', module: 'commons-logging'
  85. }
  86. opensamlFiveMain (libs.org.opensaml.opensaml5.saml.api) {
  87. exclude group: 'commons-logging', module: 'commons-logging'
  88. }
  89. opensamlFiveMain (libs.org.opensaml.opensaml5.saml.impl) {
  90. exclude group: 'commons-logging', module: 'commons-logging'
  91. }
  92. provided 'jakarta.servlet:jakarta.servlet-api'
  93. optional 'com.fasterxml.jackson.core:jackson-databind'
  94. testImplementation 'com.squareup.okhttp3:mockwebserver'
  95. testImplementation "org.assertj:assertj-core"
  96. testImplementation "org.skyscreamer:jsonassert"
  97. testImplementation "org.junit.jupiter:junit-jupiter-api"
  98. testImplementation "org.junit.jupiter:junit-jupiter-params"
  99. testImplementation "org.junit.jupiter:junit-jupiter-engine"
  100. testImplementation "org.mockito:mockito-core"
  101. testImplementation "org.mockito:mockito-junit-jupiter"
  102. testImplementation "org.springframework:spring-test"
  103. testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
  104. }
  105. jar {
  106. duplicatesStrategy = DuplicatesStrategy.EXCLUDE
  107. from sourceSets.opensaml4Main.output
  108. from sourceSets.opensaml5Main.output
  109. }
  110. sourcesJar {
  111. duplicatesStrategy = DuplicatesStrategy.EXCLUDE
  112. from sourceSets.opensaml4Main.allJava
  113. from sourceSets.opensaml5Main.allJava
  114. }
  115. testJar {
  116. duplicatesStrategy = DuplicatesStrategy.EXCLUDE
  117. from sourceSets.opensaml4Test.output
  118. from sourceSets.opensaml5Test.output
  119. }
  120. javadoc {
  121. classpath += configurations.opensamlFiveMain
  122. source = sourceSets.main.allJava + sourceSets.opensaml4Main.allJava + sourceSets.opensaml5Main.allJava
  123. }
  124. tasks.register("opensaml4Test", Test) {
  125. useJUnitPlatform()
  126. testClassesDirs = sourceSets.opensaml4Test.output.classesDirs
  127. classpath = sourceSets.opensaml4Test.runtimeClasspath
  128. }
  129. tasks.register("opensaml5Test", Test) {
  130. useJUnitPlatform()
  131. testClassesDirs = sourceSets.opensaml5Test.output.classesDirs
  132. classpath = sourceSets.opensaml5Test.output + sourceSets.opensaml5Test.runtimeClasspath
  133. }
  134. tasks.named("test") {
  135. dependsOn opensaml4Test
  136. dependsOn opensaml5Test
  137. }