build.gradle 3.1 KB

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