Class: Buildr::Bnd::BundleTask

Inherits:
Rake::FileTask
  • Object
show all
Defined in:
lib/buildr/bnd/bundle_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#classpathObject

Returns the value of attribute classpath.



5
6
7
# File 'lib/buildr/bnd/bundle_task.rb', line 5

def classpath
  @classpath
end

#projectObject

Returns the value of attribute project.



4
5
6
# File 'lib/buildr/bnd/bundle_task.rb', line 4

def project
  @project
end

Instance Method Details

#[](key) ⇒ Object



7
8
9
# File 'lib/buildr/bnd/bundle_task.rb', line 7

def [](key)
  @params[key]
end

#[]=(key, value) ⇒ Object



11
12
13
# File 'lib/buildr/bnd/bundle_task.rb', line 11

def []=(key, value)
  @params[key] = value
end

#classpath_element(dependencies) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/buildr/bnd/bundle_task.rb', line 15

def classpath_element(dependencies)
  artifacts = Buildr.artifacts([dependencies])
  self.prerequisites << artifacts
  artifacts.each do |dependency|
    self.classpath << dependency.to_s
  end
end

#to_paramsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/buildr/bnd/bundle_task.rb', line 23

def to_params
  params = self.project.manifest.merge(@params).reject { |k, v| v.nil? }
  params["-classpath"] ||= self.classpath.collect(&:to_s).join(", ")
  params['Bundle-SymbolicName'] ||= [self.project.group, self.project.name.gsub(':', '.')].join('.')
  params['Bundle-Name'] ||= self.project.comment || self.project.name
  params['Bundle-Description'] ||= self.project.comment
  params['Bundle-Version'] ||= self.project.version
  if params["Include-Resource"].nil? && !project.resources.target.nil?
    params["Include-Resource"] = "#{project.resources.target}/"
  end
  params['-removeheaders'] ||= "Include-Resource,Bnd-LastModified,Created-By,Implementation-Title,Tool"
  
  params
end