felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1035946 - /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Date Wed, 17 Nov 2010 08:09:42 GMT
Author: gnodet
Date: Wed Nov 17 08:09:42 2010
New Revision: 1035946

URL: http://svn.apache.org/viewvc?rev=1035946&view=rev
Log:
[FELIX-2701] Add a {local-packages} macro for automatically expanding local packages in the
<Export-Package> instruction

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=1035946&r1=1035945&r2=1035946&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
Wed Nov 17 08:09:42 2010
@@ -186,6 +186,7 @@ public class BundlePlugin extends Abstra
 
     private static final String MAVEN_SYMBOLICNAME = "maven-symbolicname";
     private static final String MAVEN_RESOURCES = "{maven-resources}";
+    private static final String LOCAL_PACKAGES = "{local-packages}";
 
     private static final String[] EMPTY_STRING_ARRAY =
         {};
@@ -378,11 +379,7 @@ public class BundlePlugin extends Abstra
         includeMavenResources( currentProject, builder, getLog() );
 
         // calculate default export/private settings based on sources
-        if ( builder.getProperty( Analyzer.PRIVATE_PACKAGE ) == null
-            || builder.getProperty( Analyzer.EXPORT_PACKAGE ) == null )
-        {
-            addLocalPackages( currentProject.getCompileSourceRoots(), builder );
-        }
+        addLocalPackages( currentProject.getCompileSourceRoots(), builder );
 
         // update BND instructions to embed selected Maven dependencies
         Collection embeddableArtifacts = getEmbeddableArtifacts( currentProject, builder
);
@@ -955,7 +952,11 @@ public class BundlePlugin extends Abstra
             // we can't export the default package (".") and we shouldn't export internal
packages 
             if ( !( ".".equals( pkg ) || pkg.contains( ".internal" ) || pkg.contains( ".impl"
) ) )
             {
-                exportedPkgs.append( pkg ).append( ',' );
+                if( exportedPkgs.length() > 0 )
+                {
+                    exportedPkgs.append( ';' );
+                }
+                exportedPkgs.append( pkg );
             }
         }
 
@@ -972,6 +973,16 @@ public class BundlePlugin extends Abstra
                 analyzer.setProperty( Analyzer.EXPORT_PACKAGE, "" );
             }
         }
+        else
+        {
+            String exported = analyzer.getProperty( Analyzer.EXPORT_PACKAGE );
+            if( exported.indexOf( LOCAL_PACKAGES ) >= 0 )
+            {
+                String newExported = StringUtils.replace( exported, LOCAL_PACKAGES, exportedPkgs.toString()
);
+                analyzer.setProperty( Analyzer.EXPORT_PACKAGE, newExported );
+
+            }
+        }
 
         if ( analyzer.getProperty( Analyzer.PRIVATE_PACKAGE ) == null )
         {



Mime
View raw message