For xz-java to be usable as an OSGi bundle certain attributes
required by the OSGi specification need to be present in the
manifest.
---
 build.properties | 4 ++++
 build.xml        | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/build.properties b/build.properties
index 6801a9d..2d45e8e 100644
--- a/build.properties
+++ b/build.properties
@@ -27,3 +27,7 @@ extdoc_dir = extdoc
 
 pom_template = maven/pom_template.xml
 maven_dir = ${build_dir}/maven
+
+# OSGi metadata
+bundle_name = org.tukaani.xz
+export_packages = org.tukaani.xz
diff --git a/build.xml b/build.xml
index 9f25d27..734d2dd 100644
--- a/build.xml
+++ b/build.xml
@@ -64,6 +64,10 @@
                 <attribute name="Implementation-Version" value="${version}"/>
                 <attribute name="Implementation-URL" value="${homepage}"/>
                 <attribute name="Sealed" value="true"/>
+                <!-- Attributes required for OSGi bundles. -->
+                <attribute name="Bundle-SymbolicName" value="${bundle_name}"/>
+                <attribute name="Bundle-Version" value="${version}"/>
+                <attribute name="Export-Package" value="${export_packages}"/>
             </manifest>
         </jar>
 
The above patch was applied[1] in Fedora GNU/Linux distribution and it
was tested by Fedora developers. It would be nice if OSGi manifests
were included in upstream xz-java too.

Thank you,
--
Mikolaj Izdebski
Software Engineer @ Red Hat
xz-java maintainer in Fedora

[1] 
http://pkgs.fedoraproject.org/cgit/xz-java.git/commit/?id=cd63efa72e4150b6303f995e829b31465bfcd6e9

Reply via email to