You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2013/05/05 16:45:08 UTC

svn commit: r1479334 - in /felix/trunk/scrplugin/maven-scr-plugin: changelog.txt src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java

Author: cziegeler
Date: Sun May  5 14:45:08 2013
New Revision: 1479334

URL: http://svn.apache.org/r1479334
Log:
FELIX-4049 : SCR-Plugin creates invalid manifest-header on incremental-build (eclipse-IDE-integration)

Modified:
    felix/trunk/scrplugin/maven-scr-plugin/changelog.txt
    felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java

Modified: felix/trunk/scrplugin/maven-scr-plugin/changelog.txt
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/maven-scr-plugin/changelog.txt?rev=1479334&r1=1479333&r2=1479334&view=diff
==============================================================================
--- felix/trunk/scrplugin/maven-scr-plugin/changelog.txt (original)
+++ felix/trunk/scrplugin/maven-scr-plugin/changelog.txt Sun May  5 14:45:08 2013
@@ -1,3 +1,9 @@
+Changes from 1.13.0 to 1.12.0
+-----------------------------
+** Bug
+    * [FELIX-4049] - SCR-Plugin creates invalid manifest-header on incremental-build (eclipse-IDE-integration)
+   
+
 Changes from 1.12.0 to 1.11.0
 -----------------------------
 ** Improvement

Modified: felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java?rev=1479334&r1=1479333&r2=1479334&view=diff
==============================================================================
--- felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java (original)
+++ felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java Sun May  5 14:45:08 2013
@@ -246,7 +246,7 @@ public class SCRDescriptorMojo extends A
             }
 
             final Result result = generator.execute();
-            this.setServiceComponentHeader(result.getScrFiles());
+            this.setServiceComponentHeader();
 
             this.updateProjectResources();
             // don't try to delete per-class descriptors if only one descriptor is generated
@@ -398,10 +398,11 @@ public class SCRDescriptorMojo extends A
     }
 
     /**
-     * Set the service component header based on the scr files.
+     * Set the service component header based on the files in the output directory
      */
-    private void setServiceComponentHeader(final List<String> files) {
-        if ( files != null && files.size() > 0 ) {
+    private void setServiceComponentHeader() {
+        final File osgiInfDir = new File(this.outputDirectory, "OSGI-INF");
+        if ( osgiInfDir.exists() ) {
             final String svcHeader = project.getProperties().getProperty("Service-Component");
             final Set<String> xmlFiles = new HashSet<String>();
             if ( svcHeader != null ) {
@@ -412,8 +413,10 @@ public class SCRDescriptorMojo extends A
                 }
             }
 
-            for(final String path : files) {
-                xmlFiles.add(path);
+            for(final File f : osgiInfDir.listFiles()) {
+                if ( f.isFile() && f.getName().endsWith(".xml") ) {
+                    xmlFiles.add("OSGI-INF/" + f.getName());
+                }
             }
             final StringBuilder sb = new StringBuilder();
             boolean first = true;