build.gradle 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. apply plugin: 'base'
  2. allprojects {
  3. version = '3.1.0.CI-SNAPSHOT'
  4. releaseBuild = version.endsWith('RELEASE')
  5. snapshotBuild = version.endsWith('SNAPSHOT')
  6. group = 'org.springframework.security'
  7. repositories {
  8. mavenLocal()
  9. mavenCentral()
  10. mavenRepo name: 'SpringSource Milestone Repo', urls: 'http://repository.springsource.com/maven/bundles/milestone'
  11. mavenRepo name: 'SpringSource Maven Snapshot Repo', urls: 'http://maven.springframework.org/snapshot/'
  12. mavenRepo name: 'SpringSource Enterprise Release', urls: 'http://repository.springsource.com/maven/bundles/release'
  13. mavenRepo name: 'SpringSource Enterprise External', urls: 'http://repository.springsource.com/maven/bundles/external'
  14. }
  15. }
  16. // Set up different subproject lists for individual configuration
  17. javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'faq' && project.name != 'manual' }
  18. sampleProjects = subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
  19. itestProjects = subprojects.findAll { project -> project.name.startsWith('itest') }
  20. coreModuleProjects = javaProjects - sampleProjects - itestProjects
  21. aspectjProjects = [project(':spring-security-aspects'), project(':spring-security-samples-aspectj')]
  22. configure(javaProjects) {
  23. apply from: "$rootDir/gradle/javaprojects.gradle"
  24. }
  25. configure(coreModuleProjects) {
  26. // Gives better names in structure101 jar diagram
  27. sourceSets.main.classesDir = new File(buildDir, "classes/" + project.name.substring("spring-security".length() + 1))
  28. apply plugin: 'bundlor'
  29. bundlor.expansions = bundlorProperties
  30. apply from: "$rootDir/gradle/maven-deployment.gradle"
  31. apply plugin: 'emma'
  32. }
  33. task coreBuild {
  34. dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'build' }
  35. }
  36. configure (aspectjProjects) {
  37. apply plugin: 'aspectj'
  38. }
  39. apply from: "$rootDir/gradle/dist.gradle"
  40. apply plugin: 'idea'
  41. configure(javaProjects) {
  42. apply plugin: 'idea'
  43. apply plugin: 'eclipse'
  44. ideaModule {
  45. downloadJavadoc=false
  46. excludeDirs.add(buildDir)
  47. gradleCacheVariable = 'GRADLE_CACHE'
  48. outputDir = "$rootProject.projectDir/intellij/out" as File
  49. testOutputDir = "$rootProject.projectDir/intellij/testOut" as File
  50. whenConfigured { module ->
  51. def allClasses = module.dependencies.findAll() { dep ->
  52. if (dep instanceof org.gradle.plugins.idea.model.ModuleLibrary
  53. && dep.classes.find { path ->
  54. path.url.matches('.*jcl-over-slf4j.*') ||
  55. path.url.matches('.*servlet-api.*') ||
  56. path.url.matches('.*jsp-api.*')
  57. }) {
  58. dep.scope = 'COMPILE'
  59. dep.exported = false
  60. }
  61. }
  62. }
  63. }
  64. }
  65. ideaModule {
  66. excludeDirs += file('.gradle')
  67. excludeDirs += file('buildSrc/build')
  68. excludeDirs += file('buildSrc/.gradle')
  69. }
  70. ideaProject {
  71. javaVersion = '1.6'
  72. subprojects = [rootProject] + javaProjects
  73. withXml { node ->
  74. // Use git
  75. def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
  76. vcsConfig.mapping[0].'@vcs' = 'Git'
  77. }
  78. }
  79. task wrapper(type: Wrapper) {
  80. gradleVersion = '1.0-milestone-1'
  81. }