felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1596157 - /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Date Tue, 20 May 2014 09:09:13 GMT
Author: gnodet
Date: Tue May 20 09:09:12 2014
New Revision: 1596157

URL: http://svn.apache.org/r1596157
Log:
[FELIX-4518] Provide a way to disable some plugins

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.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=1596157&r1=1596156&r2=1596157&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
Tue May 20 09:09:12 2014
@@ -453,6 +453,24 @@ public class BundlePlugin extends Abstra
         {
             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 



Mime
View raw message