felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r674479 - in /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin: BundlePlugin.java ManifestPlugin.java
Date Mon, 07 Jul 2008 13:04:51 GMT
Author: mcculls
Date: Mon Jul  7 06:04:51 2008
New Revision: 674479

URL: http://svn.apache.org/viewvc?rev=674479&view=rev
Log:
FELIX-620: update manifest goal to be compatible with the bundle goal

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.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=674479&r1=674478&r2=674479&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
Mon Jul  7 06:04:51 2008
@@ -362,7 +362,9 @@
         // update BND instructions to add included Maven resources
         includeMavenResources( currentProject, properties, getLog() );
 
-        if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) && !properties.containsKey(
Analyzer.PRIVATE_PACKAGE ) )
+        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", "." );

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java?rev=674479&r1=674478&r2=674479&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
(original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
Mon Jul  7 06:04:51 2008
@@ -23,6 +23,7 @@
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -95,14 +96,15 @@
     }
 
 
-    public Manifest getManifest( MavenProject project, Jar[] classpath ) throws IOException,
MojoFailureException
+    public Manifest getManifest( MavenProject project, Jar[] classpath )
+        throws IOException, MojoFailureException, MojoExecutionException
     {
         return getManifest( project, new Properties(), new Properties(), classpath );
     }
 
 
     public Manifest getManifest( MavenProject project, Map instructions, Properties properties,
Jar[] classpath )
-        throws IOException, MojoFailureException
+        throws IOException, MojoFailureException, MojoExecutionException
     {
         Analyzer analyzer = getAnalyzer( project, instructions, properties, classpath );
 
@@ -133,29 +135,16 @@
     }
 
 
-    protected Analyzer getAnalyzer( MavenProject project, Jar[] classpath ) throws IOException
+    protected Analyzer getAnalyzer( MavenProject project, Jar[] classpath )
+        throws IOException, MojoExecutionException
     {
         return getAnalyzer( project, new HashMap(), new Properties(), classpath );
     }
 
 
     protected Analyzer getAnalyzer( MavenProject project, Map instructions, Properties properties,
Jar[] classpath )
-        throws IOException
+        throws IOException, MojoExecutionException
     {
-        PackageVersionAnalyzer analyzer = new PackageVersionAnalyzer();
-
-        Properties props = getDefaultProperties( project );
-        props.putAll( properties );
-
-        if ( !instructions.containsKey( Analyzer.IMPORT_PACKAGE ) )
-        {
-            props.put( Analyzer.IMPORT_PACKAGE, "*" );
-        }
-
-        props.putAll( transformDirectives( instructions ) );
-
-        analyzer.setProperties( props );
-
         File file = project.getArtifact().getFile();
         if ( file == null )
         {
@@ -167,20 +156,33 @@
             throw new FileNotFoundException( file.getPath() );
         }
 
-        analyzer.setJar( file );
+        properties.putAll( getDefaultProperties( project ) );
+        properties.putAll( transformDirectives( instructions ) );
+
+        PackageVersionAnalyzer analyzer = new PackageVersionAnalyzer();
+        analyzer.setProperties( properties );
+
+        if ( project.getBasedir() != null )
+            analyzer.setBase( project.getBasedir() );
 
         if ( classpath != null )
             analyzer.setClasspath( classpath );
 
-        if ( !instructions.containsKey( Analyzer.PRIVATE_PACKAGE )
-            && !instructions.containsKey( Analyzer.EXPORT_PACKAGE ) )
+        analyzer.setJar( file );
+
+        if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) &&
+             !properties.containsKey( Analyzer.EXPORT_CONTENTS ) &&
+             !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
         {
             String export = analyzer.calculateExportsFromContents( analyzer.getJar() );
             analyzer.setProperty( Analyzer.EXPORT_PACKAGE, export );
         }
 
-        analyzer.mergeManifest( analyzer.getJar().getManifest() );
+        // Apply Embed-Dependency headers, even though the contents won't be changed
+        Collection embeddableArtifacts = getEmbeddableArtifacts( project, properties );
+        new DependencyEmbedder( embeddableArtifacts ).processHeaders( properties );
 
+        analyzer.mergeManifest( analyzer.getJar().getManifest() );
         analyzer.calcManifest();
 
         return analyzer;



Mime
View raw message