build.gradle 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import java.util.jar.Manifest
  2. import org.gradle.api.tasks.bundling.GradleManifest
  3. allprojects {
  4. version = '3.0.1.CI-SNAPSHOT'
  5. group = 'org.springframework.security'
  6. repositories {
  7. mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository'
  8. mavenCentral()
  9. mavenRepo name:'SpringSource Milestone Repo', urls:'http://repository.springsource.com/maven/bundles/milestone'
  10. }
  11. }
  12. subprojects {
  13. apply id: 'java'
  14. springVersion = '3.0.0.RELEASE'
  15. springLdapVersion = '1.3.0.RELEASE'
  16. ehcacheVersion = '1.6.2'
  17. aspectjVersion = '1.6.5'
  18. apacheDsVersion = '1.5.5'
  19. jstlVersion = '1.1.2'
  20. configurations {
  21. bundlor
  22. provided
  23. }
  24. dependencies {
  25. compile 'commons-logging:commons-logging:1.1.1'
  26. testCompile 'junit:junit:4.7',
  27. 'org.mockito:mockito-core:1.7',
  28. 'org.jmock:jmock:2.5.1',
  29. 'org.jmock:jmock-junit4:2.5.1',
  30. 'org.hamcrest:hamcrest-core:1.1',
  31. 'org.hamcrest:hamcrest-library:1.1',
  32. "org.springframework:spring-test:$springVersion"
  33. bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RC1',
  34. 'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RC1',
  35. 'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RC1'
  36. }
  37. sourceSets {
  38. main {
  39. compileClasspath = compileClasspath + configurations.provided
  40. }
  41. test {
  42. compileClasspath = compileClasspath + configurations.provided
  43. }
  44. }
  45. test {
  46. options.fork(forkMode: ForkMode.ONCE, jvmArgs: ["-ea", '-Xms128m', '-Xmx1g', '-XX:MaxPermSize=128m', '-XX:+HeapDumpOnOutOfMemoryError'])
  47. }
  48. compileJava.doLast {
  49. ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
  50. File template = new File(projectDir, 'template.mf')
  51. if (template.exists()) {
  52. ant.bundlor(inputPath: "$buildDir/classes", outputPath: "$buildDir/classes", manifestTemplatePath: "$projectDir/template.mf") {
  53. property(name: 'version', value: "$version")
  54. property(name: 'spring.version', value: "$springVersion")
  55. }
  56. // See GRADLE-395 for support for using an existing manifest
  57. jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/classes/META-INF/MANIFEST.MF").newInputStream()))
  58. }
  59. }
  60. }
  61. subprojects {
  62. apply id: 'maven'
  63. // Create a source jar for uploading
  64. task sourceJar(type: Jar) {
  65. classifier = 'sources'
  66. from sourceSets.main.java
  67. }
  68. artifacts {
  69. archives sourceJar
  70. }
  71. def deployer = null
  72. uploadArchives {
  73. repositories {
  74. deployer = mavenDeployer {
  75. repository(url: "file://localhost/${rootProject.projectDir}/pomRepo/")
  76. snapshotRepository(url: "file://localhost/${rootProject.projectDir}/snapshotRepo/")
  77. }
  78. }
  79. }
  80. installer = install.repositories.mavenInstaller
  81. conf2ScopeMappings.addMapping(1, configurations.provided, "provided")
  82. }