2
0

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

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