build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. // GRADLE-1116
  65. eclipseClasspath.whenConfigured { classpath ->
  66. classpath.entries.removeAll { entry -> entry.path.endsWith('/build/classes/test') }
  67. }
  68. // GRADLE-1422
  69. eclipseClasspath.doFirst {
  70. eclipseClasspath.whenConfigured { classpath ->
  71. def includeDeps = project.configurations.getByName('runtime')?.collect { f-> f.absolutePath } as Set
  72. classpath.entries.findAll { it instanceof org.gradle.plugins.eclipse.model.Library && !includeDeps.contains(it.path) }.each {
  73. it.entryAttributes.remove('org.eclipse.jst.component.dependency')
  74. }
  75. }
  76. }
  77. }
  78. ideaModule {
  79. excludeDirs += file('.gradle')
  80. excludeDirs += file('buildSrc/build')
  81. excludeDirs += file('buildSrc/.gradle')
  82. }
  83. ideaProject {
  84. javaVersion = '1.6'
  85. subprojects = [rootProject] + javaProjects
  86. withXml { node ->
  87. // Use git
  88. def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
  89. vcsConfig.mapping[0].'@vcs' = 'Git'
  90. }
  91. }
  92. task wrapper(type: Wrapper) {
  93. gradleVersion = '1.0-milestone-1'
  94. }