From fe30d1f601c2fbbb705a29890391eb21901a3143 Mon Sep 17 00:00:00 2001 From: Matteo Mara Date: Wed, 24 Jan 2024 16:48:48 +0100 Subject: [PATCH] SONAR-21195 Support deprecated file suffixes properties from optional analyzers --- .../scanner/bootstrap/SpringScannerContainer.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java index 1e0fbf0c2e5..16d66d5b460 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java @@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory; import org.sonar.api.batch.fs.internal.FileMetadata; import org.sonar.api.batch.rule.CheckFactory; import org.sonar.api.batch.sensor.issue.internal.DefaultNoSonarFilter; +import org.sonar.api.config.PropertyDefinition; import org.sonar.api.scan.filesystem.PathResolver; import org.sonar.api.utils.MessageException; import org.sonar.core.extension.CoreExtensionsInstaller; @@ -150,10 +151,23 @@ public class SpringScannerContainer extends SpringComponentContainer { @Override protected void doBeforeStart() { + addSuffixesDeprecatedProperties(); addScannerExtensions(); addComponents(); } + private void addSuffixesDeprecatedProperties() { + add( + /* This is needed to support properly the deprecated sonar.rpg.suffixes property when the download optimization feature is enabled. + The value of the property is needed at the preprocessing stage, but being defined by an optional analyzer means that at preprocessing + it won't be properly available. This will be removed in SQ 11.0 together with the drop of the property from the rpg analyzer. + See SONAR-21514 */ + PropertyDefinition.builder("sonar.rpg.file.suffixes") + .deprecatedKey("sonar.rpg.suffixes") + .multiValues(true) + .build()); + } + private void addScannerExtensions() { getParentComponentByType(CoreExtensionsInstaller.class) .install(this, noExtensionFilter(), extension -> getScannerProjectExtensionsFilter().accept(extension)); -- 2.39.5