You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by mc...@apache.org on 2012/02/11 19:31:45 UTC
svn commit: r1243117 -
/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
Author: mcculls
Date: Sat Feb 11 18:31:45 2012
New Revision: 1243117
URL: http://svn.apache.org/viewvc?rev=1243117&view=rev
Log:
FELIX-3254: automatically rebuild bundle in-memory when using manifest goal with target/classes and Embed-Dependency
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
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=1243117&r1=1243116&r2=1243117&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 Sat Feb 11 18:31:45 2012
@@ -183,10 +183,11 @@ public class ManifestPlugin extends Bund
// the contents of the bundle *and* we are not analyzing the output directory,
// otherwise fall-back to addMavenInstructions approach
+ boolean isOutputDirectory = file.equals( getOutputDirectory() );
+
if ( analyzer.getProperty( Analyzer.EXPORT_PACKAGE ) == null
&& analyzer.getProperty( Analyzer.EXPORT_CONTENTS ) == null
- && analyzer.getProperty( Analyzer.PRIVATE_PACKAGE ) == null
- && !file.equals( getOutputDirectory() ) )
+ && analyzer.getProperty( Analyzer.PRIVATE_PACKAGE ) == null && !isOutputDirectory )
{
String export = calculateExportsFromContents( analyzer.getJar() );
analyzer.setProperty( Analyzer.EXPORT_PACKAGE, export );
@@ -194,8 +195,16 @@ public class ManifestPlugin extends Bund
addMavenInstructions( project, analyzer );
- analyzer.mergeManifest( analyzer.getJar().getManifest() );
- analyzer.calcManifest();
+ // if we spot Embed-Dependency and the bundle is "target/classes", assume we need to rebuild
+ if ( analyzer.getProperty( DependencyEmbedder.EMBED_DEPENDENCY ) != null && isOutputDirectory )
+ {
+ analyzer.build();
+ }
+ else
+ {
+ analyzer.mergeManifest( analyzer.getJar().getManifest() );
+ analyzer.calcManifest();
+ }
mergeMavenManifest( project, analyzer );