settings.gradle 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. pluginManagement {
  2. repositories {
  3. gradlePluginPortal()
  4. maven { url 'https://repo.spring.io/plugins-release' }
  5. }
  6. }
  7. plugins {
  8. id "com.gradle.enterprise" version "3.9"
  9. id "io.spring.ge.conventions" version "0.0.7"
  10. }
  11. dependencyResolutionManagement {
  12. repositories {
  13. mavenCentral()
  14. }
  15. }
  16. rootProject.name = 'spring-security'
  17. FileTree buildFiles = fileTree(rootDir) {
  18. List excludes = gradle.startParameter.projectProperties.get("excludeProjects")?.split(",")
  19. include '**/*.gradle', '**/*.gradle.kts'
  20. exclude 'build', '**/gradle', 'settings.gradle', 'buildSrc', '/build.gradle', '.*', 'out'
  21. exclude '**/grails3'
  22. if(excludes) {
  23. exclude excludes
  24. }
  25. }
  26. String rootDirPath = rootDir.absolutePath + File.separator
  27. buildFiles.each { File buildFile ->
  28. boolean isDefaultName = 'build.gradle'.equals(buildFile.name)
  29. boolean isKotlin = buildFile.name.endsWith(".kts")
  30. if(isDefaultName) {
  31. String buildFilePath = buildFile.parentFile.absolutePath
  32. String projectPath = buildFilePath.replace(rootDirPath, '').replace(File.separator, ':')
  33. include projectPath
  34. } else {
  35. String projectName
  36. if (isKotlin) {
  37. projectName = buildFile.name.replace('.gradle.kts', '')
  38. } else {
  39. projectName = buildFile.name.replace('.gradle', '')
  40. }
  41. String projectPath = ':' + projectName;
  42. include projectPath
  43. def project = findProject("${projectPath}")
  44. project.name = projectName
  45. project.projectDir = buildFile.parentFile
  46. project.buildFileName = buildFile.name
  47. }
  48. }