2
0

build.gradle 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. gradlePluginPortal()
  13. }
  14. }
  15. apply plugin: 'io.spring.nohttp'
  16. apply plugin: 'locks'
  17. apply plugin: 's101'
  18. apply plugin: 'io.spring.convention.root'
  19. apply plugin: 'org.jetbrains.kotlin.jvm'
  20. apply plugin: 'org.springframework.security.update-version'
  21. apply plugin: 'org.springframework.security.sagan'
  22. apply plugin: 'org.springframework.github.milestone'
  23. apply plugin: 'org.springframework.github.changelog'
  24. apply plugin: 'org.springframework.github.release'
  25. apply plugin: 'org.springframework.security.versions.verify-dependencies-versions'
  26. apply plugin: 'org.springframework.security.check-expected-branch-version'
  27. group = 'org.springframework.security'
  28. description = 'Spring Security'
  29. ext.snapshotBuild = version.contains("SNAPSHOT")
  30. ext.releaseBuild = version.contains("SNAPSHOT")
  31. ext.milestoneBuild = !(snapshotBuild || releaseBuild)
  32. repositories {
  33. mavenCentral()
  34. }
  35. tasks.named("saganCreateRelease") {
  36. referenceDocUrl = "https://docs.spring.io/spring-security/reference/{version}/index.html"
  37. apiDocUrl = "https://docs.spring.io/spring-security/site/docs/{version}/api/"
  38. }
  39. tasks.named("gitHubCheckMilestoneHasNoOpenIssues") {
  40. repository {
  41. owner = "spring-projects"
  42. name = "spring-security"
  43. }
  44. }
  45. tasks.named("gitHubNextReleaseMilestone") {
  46. repository {
  47. owner = "spring-projects"
  48. name = "spring-security"
  49. }
  50. }
  51. tasks.named("gitHubCheckNextVersionDueToday") {
  52. repository {
  53. owner = "spring-projects"
  54. name = "spring-security"
  55. }
  56. }
  57. tasks.named("scheduleNextRelease") {
  58. repository {
  59. owner = "spring-projects"
  60. name = "spring-security"
  61. }
  62. weekOfMonth = 3
  63. dayOfWeek = 1
  64. }
  65. tasks.named("createGitHubRelease") {
  66. repository {
  67. owner = "spring-projects"
  68. name = "spring-security"
  69. }
  70. }
  71. tasks.named("dispatchGitHubWorkflow") {
  72. repository {
  73. owner = "spring-projects"
  74. name = "spring-security"
  75. }
  76. }
  77. subprojects {
  78. plugins.withType(JavaPlugin) {
  79. project.sourceCompatibility='1.8'
  80. }
  81. tasks.withType(JavaCompile) {
  82. options.encoding = "UTF-8"
  83. options.compilerArgs.add("-parameters")
  84. }
  85. }
  86. allprojects {
  87. if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
  88. apply plugin: 'io.spring.javaformat'
  89. apply plugin: 'checkstyle'
  90. pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
  91. configure(plugin) {
  92. dependencies {
  93. checkstyle libs.io.spring.javaformat.spring.javaformat.checkstyle
  94. }
  95. checkstyle {
  96. toolVersion = '8.34'
  97. }
  98. }
  99. })
  100. if (project.name.contains('sample')) {
  101. tasks.whenTaskAdded { task ->
  102. if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
  103. task.enabled = false
  104. }
  105. }
  106. }
  107. }
  108. tasks.withType(JavaCompile).configureEach {
  109. javaCompiler = javaToolchains.compilerFor {
  110. languageVersion = JavaLanguageVersion.of(8)
  111. }
  112. }
  113. }
  114. develocity {
  115. buildScan {
  116. termsOfUseUrl = 'https://gradle.com/help/legal-terms-of-use'
  117. termsOfUseAgree = 'yes'
  118. }
  119. }
  120. nohttp {
  121. source.exclude "buildSrc/build/**"
  122. source.builtBy(project(':spring-security-config').tasks.withType(RncToXsd))
  123. }
  124. tasks.register('cloneSamples', IncludeRepoTask) {
  125. repository = 'spring-projects/spring-security-samples'
  126. ref = samplesBranch
  127. outputDirectory = project.hasProperty("cloneOutputDirectory") ? project.file("$cloneOutputDirectory") : project.file("build/samples")
  128. }
  129. s101 {
  130. repository = 'https://structure101.com/binaries/latest'
  131. configurationDirectory = project.file("etc/s101")
  132. }