aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java104
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties5
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java5
3 files changed, 65 insertions, 49 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 3f25e46fb09..aa252eb0fdb 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -19,6 +19,9 @@
*/
package org.sonar.plugins.core;
+import org.sonar.api.resources.Qualifiers;
+
+import org.sonar.api.config.PropertyDefinition;
import com.google.common.collect.ImmutableList;
import org.sonar.api.CoreProperties;
import org.sonar.api.Properties;
@@ -181,45 +184,6 @@ import java.util.List;
global = true,
category = CoreProperties.CATEGORY_GENERAL),
@Property(
- key = CoreProperties.PROJECT_INCLUSIONS_PROPERTY,
- name = "Source File Inclusions",
- project = true,
- global = true,
- multiValues = true,
- category = CoreProperties.CATEGORY_EXCLUSIONS),
- @Property(
- key = CoreProperties.PROJECT_TEST_INCLUSIONS_PROPERTY,
- name = "Test File Inclusions",
- project = true,
- global = true,
- multiValues = true,
- category = CoreProperties.CATEGORY_EXCLUSIONS),
- @Property(
- key = CoreProperties.GLOBAL_EXCLUSIONS_PROPERTY,
- name = "Global Source File Exclusions",
- multiValues = true,
- category = CoreProperties.CATEGORY_EXCLUSIONS),
- @Property(
- key = CoreProperties.GLOBAL_TEST_EXCLUSIONS_PROPERTY,
- name = "Global Test File Exclusions",
- multiValues = true,
- category = CoreProperties.CATEGORY_EXCLUSIONS,
- defaultValue = CoreProperties.GLOBAL_TEST_EXCLUSIONS_DEFAULT),
- @Property(
- key = CoreProperties.PROJECT_EXCLUSIONS_PROPERTY,
- name = "Source File Exclusions",
- project = true,
- global = true,
- multiValues = true,
- category = CoreProperties.CATEGORY_EXCLUSIONS),
- @Property(
- key = CoreProperties.PROJECT_TEST_EXCLUSIONS_PROPERTY,
- name = "Test File Exclusions",
- project = true,
- global = true,
- multiValues = true,
- category = CoreProperties.CATEGORY_EXCLUSIONS),
- @Property(
key = CoreProperties.CORE_IMPORT_SOURCES_PROPERTY,
defaultValue = "" + CoreProperties.CORE_IMPORT_SOURCES_DEFAULT_VALUE,
name = "Import sources",
@@ -230,14 +194,6 @@ import java.util.List;
category = CoreProperties.CATEGORY_SECURITY,
type = PropertyType.BOOLEAN),
@Property(
- key = CoreProperties.CORE_SKIPPED_MODULES_PROPERTY,
- name = "Exclude modules",
- description = "Maven artifact ids of modules to exclude.",
- project = true,
- global = false,
- multiValues = true,
- category = CoreProperties.CATEGORY_EXCLUSIONS),
- @Property(
key = CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY,
defaultValue = "" + CoreProperties.CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE,
name = "Force user authentication",
@@ -528,8 +484,62 @@ public final class CorePlugin extends SonarPlugin {
NewAlerts.class,
NewAlerts.newMetadata());
+ extensions.addAll(getPropertyDefinitions());
extensions.addAll(IgnoreIssuesPlugin.getExtensions());
return extensions.build();
}
+
+ private static List<PropertyDefinition> getPropertyDefinitions() {
+ return ImmutableList.of(
+ PropertyDefinition.builder(CoreProperties.PROJECT_INCLUSIONS_PROPERTY)
+ .name("Source File Inclusions")
+ .multiValues(true)
+ .category(CoreProperties.CATEGORY_EXCLUSIONS)
+ .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+ .onQualifiers(Qualifiers.PROJECT)
+ .build(),
+ PropertyDefinition.builder(CoreProperties.PROJECT_TEST_INCLUSIONS_PROPERTY)
+ .name("Test File Inclusions")
+ .multiValues(true)
+ .category(CoreProperties.CATEGORY_EXCLUSIONS)
+ .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+ .onQualifiers(Qualifiers.PROJECT)
+ .build(),
+ PropertyDefinition.builder(CoreProperties.GLOBAL_EXCLUSIONS_PROPERTY)
+ .name("Global Source File Exclusions")
+ .multiValues(true)
+ .category(CoreProperties.CATEGORY_EXCLUSIONS)
+ .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+ .build(),
+ PropertyDefinition.builder(CoreProperties.GLOBAL_TEST_EXCLUSIONS_PROPERTY)
+ .name("Global Test File Exclusions")
+ .multiValues(true)
+ .category(CoreProperties.CATEGORY_EXCLUSIONS)
+ .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+ .defaultValue(CoreProperties.GLOBAL_TEST_EXCLUSIONS_DEFAULT)
+ .build(),
+ PropertyDefinition.builder(CoreProperties.PROJECT_EXCLUSIONS_PROPERTY)
+ .name("Source File Exclusions")
+ .multiValues(true)
+ .category(CoreProperties.CATEGORY_EXCLUSIONS)
+ .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+ .onQualifiers(Qualifiers.PROJECT)
+ .build(),
+ PropertyDefinition.builder(CoreProperties.PROJECT_TEST_EXCLUSIONS_PROPERTY)
+ .name("Test File Exclusions")
+ .multiValues(true)
+ .category(CoreProperties.CATEGORY_EXCLUSIONS)
+ .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+ .onQualifiers(Qualifiers.PROJECT)
+ .build(),
+ PropertyDefinition.builder(CoreProperties.CORE_SKIPPED_MODULES_PROPERTY)
+ .name("Exclude Modules")
+ .description("Maven artifact ids of modules to exclude.")
+ .multiValues(true)
+ .category(CoreProperties.CATEGORY_EXCLUSIONS)
+ .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+ .onlyOnQualifiers(Qualifiers.PROJECT)
+ .build());
+ }
}
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
index 35da9dab6cb..bc5fafc667b 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
@@ -723,8 +723,9 @@ property.sonar.global.exclusions.name=Global Source File Exclusions
property.sonar.global.exclusions.description=Patterns used to exclude some source files from analysis. They apply to every project and cannot be overridden.
property.sonar.global.test.exclusions.name=Global Test File Exclusions
property.sonar.global.test.exclusions.description=Patterns used to exclude some test files from analysis. They apply to every project and cannot be overridden.
-property.category.exclusions.description=Configure which source code and tests you want to be omitted from analysis. Most of these parameters can also be configured at individual project level in each application's project settings.
-category.exclusions.help=<h2>Wildcards</h2>\
+property.category.exclusions.files=Files
+property.category.exclusions.files.description=Configure which source code and tests you want to be omitted from analysis. Most of these parameters can also be configured at individual project level in each application's project settings.
+category.exclusions.files.help=<h2>Wildcards</h2>\
<p>Following rules are applied:</p>\
<table class="data">\
<thead><tr><th colspan="2"></th></tr></thead>\
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
index 027b5d9a4e8..514ecb2a372 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
@@ -73,6 +73,11 @@ public interface CoreProperties {
String CATEGORY_EXCLUSIONS = "exclusions";
/**
+ * @since 4.0
+ */
+ String SUBCATEGORY_FILES_EXCLUSIONS = "files";
+
+ /**
* @since 3.7
*/
String CATEGORY_LICENSES = "licenses";