build.gradle 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. apply plugin: 'base'
  2. description = 'Spring Security'
  3. allprojects {
  4. ext.releaseBuild = version.endsWith('RELEASE')
  5. ext.snapshotBuild = version.endsWith('SNAPSHOT')
  6. group = 'org.springframework.security'
  7. repositories {
  8. mavenCentral()
  9. }
  10. }
  11. // Set up different subproject lists for individual configuration
  12. ext.javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'faq' && project.name != 'manual' }
  13. ext.sampleProjects = subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
  14. ext.itestProjects = subprojects.findAll { project -> project.name.startsWith('itest') }
  15. ext.coreModuleProjects = javaProjects - sampleProjects - itestProjects
  16. ext.aspectjProjects = [project(':spring-security-aspects'), project(':spring-security-samples-aspectj')]
  17. configure(javaProjects) {
  18. apply from: "$rootDir/gradle/javaprojects.gradle"
  19. }
  20. configure(coreModuleProjects) {
  21. // Gives better names in structure101 jar diagram
  22. sourceSets.main.output.classesDir = new File(buildDir, "classes/" + project.name.substring("spring-security".length() + 1))
  23. apply plugin: 'bundlor'
  24. bundlor.expansions = bundlorProperties
  25. apply from: "$rootDir/gradle/maven-deployment.gradle"
  26. apply plugin: 'emma'
  27. }
  28. task coreBuild {
  29. dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'build' }
  30. }
  31. configure (aspectjProjects) {
  32. apply plugin: 'aspectj'
  33. }
  34. // Task for creating the distro zip
  35. task dist(type: Zip) {
  36. dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' || task.name.endsWith('Zip') }
  37. classifier = 'dist'
  38. evaluationDependsOn(':docs')
  39. def zipRootDir = "${project.name}-$version"
  40. into(zipRootDir) {
  41. from(rootDir) {
  42. include '*.txt'
  43. }
  44. into('docs') {
  45. with(project(':docs').apiSpec)
  46. with(project(':docs:manual').spec)
  47. }
  48. into('dist') {
  49. from coreModuleProjects.collect {project -> project.libsDir }
  50. from project(':spring-security-samples-tutorial').libsDir
  51. from project(':spring-security-samples-contacts').libsDir
  52. }
  53. }
  54. }
  55. artifacts {
  56. archives dist
  57. archives project(':docs').docsZip
  58. archives project(':docs').schemaZip
  59. }
  60. apply from: "$rootDir/gradle/ide-integration.gradle"
  61. task wrapper(type: Wrapper) {
  62. gradleVersion = '1.2'
  63. }