lib/buildr4osgi/osgi/library_extension.rb in buildr4osgi-0.9.0 vs lib/buildr4osgi/osgi/library_extension.rb in buildr4osgi-0.9.2

- old
+ new

@@ -51,11 +51,11 @@ if File.exists?(manifest_location) read_m = ::Buildr::Packaging::Java::Manifest.parse(File.read(manifest_location)).main manifest = project.manifest.merge(read_m) end manifest["Bundle-Version"] = project.version # the version of the bundle packaged is ALWAYS the version of the project. - manifest["Bundle-SymbolicName"] ||= project.id # if it was resetted to nil, we force the id to be added back. + manifest["Bundle-SymbolicName"] ||= project.id.split(":").last # if it was resetted to nil, we force the id to be added back. plugin.with :manifest=> manifest, :meta_inf=>meta_inf plugin.with [compile.target, resources.target].compact end @@ -134,16 +134,18 @@ walk_libs(#{deps_as_str}) {|lib| names << lib.to_spec lib.invoke # make sure the artifact is present. Zip::ZipFile.foreach(lib.to_s) {|entry| entries << entry.name.sub(/(.*)\\/.*.class$/, '\\1').gsub(/\\//, '.') if /.*\\.class$/.match(entry.name)} } - jar.with :manifest => { - "Export-Package" => entries.uniq.sort.join(","), + lib_manifest = { "Bundle-Version" => "#{version}", "Bundle-SymbolicName" => project.name, "Bundle-Name" => names.join(", "), "Bundle-Vendor" => "Intalio, Inc." - }.merge(#{options[:manifest].inspect}) + } + lib_manifest["Export-Package"] = entries.uniq.sort.join(",") unless entries.empty? + lib_manifest["Bundle-ManifestVersion"] = "2" + jar.with :manifest => lib_manifest.merge(#{options[:manifest].inspect}) } package(:sources).tap do |task| task.enhance do