Module: Buildr4OSGi::BuildLibraries

Included in:
Buildr4OSGi
Defined in:
lib/buildr4osgi/osgi/library_extension.rb

Overview

A module dedicated to building jars into OSGi bundles to serve as libraries.

Defined Under Namespace

Modules: LibraryProject, SkipSourceDownload

Instance Method Summary collapse

Instance Method Details

#manifest(lib) ⇒ Object

Returns the main section of the manifest of the bundle.



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/buildr4osgi/osgi/library_extension.rb', line 80

def manifest(lib)
  artifact = Buildr.artifact(lib)
  artifact.invoke # download it if needed.
  
  m = nil
  Zip::ZipFile.open(artifact.to_s) do |zip|
    raise "No manifest contained in #{lib}" if zip.find_entry("META-INF/MANIFEST.MF").nil?
    m = zip.read("META-INF/MANIFEST.MF")
  end
  manifest = ::Buildr::Packaging::Java::Manifest.new(m)
  manifest.main
end