Module: OSGi

Defined in:
lib/buildr4osgi/osgi/bundle.rb,
lib/buildr4osgi/osgi/version.rb,
lib/buildr4osgi/osgi/registry.rb,
lib/buildr4osgi/osgi/container.rb,
lib/buildr4osgi/osgi/packaging.rb,
lib/buildr4osgi/osgi/dependencies.rb,
lib/buildr4osgi/osgi/bundle_package.rb,
lib/buildr4osgi/osgi/packaging_sources.rb,
lib/buildr4osgi/osgi/project_extension.rb,
lib/buildr4osgi/osgi/resolving_strategies.rb

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defined Under Namespace

Modules: ActAsOSGiBundle, BundleCollector, BundlePackaging, BundleProjectMatcher, BundleProjects, BundleResolvingStrategies, OSGiOptions, PackageResolvingStrategies, PackagingAsSourcesExtension, ProjectExtension Classes: Bundle, BundlePackage, BundleTask, Container, Dependencies, DependenciesTask, GroupMatcher, InstallTask, OSGi, Registry, Version, VersionRange

Constant Summary collapse

OSGI_GROUP_ID =
"osgi"

Class Method Summary collapse

Class Method Details

.create_source_bundle_manifest(pluginManifest) ⇒ Object

generate an Eclipse-SourceBundle manifest from the manifest of a runtime plugin Assumes that there are no jars inside the runtime plugin.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/buildr4osgi/osgi/packaging_sources.rb', line 20

def self.create_source_bundle_manifest(pluginManifest)
  #remove the properties after the sym-name such as ';singleton=true'
  bundleSymName = pluginManifest["Bundle-SymbolicName"].split(';').first
  bundleVersion = pluginManifest["Bundle-Version"]
  sourcesManifest = ::Buildr::Packaging::Java::Manifest.new(nil)
  sourcesManifest.main["Bundle-ManifestVersion"] = "2"
  sourcesManifest.main["Eclipse-SourceBundle"] = "#{bundleSymName};version=\"#{bundleVersion}\";roots:=\".\""
  sourcesManifest.main["Bundle-SymbolicName"] = bundleSymName + ".sources"
  sourcesManifest.main["Bundle-Name"] += " sources" if sourcesManifest.main["Bundle-Name"] 
  sourcesManifest.main["Bundle-Version"] = bundleVersion
  sourcesManifest.main["Bundle-Vendor"] = pluginManifest["Bundle-Vendor"] unless pluginManifest["Bundle-Vendor"].nil?
  #TODO: ability to define a different license for the sources.
  sourcesManifest.main["Bundle-License"] = pluginManifest["Bundle-License"] unless pluginManifest["Bundle-License"].nil?
  return sourcesManifest
end