build.gradle 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. import io.spring.gradle.IncludeRepoTask
  2. import trang.RncToXsd
  3. buildscript {
  4. dependencies {
  5. classpath libs.io.spring.javaformat.spring.javaformat.gradle.plugin
  6. classpath libs.io.spring.nohttp.nohttp.gradle
  7. classpath libs.io.freefair.gradle.aspectj.plugin
  8. classpath libs.org.jetbrains.kotlin.kotlin.gradle.plugin
  9. classpath libs.com.netflix.nebula.nebula.project.plugin
  10. }
  11. repositories {
  12. maven { url 'https://plugins.gradle.org/m2/' }
  13. }
  14. }
  15. plugins {
  16. alias(libs.plugins.org.gradle.wrapper.upgrade)
  17. }
  18. apply plugin: 'io.spring.nohttp'
  19. apply plugin: 'locks'
  20. apply plugin: 's101'
  21. apply plugin: 'io.spring.convention.root'
  22. apply plugin: 'org.jetbrains.kotlin.jvm'
  23. apply plugin: 'org.springframework.security.versions.verify-dependencies-versions'
  24. apply plugin: 'org.springframework.security.check-expected-branch-version'
  25. apply plugin: 'io.spring.security.release'
  26. group = 'org.springframework.security'
  27. description = 'Spring Security'
  28. ext.snapshotBuild = version.contains("SNAPSHOT")
  29. ext.releaseBuild = version.contains("SNAPSHOT")
  30. ext.milestoneBuild = !(snapshotBuild || releaseBuild)
  31. repositories {
  32. mavenCentral()
  33. maven { url "https://repo.spring.io/milestone" }
  34. }
  35. springRelease {
  36. weekOfMonth = 3
  37. dayOfWeek = 1
  38. referenceDocUrl = "https://docs.spring.io/spring-security/reference/{version}/index.html"
  39. apiDocUrl = "https://docs.spring.io/spring-security/site/docs/{version}/api/"
  40. replaceSnapshotVersionInReferenceDocUrl = true
  41. }
  42. def toolchainVersion() {
  43. if (project.hasProperty('testToolchain')) {
  44. return project.property('testToolchain').toString().toInteger()
  45. }
  46. return 17
  47. }
  48. subprojects {
  49. java {
  50. toolchain {
  51. languageVersion = JavaLanguageVersion.of(toolchainVersion())
  52. }
  53. }
  54. kotlin {
  55. jvmToolchain {
  56. languageVersion = JavaLanguageVersion.of(17)
  57. }
  58. }
  59. tasks.withType(JavaCompile).configureEach {
  60. options.encoding = "UTF-8"
  61. options.compilerArgs.add("-parameters")
  62. options.release.set(17)
  63. }
  64. }
  65. allprojects {
  66. if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
  67. apply plugin: 'io.spring.javaformat'
  68. apply plugin: 'checkstyle'
  69. pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
  70. configure(plugin) {
  71. dependencies {
  72. checkstyle libs.io.spring.javaformat.spring.javaformat.checkstyle
  73. }
  74. checkstyle {
  75. toolVersion = '8.34'
  76. }
  77. }
  78. })
  79. if (project.name.contains('sample')) {
  80. tasks.whenTaskAdded { task ->
  81. if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
  82. task.enabled = false
  83. }
  84. }
  85. }
  86. }
  87. }
  88. develocity {
  89. buildScan {
  90. termsOfUseUrl = 'https://gradle.com/help/legal-terms-of-use'
  91. termsOfUseAgree = 'yes'
  92. }
  93. }
  94. nohttp {
  95. source.exclude "buildSrc/build/**", "javascript/.gradle/**", "javascript/package-lock.json", "javascript/node_modules/**", "javascript/build/**", "javascript/dist/**"
  96. source.builtBy(project(':spring-security-config').tasks.withType(RncToXsd))
  97. }
  98. tasks.named('checkstyleNohttp') {
  99. maxHeapSize = '1g'
  100. }
  101. tasks.register('cloneRepository', IncludeRepoTask) {
  102. repository = project.getProperties().get("repositoryName")
  103. ref = project.getProperties().get("ref")
  104. var defaultDirectory = project.file("build/tmp/clone")
  105. outputDirectory = project.hasProperty("cloneOutputDirectory") ? project.file("$cloneOutputDirectory") : defaultDirectory
  106. }
  107. s101 {
  108. repository = 'https://structure101.com/binaries/latest'
  109. configurationDirectory = project.file("etc/s101")
  110. }
  111. wrapperUpgrade {
  112. gradle {
  113. 'spring-security' {
  114. repo = 'spring-projects/spring-security'
  115. baseBranch = '6.2.x' // runs only on 6.2.x and the update is merged forward to main
  116. }
  117. }
  118. }