build.gradle 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. 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. }
  33. tasks.named("saganCreateRelease") {
  34. referenceDocUrl = "https://docs.spring.io/spring-security/reference/{version}/index.html"
  35. apiDocUrl = "https://docs.spring.io/spring-security/site/docs/{version}/api/"
  36. }
  37. tasks.named("gitHubCheckMilestoneHasNoOpenIssues") {
  38. repository {
  39. owner = "spring-projects"
  40. name = "spring-security"
  41. }
  42. }
  43. tasks.named("gitHubNextReleaseMilestone") {
  44. repository {
  45. owner = "spring-projects"
  46. name = "spring-security"
  47. }
  48. }
  49. tasks.named("gitHubCheckNextVersionDueToday") {
  50. repository {
  51. owner = "spring-projects"
  52. name = "spring-security"
  53. }
  54. }
  55. tasks.named("scheduleNextRelease") {
  56. repository {
  57. owner = "spring-projects"
  58. name = "spring-security"
  59. }
  60. weekOfMonth = 3
  61. dayOfWeek = 1
  62. }
  63. tasks.named("createGitHubRelease") {
  64. repository {
  65. owner = "spring-projects"
  66. name = "spring-security"
  67. }
  68. }
  69. tasks.named("dispatchGitHubWorkflow") {
  70. repository {
  71. owner = "spring-projects"
  72. name = "spring-security"
  73. }
  74. }
  75. subprojects {
  76. plugins.withType(JavaPlugin) {
  77. project.sourceCompatibility='1.8'
  78. }
  79. tasks.withType(JavaCompile) {
  80. options.encoding = "UTF-8"
  81. options.compilerArgs.add("-parameters")
  82. }
  83. }
  84. allprojects {
  85. if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
  86. apply plugin: 'io.spring.javaformat'
  87. apply plugin: 'checkstyle'
  88. pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
  89. configure(plugin) {
  90. dependencies {
  91. checkstyle libs.io.spring.javaformat.spring.javaformat.checkstyle
  92. }
  93. checkstyle {
  94. toolVersion = '8.34'
  95. }
  96. }
  97. })
  98. if (project.name.contains('sample')) {
  99. tasks.whenTaskAdded { task ->
  100. if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
  101. task.enabled = false
  102. }
  103. }
  104. }
  105. }
  106. tasks.withType(JavaCompile).configureEach {
  107. javaCompiler = javaToolchains.compilerFor {
  108. languageVersion = JavaLanguageVersion.of(8)
  109. }
  110. }
  111. }
  112. if (hasProperty('buildScan')) {
  113. buildScan {
  114. termsOfServiceUrl = 'https://gradle.com/terms-of-service'
  115. termsOfServiceAgree = 'yes'
  116. }
  117. }
  118. nohttp {
  119. source.exclude "buildSrc/build/**"
  120. source.builtBy(project(':spring-security-config').tasks.withType(RncToXsd))
  121. }
  122. tasks.register('cloneSamples', IncludeRepoTask) {
  123. repository = 'spring-projects/spring-security-samples'
  124. ref = samplesBranch
  125. outputDirectory = project.hasProperty("cloneOutputDirectory") ? project.file("$cloneOutputDirectory") : project.file("build/samples")
  126. }
  127. s101 {
  128. configurationDirectory = project.file("etc/s101")
  129. }