bundlor.gradle 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. def template = new File(projectDir, 'template.mf')
  12. def bundlorDir = new File("${project.buildDir}/bundlor")
  13. def manifest = file("${bundlorDir}/META-INF/MANIFEST.MF")
  14. outputs.dir bundlorDir
  15. outputs.files manifest
  16. inputs.files template, project.sourceSets.main.runtimeClasspath
  17. jar.manifest.from manifest
  18. jar.inputs.files manifest
  19. doFirst {
  20. ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
  21. logging.captureStandardOutput(LogLevel.INFO)
  22. mkdir(bundlorDir)
  23. ant.bundlor(inputPath: sourceSets.main.classesDir, outputPath: "$buildDir/bundlor", manifestTemplatePath: template) {
  24. property(name: 'version', value: project.version)
  25. property(name: 'spring.version', value: project.springVersion)
  26. }
  27. }
  28. }
  29. jar.dependsOn bundlor