Add all attributes/directives to system bundle export package header. (FELIX-2599)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@999440 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
index 5c5fb42..4f6f347 100644
--- a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
+++ b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
@@ -440,9 +440,27 @@
 
                 // Append exported package information.
                 exportSB.append(m_capabilities.get(i).getAttribute(Capability.PACKAGE_ATTR).getValue());
-                exportSB.append("; version=\"");
-                exportSB.append(m_capabilities.get(i).getAttribute(Capability.VERSION_ATTR).getValue());
-                exportSB.append("\"");
+                for (Directive dir : m_capabilities.get(i).getDirectives())
+                {
+                    exportSB.append("; ");
+                    exportSB.append(dir.getName());
+                    exportSB.append(":=\"");
+                    exportSB.append(dir.getValue());
+                    exportSB.append("\"");
+                }
+                for (Attribute attr : m_capabilities.get(i).getAttributes())
+                {
+                    if (!attr.getName().equals(Capability.PACKAGE_ATTR)
+                        && !attr.getName().equals(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE)
+                        && !attr.getName().equals(Constants.BUNDLE_VERSION_ATTRIBUTE))
+                    {
+                        exportSB.append("; ");
+                        exportSB.append(attr.getName());
+                        exportSB.append("=\"");
+                        exportSB.append(attr.getValue());
+                        exportSB.append("\"");
+                    }
+                }
 
                 // Remember exported packages.
                 exportNames.add(m_capabilities.get(i).getAttribute(Capability.PACKAGE_ATTR).getValue());