settings.gradle 1002 B

123456789101112131415161718192021222324252627282930
  1. rootProject.name = 'spring-security'
  2. FileTree buildFiles = fileTree(rootDir) {
  3. List excludes = gradle.startParameter.projectProperties.get("excludeProjects")?.split(",")
  4. include '**/*.gradle'
  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. if(isDefaultName) {
  15. String buildFilePath = buildFile.parentFile.absolutePath
  16. String projectPath = buildFilePath.replace(rootDirPath, '').replace(File.separator, ':')
  17. include projectPath
  18. } else {
  19. String projectName = buildFile.name.replace('.gradle', '');
  20. String projectPath = ':' + projectName;
  21. include projectPath
  22. def project = findProject("${projectPath}")
  23. project.name = projectName
  24. project.projectDir = buildFile.parentFile
  25. project.buildFileName = buildFile.name
  26. }
  27. }