build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import java.util.jar.Manifest
  2. import org.gradle.api.tasks.bundling.GradleManifest
  3. allprojects {
  4. version = '3.0.2.CI-SNAPSHOT'
  5. releaseBuild = version.endsWith('RELEASE')
  6. group = 'org.springframework.security'
  7. repositories {
  8. mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository'
  9. mavenCentral()
  10. mavenRepo name:'SpringSource Milestone Repo', urls:'http://repository.springsource.com/maven/bundles/milestone'
  11. }
  12. }
  13. subprojects {
  14. apply id: 'java'
  15. springVersion = '3.0.0.RELEASE'
  16. springLdapVersion = '1.3.0.RELEASE'
  17. ehcacheVersion = '1.6.2'
  18. aspectjVersion = '1.6.5'
  19. apacheDsVersion = '1.5.5'
  20. jstlVersion = '1.1.2'
  21. configurations {
  22. bundlor
  23. provided
  24. }
  25. dependencies {
  26. compile 'commons-logging:commons-logging:1.1.1'
  27. testCompile 'junit:junit:4.7',
  28. 'org.mockito:mockito-core:1.7',
  29. 'org.jmock:jmock:2.5.1',
  30. 'org.jmock:jmock-junit4:2.5.1',
  31. 'org.hamcrest:hamcrest-core:1.1',
  32. 'org.hamcrest:hamcrest-library:1.1',
  33. "org.springframework:spring-test:$springVersion"
  34. bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RC1',
  35. 'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RC1',
  36. 'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RC1'
  37. }
  38. sourceSets {
  39. main {
  40. compileClasspath = compileClasspath + configurations.provided
  41. }
  42. test {
  43. compileClasspath = compileClasspath + configurations.provided
  44. runtimeClasspath = runtimeClasspath + configurations.provided
  45. }
  46. }
  47. test {
  48. options.fork(forkMode: ForkMode.ONCE, jvmArgs: ["-ea", '-Xms128m', '-Xmx500m', '-XX:MaxPermSize=128m', '-XX:+HeapDumpOnOutOfMemoryError'])
  49. }
  50. task bundlor (dependsOn: compileJava) << {
  51. if (!dependsOnTaskDidWork()) {
  52. return
  53. }
  54. ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
  55. File template = new File(projectDir, 'template.mf')
  56. mkdir(buildDir, 'bundlor')
  57. if (template.exists()) {
  58. ant.bundlor(inputPath: "$buildDir/classes/main", outputPath: "$buildDir/bundlor", manifestTemplatePath: template) {
  59. property(name: 'version', value: "$version")
  60. property(name: 'spring.version', value: "$springVersion")
  61. }
  62. // See GRADLE-395 for support for using an existing manifest
  63. jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/bundlor/META-INF/MANIFEST.MF").newInputStream()))
  64. }
  65. }
  66. jar.dependsOn bundlor
  67. compileJava.doLast {
  68. }
  69. }
  70. subprojects {
  71. apply id: 'maven'
  72. // Create a source jar for uploading
  73. task sourceJar(type: Jar) {
  74. classifier = 'sources'
  75. from sourceSets.main.java
  76. }
  77. configurations {
  78. deployerJars
  79. }
  80. artifacts {
  81. archives sourceJar
  82. }
  83. dependencies {
  84. deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:2.0.1.BUILD-SNAPSHOT"
  85. }
  86. uploadArchives {
  87. repositories.mavenDeployer {
  88. configuration = configurations.deployerJars
  89. if (releaseBuild) {
  90. // "mavenSyncRepoDir" should be set in properties
  91. repository(url: mavenSyncRepoDir)
  92. } else {
  93. s3credentials = [userName: s3AccessKey, passphrase: s3SecretAccessKey]
  94. repository(url: "s3://maven.springframework.org/milestone") {
  95. authentication(s3credentials)
  96. }
  97. snapshotRepository(url: "s3://maven.springframework.org/snapshot") {
  98. authentication(s3credentials)
  99. }
  100. }
  101. }
  102. }
  103. conf2ScopeMappings.addMapping(1, configurations.provided, "provided")
  104. }