2
0

build.gradle 3.3 KB

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