settings.gradle 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. rootProject.name = 'spring-security'
  2. FileTree buildFiles = fileTree(rootDir) {
  3. List excludes = gradle.startParameter.projectProperties.get("excludeProjects")?.split(",")
  4. include '**/*.gradle', '**/*.gradle.kts'
  5. exclude 'build', '**/gradle', 'settings.gradle', 'buildSrc', '/build.gradle', '.*', 'out'
  6. exclude '**/grails3'
  7. if(excludes) {
  8. exclude excludes
  9. }
  10. }
  11. String rootDirPath = rootDir.absolutePath + File.separator
  12. buildFiles.each { File buildFile ->
  13. boolean isDefaultName = 'build.gradle'.equals(buildFile.name)
  14. boolean isKotlin = buildFile.name.endsWith(".kts")
  15. if(isDefaultName) {
  16. String buildFilePath = buildFile.parentFile.absolutePath
  17. String projectPath = buildFilePath.replace(rootDirPath, '').replace(File.separator, ':')
  18. include projectPath
  19. } else {
  20. String projectName
  21. if (isKotlin) {
  22. projectName = buildFile.name.replace('.gradle.kts', '')
  23. } else {
  24. projectName = buildFile.name.replace('.gradle', '')
  25. }
  26. String projectPath = ':' + projectName;
  27. include projectPath
  28. def project = findProject("${projectPath}")
  29. project.name = projectName
  30. project.projectDir = buildFile.parentFile
  31. project.buildFileName = buildFile.name
  32. }
  33. }