build.gradle 2.7 KB

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