Module: Buildr::Bnd::ProjectExtension

Includes:
Extension
Included in:
Project
Defined in:
lib/buildr/bnd/project_extension.rb

Instance Method Summary collapse

Instance Method Details

#package_as_bundle(filename) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/buildr/bnd/project_extension.rb', line 11

def package_as_bundle(filename)
  project.task('bnd:print' => [filename]) do |task|
    Buildr::Bnd.bnd_main("print", filename)
  end

  dirname = File.dirname(filename)
  directory(dirname)

  # Add Buildr.application.buildfile so it will rebuild if we change settings
  task = BundleTask.define_task(filename => [Buildr.application.buildfile, dirname])
  task.project = self
  # the last task is the task considered the packaging task
  task
end

#package_as_bundle_spec(spec) ⇒ Object

Change the bundle package to .jar extension



27
28
29
# File 'lib/buildr/bnd/project_extension.rb', line 27

def package_as_bundle_spec(spec)
  spec.merge(:type => :jar)
end