maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r505494 - /maven/sandbox/plugins/maven-bundle-plugin/src/main/java/aQute/lib/osgi/Analyzer.java
Date Fri, 09 Feb 2007 20:53:40 GMT
Author: carlos
Date: Fri Feb  9 12:53:39 2007
New Revision: 505494

URL: http://svn.apache.org/viewvc?view=rev&rev=505494
Log:
Added methods from bnd#doWrap

Modified:
    maven/sandbox/plugins/maven-bundle-plugin/src/main/java/aQute/lib/osgi/Analyzer.java

Modified: maven/sandbox/plugins/maven-bundle-plugin/src/main/java/aQute/lib/osgi/Analyzer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-bundle-plugin/src/main/java/aQute/lib/osgi/Analyzer.java?view=diff&rev=505494&r1=505493&r2=505494
==============================================================================
--- maven/sandbox/plugins/maven-bundle-plugin/src/main/java/aQute/lib/osgi/Analyzer.java (original)
+++ maven/sandbox/plugins/maven-bundle-plugin/src/main/java/aQute/lib/osgi/Analyzer.java Fri
Feb  9 12:53:39 2007
@@ -1091,4 +1091,48 @@
     return result;
   }
 
+  public String calculateExportsFromContents() {
+      String ddel = ",";
+      StringBuffer sb = new StringBuffer();
+      Map map = dot.getDirectories();
+      for (Iterator i = map.keySet().iterator(); i.hasNext();) {
+          String directory = (String) i.next();
+          if (directory.startsWith("META-INF/"))
+              continue;
+          if (directory.equals("/"))
+              continue;
+
+          if (directory.endsWith("/"))
+              directory = directory.substring(0,
+                      directory.length() - 1);
+
+          directory = directory.replace('/', '.');
+          sb.append(ddel);
+          sb.append(directory);
+          ddel = ",";
+      }
+      return sb.toString();
+  }
+
+  /**
+   * @param analyzer
+   * @param dot
+   * @throws IOException
+   */
+  public void mergeManifest() throws IOException {
+      Manifest manifest = dot.getManifest();
+      if (manifest != null) {
+          Attributes attributes = manifest.getMainAttributes();
+          for (Iterator i = attributes.keySet().iterator(); i.hasNext();) {
+              Name name = (Name) i.next();
+              String key = name.toString();
+              // Dont want instructions
+              if (key.startsWith("-"))
+                  continue;
+
+              if (getProperty(key) == null)
+                  setProperty(key, (String) attributes.get(name));
+          }
+      }
+  }
 }



Mime
View raw message