bundlor.gradle 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. apply plugin: 'java'
  2. configurations {
  3. bundlor
  4. }
  5. dependencies {
  6. bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RELEASE',
  7. 'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RELEASE',
  8. 'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RELEASE'
  9. }
  10. task bundlor(dependsOn: compileJava) {
  11. onlyIf {
  12. dependsOnTaskDidWork()
  13. }
  14. doFirst {
  15. ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
  16. File template = new File(projectDir, 'template.mf')
  17. mkdir("$buildDir/bundlor")
  18. if (template.exists()) {
  19. ant.bundlor(inputPath: sourceSets.main.classesDir, outputPath: "$buildDir/bundlor", manifestTemplatePath: template) {
  20. property(name: 'version', value: "$version")
  21. property(name: 'spring.version', value: "$springVersion")
  22. }
  23. jar.manifest.from("$buildDir/bundlor/META-INF/MANIFEST.MF")
  24. }
  25. }
  26. }
  27. jar.dependsOn bundlor