aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-xoo-plugin
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2023-12-15 14:31:39 +0100
committersonartech <sonartech@sonarsource.com>2024-01-04 20:02:48 +0000
commitf8465c0d33ceb835c92f0b24e7842ba96c7604e0 (patch)
treee6b4bf5fec92c471e7510ee92b003fbc49dc24fa /plugins/sonar-xoo-plugin
parentaec0c95e903db2ab7fdc3dfc6e90421e6342a277 (diff)
downloadsonarqube-f8465c0d33ceb835c92f0b24e7842ba96c7604e0.tar.gz
sonarqube-f8465c0d33ceb835c92f0b24e7842ba96c7604e0.zip
SONAR-21195 Refactor file indexing into two distinct steps
Diffstat (limited to 'plugins/sonar-xoo-plugin')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java4
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java31
2 files changed, 34 insertions, 1 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
index 5277c977da7..277a14bea00 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
@@ -27,6 +27,7 @@ import org.sonar.api.resources.Qualifiers;
import org.sonar.xoo.coverage.ItCoverageSensor;
import org.sonar.xoo.coverage.OverallCoverageSensor;
import org.sonar.xoo.coverage.UtCoverageSensor;
+import org.sonar.xoo.extensions.XooExcludeFileFilter;
import org.sonar.xoo.extensions.XooIssueFilter;
import org.sonar.xoo.extensions.XooPostJob;
import org.sonar.xoo.extensions.XooProjectBuilder;
@@ -204,7 +205,8 @@ public class XooPlugin implements Plugin {
XooIssueFilter.class,
XooIgnoreCommand.class,
SignificantCodeSensor.class,
- IssueWithCodeVariantsSensor.class);
+ IssueWithCodeVariantsSensor.class,
+ XooExcludeFileFilter.class);
if (context.getRuntime().getProduct() != SonarProduct.SONARLINT) {
context.addExtension(MeasureSensor.class);
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java
new file mode 100644
index 00000000000..32b31cad93a
--- /dev/null
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooExcludeFileFilter.java
@@ -0,0 +1,31 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.xoo.extensions;
+
+import org.sonar.api.batch.fs.InputFile;
+import org.sonar.api.batch.fs.InputFileFilter;
+
+public class XooExcludeFileFilter implements InputFileFilter {
+
+ @Override
+ public boolean accept(InputFile f) {
+ return !f.filename().endsWith("_exclude.xoo");
+ }
+}