settings.gradle 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. rootProject.name = 'spring-security'
  2. rootProject.children.each {project ->
  3. //assert project.projectDir.isDirectory()
  4. //assert project.buildFile.isFile()
  5. }
  6. def String[] modules = [
  7. 'core',
  8. 'data',
  9. 'remoting',
  10. 'web',
  11. 'ldap',
  12. 'acl',
  13. 'config',
  14. 'cas',
  15. 'openid',
  16. 'taglibs',
  17. 'aspects',
  18. 'crypto',
  19. 'messaging',
  20. 'test'
  21. ]
  22. include modules
  23. modules.each {name ->
  24. def p = findProject(":${name}")
  25. p.name = "spring-security-${name}"
  26. p.buildFileName = "${name}.gradle"
  27. }
  28. def String[] itest = [
  29. 'web',
  30. 'context'
  31. ]
  32. include itest
  33. itest.each { name ->
  34. def p = findProject(":${name}")
  35. p.name = "itest-${name}"
  36. p.buildFileName = "itest-${name}.gradle"
  37. p.projectDir = new File(settingsDir, "itest/${name}");
  38. }
  39. include 'docs', 'docs:manual', 'docs:guides'
  40. def docs = findProject(':docs')
  41. docs.buildFileName = 'docs.gradle'
  42. include 'bom'
  43. findProject(':bom').name = 'spring-security-bom'
  44. includeSamples("samples/xml")
  45. includeSamples("samples/javaconfig")
  46. void includeSamples(String samplesDir) {
  47. FileTree tree = fileTree(samplesDir) {
  48. include '**/*.gradle'
  49. }
  50. tree.each {File file ->
  51. String projectDir = file.path.substring(file.path.indexOf(samplesDir), file.path.lastIndexOf('/'))
  52. String projectPath = projectDir.substring(projectDir.lastIndexOf('/') + 1)
  53. String projectNamePrefix = samplesDir.substring(samplesDir.lastIndexOf('/') + 1).toLowerCase();
  54. include projectPath
  55. def project = findProject(":${projectPath}")
  56. project.name = "spring-security-samples-${projectNamePrefix}-${project.name}"
  57. project.projectDir = new File(settingsDir, projectDir)
  58. if (!project.buildFile.exists()) {
  59. project.buildFileName = file.path.substring(file.path.lastIndexOf('/') + 1)
  60. }
  61. }
  62. }