build.gradle 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. maven { url "http://repo.springsource.org/libs-release" }
  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(subprojects - coreModuleProjects) {
  18. tasks.findByPath("artifactoryPublish")?.enabled = false
  19. }
  20. configure(javaProjects) {
  21. apply from: "$rootDir/gradle/javaprojects.gradle"
  22. apply from: "$rootDir/gradle/release-checks.gradle"
  23. }
  24. configure(coreModuleProjects) {
  25. // Gives better names in structure101 jar diagram
  26. sourceSets.main.output.classesDir = new File(buildDir, "classes/" + project.name.substring("spring-security".length() + 1))
  27. apply plugin: 'bundlor'
  28. bundlor.expansions = bundlorProperties
  29. apply from: "$rootDir/gradle/maven-deployment.gradle"
  30. apply plugin: 'emma'
  31. }
  32. task coreBuild {
  33. dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'build' }
  34. }
  35. configure (aspectjProjects) {
  36. apply plugin: 'aspectj'
  37. }
  38. // Task for creating the distro zip
  39. task dist(type: Zip) {
  40. dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' || task.name.endsWith('Zip') }
  41. classifier = 'dist'
  42. evaluationDependsOn(':docs')
  43. def zipRootDir = "${project.name}-$version"
  44. into(zipRootDir) {
  45. from(rootDir) {
  46. include '*.txt'
  47. }
  48. into('docs') {
  49. with(project(':docs').apiSpec)
  50. with(project(':docs:manual').spec)
  51. }
  52. into('dist') {
  53. from coreModuleProjects.collect {project -> project.libsDir }
  54. from project(':spring-security-samples-tutorial').libsDir
  55. from project(':spring-security-samples-contacts').libsDir
  56. }
  57. }
  58. }
  59. artifacts {
  60. archives dist
  61. archives project(':docs').docsZip
  62. archives project(':docs').schemaZip
  63. }
  64. apply from: "$rootDir/gradle/ide-integration.gradle"
  65. task wrapper(type: Wrapper) {
  66. gradleVersion = '1.3'
  67. }