matthiasblaesing commented on a change in pull request #494: Adding 
LICENSE/NOTICE/DISCLAIMER to NBMs, packing OSGi jars into NBMs…
URL: https://github.com/apache/incubator-netbeans/pull/494#discussion_r181556151
 
 

 ##########
 File path: nbbuild/antsrc/org/netbeans/nbbuild/MakeNBM.java
 ##########
 @@ -1029,6 +1053,29 @@ private Document createInfoXml(final Attributes attr) 
throws BuildException {
         return doc;
     }
 
+    private Document createFakeOSGiInfo(File osgiJar) {
+        DOMImplementation domimpl;
+        try {
+            domimpl = 
DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation();
+        } catch (ParserConfigurationException x) {
+            throw new BuildException(x, getLocation());
+        }
+
+        log("Creating fake info.xml for OSGi bundle", Project.MSG_VERBOSE);
+        
+        String pub = "-//NetBeans//DTD Autoupdate Module Info 2.5//EN";
+        String sys = "http://www.netbeans.org/dtds/autoupdate-info-2_5.dtd";;
+        Document doc = domimpl.createDocument(null, "module", 
domimpl.createDocumentType("module", pub, sys));
+        
+        try (JarFile jf = new JarFile(osgiJar)) {
+            MakeUpdateDesc.fakeOSGiInfoXml(jf, osgiJar, doc);
 
 Review comment:
   I noticed a difference between regular modules and OSGI(fake) modules: In 
the normal modules a license section is present in the `info.xml`. The LICENSE 
is present in the generated `nbm`. So from that perspective this should be good 
- I'm just wondering whether we need to cover this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to