settings.gradle 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.2"
  9. id "io.spring.gradle-enterprise-conventions" version "0.0.2"
  10. }
  11. rootProject.name = 'spring-security'
  12. FileTree buildFiles = fileTree(rootDir) {
  13. List excludes = gradle.startParameter.projectProperties.get("excludeProjects")?.split(",")
  14. include '**/*.gradle', '**/*.gradle.kts'
  15. exclude 'build', '**/gradle', 'settings.gradle', 'buildSrc', '/build.gradle', '.*', 'out'
  16. exclude '**/grails3'
  17. if(excludes) {
  18. exclude excludes
  19. }
  20. }
  21. String rootDirPath = rootDir.absolutePath + File.separator
  22. buildFiles.each { File buildFile ->
  23. boolean isDefaultName = 'build.gradle'.equals(buildFile.name)
  24. boolean isKotlin = buildFile.name.endsWith(".kts")
  25. if(isDefaultName) {
  26. String buildFilePath = buildFile.parentFile.absolutePath
  27. String projectPath = buildFilePath.replace(rootDirPath, '').replace(File.separator, ':')
  28. include projectPath
  29. } else {
  30. String projectName
  31. if (isKotlin) {
  32. projectName = buildFile.name.replace('.gradle.kts', '')
  33. } else {
  34. projectName = buildFile.name.replace('.gradle', '')
  35. }
  36. String projectPath = ':' + projectName;
  37. include projectPath
  38. def project = findProject("${projectPath}")
  39. project.name = projectName
  40. project.projectDir = buildFile.parentFile
  41. project.buildFileName = buildFile.name
  42. }
  43. }