2
0

javaprojects.gradle 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import java.util.jar.Manifest
  2. import org.gradle.api.tasks.bundling.GradleManifest
  3. apply id: 'java'
  4. springVersion = '3.0.1.RELEASE'
  5. springLdapVersion = '1.3.0.RELEASE'
  6. ehcacheVersion = '1.6.2'
  7. aspectjVersion = '1.6.8'
  8. apacheDsVersion = '1.5.5'
  9. jstlVersion = '1.1.2'
  10. jettyVersion = '6.1.22'
  11. hsqlVersion = '1.8.0.10'
  12. configurations {
  13. bundlor
  14. provided
  15. compile.extendsFrom provided
  16. }
  17. dependencies {
  18. compile 'commons-logging:commons-logging:1.1.1'
  19. testCompile 'junit:junit:4.7',
  20. 'org.mockito:mockito-core:1.7',
  21. 'org.jmock:jmock:2.5.1',
  22. 'org.jmock:jmock-junit4:2.5.1',
  23. 'org.hamcrest:hamcrest-core:1.1',
  24. 'org.hamcrest:hamcrest-library:1.1',
  25. "org.springframework:spring-test:$springVersion"
  26. bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RC1',
  27. 'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RC1',
  28. 'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RC1'
  29. }
  30. test {
  31. jvmArgs = ['-ea', '-Xms128m', '-Xmx500m', '-XX:MaxPermSize=128m']
  32. }
  33. task bundlor(dependsOn: compileJava) {
  34. onlyIf {
  35. dependsOnTaskDidWork()
  36. }
  37. doFirst {
  38. ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
  39. File template = new File(projectDir, 'template.mf')
  40. mkdir(buildDir, 'bundlor')
  41. if (template.exists()) {
  42. ant.bundlor(inputPath: sourceSets.main.classesDir, outputPath: "$buildDir/bundlor", manifestTemplatePath: template) {
  43. property(name: 'version', value: "$version")
  44. property(name: 'spring.version', value: "$springVersion")
  45. }
  46. // See GRADLE-395 for support for using an existing manifest
  47. jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/bundlor/META-INF/MANIFEST.MF").newInputStream()))
  48. }
  49. }
  50. }
  51. jar.dependsOn bundlor