felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From walk...@apache.org
Subject svn commit: r497031 - in /incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen: BundleJar.java OsgiPackage.java rule/AttributeStamp.java
Date Wed, 17 Jan 2007 14:52:33 GMT
Author: walkerr
Date: Wed Jan 17 06:52:32 2007
New Revision: 497031

URL: http://svn.apache.org/viewvc?view=rev&rev=497031
Log:
Modifications to mangen to work with recent Felix changes to manifest reading classes.

Modified:
    incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/BundleJar.java
    incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/OsgiPackage.java
    incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/rule/AttributeStamp.java

Modified: incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/BundleJar.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/BundleJar.java?view=diff&rev=497031&r1=497030&r2=497031
==============================================================================
--- incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/BundleJar.java
(original)
+++ incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/BundleJar.java
Wed Jan 17 06:52:32 2007
@@ -173,7 +173,7 @@
      */
     public Set getCurrentExports()
     {
-        return OsgiPackage.createFromHeaders(mainAttributes.getValue(Constants.EXPORT_PACKAGE));
+        return OsgiPackage.createFromHeaders(mainAttributes.getValue(Constants.EXPORT_PACKAGE),
true);
     }
     
     /**
@@ -181,7 +181,7 @@
      */
     public Set getCurrentImports()
     {
-        return OsgiPackage.createFromHeaders(mainAttributes.getValue(Constants.IMPORT_PACKAGE));
+        return OsgiPackage.createFromHeaders(mainAttributes.getValue(Constants.IMPORT_PACKAGE),
false);
     }
     
     /**
@@ -190,7 +190,7 @@
      */
     public Set getFixedExports()
     {
-        return OsgiPackage.createFromHeaders(mangenAttributes.getValue(Constants.EXPORT_PACKAGE));
+        return OsgiPackage.createFromHeaders(mangenAttributes.getValue(Constants.EXPORT_PACKAGE),
true);
     }
     
     /**
@@ -199,7 +199,7 @@
      */
     public Set getFixedImports()
     {
-        return OsgiPackage.createFromHeaders(mangenAttributes.getValue(Constants.IMPORT_PACKAGE));
+        return OsgiPackage.createFromHeaders(mangenAttributes.getValue(Constants.IMPORT_PACKAGE),
false);
     }
     
     /**

Modified: incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/OsgiPackage.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/OsgiPackage.java?view=diff&rev=497031&r1=497030&r2=497031
==============================================================================
--- incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/OsgiPackage.java
(original)
+++ incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/OsgiPackage.java
Wed Jan 17 06:52:32 2007
@@ -56,7 +56,7 @@
      * strings which contain ";" (the header attribute separator char). All
      * others we create as simple string packages
      */
-    public static Set createFromHeaders(String headers)
+    public static Set createFromHeaders(String headers, boolean export)
     {
         Set set = getNewSet();
         
@@ -70,7 +70,7 @@
                 if (pkgString.indexOf(';') != -1)
                 {
                     // parse and add all R4 packages contained (can be multiple)
-                    R4Package[]  pkgs = ManifestParser.parseImportExportHeader(pkgString);
+                    R4Package[]  pkgs = ManifestParser.parseImportExportHeader(pkgString,
export);
                     for (int ix = 0; ix < pkgs.length; ix++)
                     {
                         set.add(new OsgiR4Package(pkgs[ix]));

Modified: incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/rule/AttributeStamp.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/rule/AttributeStamp.java?view=diff&rev=497031&r1=497030&r2=497031
==============================================================================
--- incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/rule/AttributeStamp.java
(original)
+++ incubator/felix/trunk/tools/mangen/src/main/java/org/apache/felix/tool/mangen/rule/AttributeStamp.java
Wed Jan 17 06:52:32 2007
@@ -81,8 +81,8 @@
             rptOut.println("");            
             rptOut.println("> " + bund.getName() + " :");            
 
-            stampPackages(bund.getPossibleImports(), "imports");
-            stampPackages(bund.getPossibleExports(), "exports");
+            stampPackages(bund.getPossibleImports(), "imports", false);
+            stampPackages(bund.getPossibleExports(), "exports", true);
         }
     }
     
@@ -113,7 +113,7 @@
      * match will generate warnings and be skipped. 
      *
      */
-    protected void stampPackages(Set set, String qualName)
+    protected void stampPackages(Set set, String qualName, boolean export)
     {
         rptOut.println("");
         rptOut.println("... stamping packages in " + qualName);
@@ -123,7 +123,7 @@
             String stamp = getMatchingPatternString(pkg, qualName, true);
             if (stamp != null)
             {
-                stamp(pkg, stamp, set);
+                stamp(pkg, stamp, set, export);
             }
         }
     }
@@ -132,7 +132,7 @@
      * Stamp the supplied package with the specified attributes. This will be 
      * an error if the package is already an R4 pakage with conflicting attributes.
      */
-    protected void stamp(OsgiPackage pkg, String stamp, Set set)
+    protected void stamp(OsgiPackage pkg, String stamp, Set set, boolean export)
     {
         int delim = stamp.indexOf(";");
         
@@ -145,7 +145,7 @@
         // simple thing is to rebuild an OSGi header with attributes and use OsgiPackage

         // methods to parse this into an R4 package.
         String hdr = pkg.getName() + stamp.substring(delim);
-        OsgiPackage[] newPkgs = (OsgiPackage[]) OsgiPackage.createFromHeaders(hdr).toArray(new
OsgiPackage[0]);
+        OsgiPackage[] newPkgs = (OsgiPackage[]) OsgiPackage.createFromHeaders(hdr, export).toArray(new
OsgiPackage[0]);
         if (newPkgs.length != 1)
         {
             MangenMain.error(rptOut, "*** ERROR *** stamp doesn't create a single package
: " + stamp);



Mime
View raw message