Author: mcculls
Date: Tue Jul  8 23:48:49 2008
New Revision: 675105

URL: http://svn.apache.org/viewvc?rev=675105&view=rev
Log:
FELIX-620: special handling when only exportcontents is used

Modified:
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java?rev=675105&r1=675104&r2=675105&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
 Tue Jul  8 23:48:49 2008
@@ -363,13 +363,23 @@
         includeMavenResources( currentProject, properties, getLog() );
 
         if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) &&
-             !properties.containsKey( Analyzer.EXPORT_CONTENTS ) &&
              !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
         {
-            String bsn = properties.getProperty( Analyzer.BUNDLE_SYMBOLICNAME 
);
-            String namespace = bsn.replaceAll( "\\W", "." );
+            if ( properties.containsKey( Analyzer.EXPORT_CONTENTS ) )
+            {
+                /*
+                 * if we have exportcontents but no export packages or private 
packages then we're probably embedding or
+                 * inlining one or more jars, so set private package to a 
non-null (but empty) value to keep Bnd happy.
+                 */
+                properties.put( Analyzer.PRIVATE_PACKAGE, "!*" );
+            }
+            else
+            {
+                String bsn = properties.getProperty( 
Analyzer.BUNDLE_SYMBOLICNAME );
+                String namespace = bsn.replaceAll( "\\W", "." );
 
-            properties.put( Analyzer.EXPORT_PACKAGE, namespace + ".*" );
+                properties.put( Analyzer.EXPORT_PACKAGE, namespace + ".*" );
+            }
         }
 
         // update BND instructions to embed selected Maven dependencies


Reply via email to