[FELIX-4518] Provide a way to disable some plugins
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1596157 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 4411bc0..742052b 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -453,6 +453,24 @@
{
properties.remove("Bundle-Activator");
}
+ if (properties.containsKey("-disable-plugin"))
+ {
+ String[] disabled = properties.remove("-disable-plugin").toString().replaceAll(" ", "").split(",");
+ String[] enabled = properties.getProperty(Analyzer.PLUGIN, "").replaceAll(" ", "").split(",");
+ Set<String> plugin = new LinkedHashSet<String>();
+ plugin.addAll(Arrays.asList(enabled));
+ plugin.removeAll(Arrays.asList(disabled));
+ StringBuilder sb = new StringBuilder();
+ for (String s : plugin)
+ {
+ if (sb.length() > 0)
+ {
+ sb.append(",");
+ }
+ sb.append(sb);
+ }
+ properties.setProperty(Analyzer.PLUGIN, sb.toString());
+ }
Builder builder = new Builder();
synchronized ( BundlePlugin.class ) // protect setBase...getBndLastModified which uses static DateFormat