build.gradle 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. buildscript {
  2. dependencies {
  3. classpath "io.spring.javaformat:spring-javaformat-gradle-plugin:$springJavaformatVersion"
  4. classpath 'io.spring.nohttp:nohttp-gradle:0.0.5.RELEASE'
  5. classpath "io.freefair.gradle:aspectj-plugin:5.0.1"
  6. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
  7. }
  8. repositories {
  9. maven { url 'https://repo.spring.io/plugins-snapshot' }
  10. maven { url 'https://plugins.gradle.org/m2/' }
  11. }
  12. }
  13. apply plugin: 'io.spring.nohttp'
  14. apply plugin: 'locks'
  15. apply plugin: 'io.spring.convention.root'
  16. apply plugin: 'org.jetbrains.kotlin.jvm'
  17. apply plugin: 'org.springframework.security.update-dependencies'
  18. group = 'org.springframework.security'
  19. description = 'Spring Security'
  20. ext.snapshotBuild = version.contains("SNAPSHOT")
  21. ext.releaseBuild = version.contains("SNAPSHOT")
  22. ext.milestoneBuild = !(snapshotBuild || releaseBuild)
  23. repositories {
  24. mavenCentral()
  25. }
  26. updateDependenciesSettings {
  27. gitHub {
  28. organization = "rwinch"
  29. repository = "spring-security"
  30. }
  31. addFiles({
  32. return [
  33. project.file("buildSrc/src/main/java/io/spring/gradle/convention/AsciidoctorConventionPlugin.java"),
  34. project.file("buildSrc/src/main/groovy/io/spring/gradle/convention/CheckstylePlugin.groovy")
  35. ]
  36. })
  37. dependencyExcludes {
  38. majorVersionBump()
  39. alphaBetaVersions()
  40. releaseCandidatesVersions()
  41. milestoneVersions()
  42. snapshotVersions()
  43. }
  44. }
  45. subprojects {
  46. plugins.withType(JavaPlugin) {
  47. project.sourceCompatibility='1.8'
  48. }
  49. tasks.withType(JavaCompile) {
  50. options.encoding = "UTF-8"
  51. }
  52. }
  53. allprojects {
  54. if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
  55. apply plugin: 'io.spring.javaformat'
  56. apply plugin: 'checkstyle'
  57. pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
  58. configure(plugin) {
  59. dependencies {
  60. checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:$springJavaformatVersion"
  61. }
  62. checkstyle {
  63. toolVersion = '8.34'
  64. }
  65. }
  66. })
  67. if (project.name.contains('sample')) {
  68. tasks.whenTaskAdded { task ->
  69. if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
  70. task.enabled = false
  71. }
  72. }
  73. }
  74. }
  75. }
  76. if (hasProperty('buildScan')) {
  77. buildScan {
  78. termsOfServiceUrl = 'https://gradle.com/terms-of-service'
  79. termsOfServiceAgree = 'yes'
  80. }
  81. }
  82. nohttp {
  83. allowlistFile = project.file("etc/nohttp/allowlist.lines")
  84. source.exclude "buildSrc/build/**"
  85. }