felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1512721 - in /felix/trunk/scrplugin/bnd-scr-plugin: pom.xml src/main/java/org/apache/felix/scrplugin/bnd/SCRDescriptorBndPlugin.java
Date Sat, 10 Aug 2013 14:23:23 GMT
Author: pderop
Date: Sat Aug 10 14:23:23 2013
New Revision: 1512721

URL: http://svn.apache.org/r1512721
Log:
FELIX-4135: the analyzeJar() method returns false. Deactivate scrplugin DS annotation scanner.

Append to Service-Component header.

Modified:
    felix/trunk/scrplugin/bnd-scr-plugin/pom.xml
    felix/trunk/scrplugin/bnd-scr-plugin/src/main/java/org/apache/felix/scrplugin/bnd/SCRDescriptorBndPlugin.java

Modified: felix/trunk/scrplugin/bnd-scr-plugin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/bnd-scr-plugin/pom.xml?rev=1512721&r1=1512720&r2=1512721&view=diff
==============================================================================
--- felix/trunk/scrplugin/bnd-scr-plugin/pom.xml (original)
+++ felix/trunk/scrplugin/bnd-scr-plugin/pom.xml Sat Aug 10 14:23:23 2013
@@ -54,12 +54,6 @@
 			<scope>compile</scope>
 		</dependency>
 		<dependency>
-			<groupId>org.apache.felix</groupId>
-			<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
-			<version>1.2.4</version>
-			<scope>compile</scope>
-		</dependency>
-		<dependency>
 			<groupId>org.ow2.asm</groupId>
 			<artifactId>asm-all</artifactId>
 			<version>4.0</version>
@@ -118,7 +112,7 @@
 						</goals>
 						<configuration>
 							<includeArtifactIds>
-								org.osgi.compendium,asm-all,org.apache.felix.scr.generator,org.apache.felix.scr.annotations,org.apache.felix.scr.ds-annotations
+								org.osgi.compendium,asm-all,org.apache.felix.scr.generator,org.apache.felix.scr.annotations
 							</includeArtifactIds>
 							<outputDirectory>
 								${project.build.outputDirectory}

Modified: felix/trunk/scrplugin/bnd-scr-plugin/src/main/java/org/apache/felix/scrplugin/bnd/SCRDescriptorBndPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/bnd-scr-plugin/src/main/java/org/apache/felix/scrplugin/bnd/SCRDescriptorBndPlugin.java?rev=1512721&r1=1512720&r2=1512721&view=diff
==============================================================================
--- felix/trunk/scrplugin/bnd-scr-plugin/src/main/java/org/apache/felix/scrplugin/bnd/SCRDescriptorBndPlugin.java
(original)
+++ felix/trunk/scrplugin/bnd-scr-plugin/src/main/java/org/apache/felix/scrplugin/bnd/SCRDescriptorBndPlugin.java
Sat Aug 10 14:23:23 2013
@@ -179,7 +179,7 @@ public class SCRDescriptorBndPlugin impl
 					putResource(analyzer, scrFile);
 				}
 				sb.setLength(sb.length() - 1);
-				analyzer.setProperty("Service-Component", sb.toString());
+				addServiceComponentHeader(analyzer, sb.toString());
 			}
 
 			// Embed metatype descriptors in target jar
@@ -196,7 +196,19 @@ public class SCRDescriptorBndPlugin impl
 		} finally {
 			log.close();
 		}
-		return true;
+		return false; // do not reanalyze bundle classpath because our plugin has not changed it.
+	}
+
+	private void addServiceComponentHeader(Analyzer analyzer, String components) {
+		String oldComponents = analyzer.getProperty("Service-Component");
+		if (oldComponents != null && oldComponents.length() > 0) {
+			StringBuilder sb = new StringBuilder(oldComponents);
+			sb.append(",");
+			sb.append(components);
+			components = sb.toString();
+		}
+		log.info("Setting Service-Component header: " + components);
+		analyzer.setProperty("Service-Component", components);
 	}
 
 	private void init(Analyzer analyzer) {



Mime
View raw message