aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-11-27 00:38:18 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-11-27 00:38:18 +0100
commit4b0679d4670f131be4e6f5905a48b5bb5f2396e0 (patch)
tree6d091553ca4e549ab6a8d2a0daa4031233b54615 /sonar-batch
parent13ef8a8d4ebb984df8cc1f3507cc7335109c6580 (diff)
downloadsonarqube-4b0679d4670f131be4e6f5905a48b5bb5f2396e0.tar.gz
sonarqube-4b0679d4670f131be4e6f5905a48b5bb5f2396e0.zip
SONAR-3895 fix the default values of sonar.dryRun.excludePlugins/includePlugins
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
index c0dddd09215..1ea9307364d 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
@@ -122,8 +122,12 @@ public class BatchPluginRepository implements PluginRepository {
blacks.addAll(Arrays.asList(settings.getStringArray(CoreProperties.BATCH_EXCLUDE_PLUGINS)));
}
if (settings.getBoolean(CoreProperties.DRY_RUN)) {
- whites.addAll(Arrays.asList(settings.getStringArray(CoreProperties.DRY_RUN_INCLUDE_PLUGINS)));
- blacks.addAll(Arrays.asList(settings.getStringArray(CoreProperties.DRY_RUN_EXCLUDE_PLUGINS)));
+ // These default values are not supported by Settings because the class CorePlugin
+ // is not loaded yet.
+ whites.addAll(propertyValues(settings,
+ CoreProperties.DRY_RUN_INCLUDE_PLUGINS, CoreProperties.DRY_RUN_INCLUDE_PLUGINS_DEFAULT_VALUE));
+ blacks.addAll(propertyValues(settings,
+ CoreProperties.DRY_RUN_EXCLUDE_PLUGINS, CoreProperties.DRY_RUN_EXCLUDE_PLUGINS_DEFAULT_VALUE));
}
if (!whites.isEmpty()) {
LOG.info("Include plugins: " + Joiner.on(", ").join(whites));
@@ -133,6 +137,11 @@ public class BatchPluginRepository implements PluginRepository {
}
}
+ static List<String> propertyValues(Settings settings, String key, String defaultValue) {
+ String s = StringUtils.defaultIfEmpty(settings.getString(key), defaultValue);
+ return Arrays.asList(StringUtils.split(s, ","));
+ }
+
boolean accepts(String pluginKey) {
if (CORE_PLUGIN.equals(pluginKey) || ENGLISH_PACK_PLUGIN.equals(pluginKey)) {
return true;