Module: Buildr::Bnd

Includes:
Extension
Included in:
Project
Defined in:
lib/buildr_bnd.rb

Defined Under Namespace

Classes: BundleTask

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.bnd_main(*args) ⇒ Object



23
24
25
26
# File 'lib/buildr_bnd.rb', line 23

def bnd_main(*args)
  cp = Buildr.artifacts(self.requires).each(&:invoke).map(&:to_s).join(File::PATH_SEPARATOR)
  Java::Commands.java 'aQute.bnd.main.bnd', *(args + [{ :classpath => cp }])
end

.remote_repositoriesObject

Repositories containing the requirements



13
14
15
16
# File 'lib/buildr_bnd.rb', line 13

def remote_repositories
  puts "Buildr::Bnd.remote_repositories is deprecated. Please use Buildr::Bnd.remote_repository instead." 
  [remote_repository]
end

.remote_repositoryObject

Repositories containing the requirements



19
20
21
# File 'lib/buildr_bnd.rb', line 19

def remote_repository
  "http://www.aQute.biz/repo"
end

.requiresObject

The specs for requirements



8
9
10
# File 'lib/buildr_bnd.rb', line 8

def requires
  ["biz.aQute:bnd:jar:0.0.384"]
end

Instance Method Details

#package_as_bundle(filename) ⇒ Object



118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/buildr_bnd.rb', line 118

def package_as_bundle(filename)
  project.task('bnd:print' => [filename]) do |task|
    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



133
134
135
136
# File 'lib/buildr_bnd.rb', line 133

def package_as_bundle_spec(spec)
  # Change the source distribution to .jar extension
  spec.merge( :type => :jar )
end