]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5077 Rename property to enable indexation of all files
authorJulien HENRY <julien.henry@sonarsource.com>
Fri, 23 Jan 2015 11:23:51 +0000 (12:23 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Mon, 26 Jan 2015 09:19:38 +0000 (10:19 +0100)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputFileBuilder.java
sonar-core/src/main/java/org/sonar/core/config/ExclusionProperties.java
sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java

index 2187ca1cf85a58a7332633e5f9ab2f430ae9f177..a2a86e37fd5313aa576fc804ab3170bc68434628 100644 (file)
@@ -253,16 +253,6 @@ import java.util.List;
     project = true,
     global = false,
     category = CoreProperties.CATEGORY_SCM
-  ),
-  @Property(
-    key = CoreProperties.INDEX_ALL_FILES_KEY,
-    defaultValue = "false",
-    name = "Index all files",
-    description = "Should all files be indexed even if there is no matching language plugin installed.",
-    module = false,
-    project = true,
-    global = true,
-    category = CoreProperties.CATEGORY_GENERAL
   )
 })
 public final class CorePlugin extends SonarPlugin {
index b3aba4f61b0472d3e817127aff883290629c0cce..c97c47cf67de4074696be1edb054fcbf78e40c8c 100644 (file)
@@ -102,7 +102,7 @@ class InputFileBuilder {
     inputFile.setEncoding(fs.encoding().name());
 
     String lang = langDetection.language(inputFile);
-    if (lang == null && !settings.getBoolean(CoreProperties.INDEX_ALL_FILES_KEY)) {
+    if (lang == null && !settings.getBoolean(CoreProperties.IMPORT_UNKNOWN_FILES_KEY)) {
       return null;
     }
     inputFile.setLanguage(lang);
index 8b4df1a53f479a680cc5fc311cb21aa48117181d..3521520e74531683805941e8ef4ef112d3407be3 100644 (file)
@@ -46,22 +46,16 @@ public class ExclusionProperties {
         .build(),
 
       // FILES
-      PropertyDefinition.builder(CoreProperties.PROJECT_INCLUSIONS_PROPERTY)
-        .name("Source File Inclusions")
-        .multiValues(true)
+      PropertyDefinition.builder(CoreProperties.IMPORT_UNKNOWN_FILES_KEY)
+        .name("Import unknown files")
+        .description("If set to true, all files are imported - with respect to inclusions and exclusions, even if there is no matching language plugin installed.")
+        .type(PropertyType.BOOLEAN)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
         .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
         .onQualifiers(Qualifiers.PROJECT)
-        .index(3)
-        .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)
-        .index(5)
+        .index(-1)
         .build(),
+
       PropertyDefinition.builder(CoreProperties.GLOBAL_EXCLUSIONS_PROPERTY)
         .name("Global Source File Exclusions")
         .multiValues(true)
@@ -76,6 +70,25 @@ public class ExclusionProperties {
         .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
         .index(1)
         .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)
+        .index(0)
+        .build(),
+      PropertyDefinition.builder(CoreProperties.CORE_INCLUDED_MODULES_PROPERTY)
+        .name("Include Modules")
+        .description("Maven artifact ids of modules to include.")
+        .multiValues(true)
+        .category(CoreProperties.CATEGORY_EXCLUSIONS)
+        .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
+        .onlyOnQualifiers(Qualifiers.PROJECT)
+        .index(1)
+        .build(),
       PropertyDefinition.builder(CoreProperties.PROJECT_EXCLUSIONS_PROPERTY)
         .name("Source File Exclusions")
         .multiValues(true)
@@ -84,32 +97,32 @@ public class ExclusionProperties {
         .onQualifiers(Qualifiers.PROJECT)
         .index(2)
         .build(),
-      PropertyDefinition.builder(CoreProperties.PROJECT_TEST_EXCLUSIONS_PROPERTY)
-        .name("Test File Exclusions")
+
+      PropertyDefinition.builder(CoreProperties.PROJECT_INCLUSIONS_PROPERTY)
+        .name("Source File Inclusions")
         .multiValues(true)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
         .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
         .onQualifiers(Qualifiers.PROJECT)
-        .index(4)
+        .index(3)
         .build(),
-      PropertyDefinition.builder(CoreProperties.CORE_SKIPPED_MODULES_PROPERTY)
-        .name("Exclude Modules")
-        .description("Maven artifact ids of modules to exclude.")
+      PropertyDefinition.builder(CoreProperties.PROJECT_TEST_EXCLUSIONS_PROPERTY)
+        .name("Test File Exclusions")
         .multiValues(true)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
         .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
-        .onlyOnQualifiers(Qualifiers.PROJECT)
-        .index(0)
+        .onQualifiers(Qualifiers.PROJECT)
+        .index(4)
         .build(),
-      PropertyDefinition.builder(CoreProperties.CORE_INCLUDED_MODULES_PROPERTY)
-        .name("Include Modules")
-        .description("Maven artifact ids of modules to include.")
+      PropertyDefinition.builder(CoreProperties.PROJECT_TEST_INCLUSIONS_PROPERTY)
+        .name("Test File Inclusions")
         .multiValues(true)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
         .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
-        .onlyOnQualifiers(Qualifiers.PROJECT)
-        .index(1)
+        .onQualifiers(Qualifiers.PROJECT)
+        .index(5)
         .build()
+
       );
   }
 }
index 30e727324ad6bf4531d70581571226063748a641..e8eba56406848c99d5bc4cb298ca71d7eadbe10e 100644 (file)
@@ -556,5 +556,5 @@ public interface CoreProperties {
   /**
    * @since 5.1
    */
-  String INDEX_ALL_FILES_KEY = "sonar.index_all_files";
+  String IMPORT_UNKNOWN_FILES_KEY = "sonar.import_unknown_files";
 }