Skip to content

Commit

Permalink
Multi-language support: Re-enable sonar.sources and sonar.tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-paidis-sonarsource committed Sep 6, 2024
1 parent 6afe704 commit 3b73e8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/SonarScanner.MSBuild.PreProcessor/ProcessedArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,6 @@ public ProcessedArgs(
? architecture.Value
: RuntimeInformation.OSArchitecture.ToString().ToLowerInvariant();

if (AggregateProperties.HasProperty(SonarProperties.SonarSources)
|| AggregateProperties.HasProperty(SonarProperties.SonarTests))
{
IsValid = false;
logger.LogError(Resources.ERROR_SonarSourcesAndTestsNotSupported);
}
if (AggregateProperties.TryGetProperty(SonarProperties.JavaExePath, out var javaExePath))
{
if (!fileWrapper.Exists(javaExePath.Value))
Expand Down
6 changes: 5 additions & 1 deletion src/SonarScanner.MSBuild.Shim/AdditionalFilesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ private static bool IsExcludedDirectory(DirectoryInfo directory) =>
part => part.Equals(x, StringComparison.OrdinalIgnoreCase)));

private static string FirstUserSpecifiedSonarParameter(AnalysisConfig analysisConfig) =>
SonarProperties.ScanAllWarningParameters.FirstOrDefault(x => analysisConfig.LocalSettings.Exists(setting => setting.Id == x));
FirstUserSpecifiedSonarParameter(analysisConfig.LocalSettings)
?? FirstUserSpecifiedSonarParameter(analysisConfig.ServerSettings);

private static string FirstUserSpecifiedSonarParameter(AnalysisProperties properties) =>
SonarProperties.ScanAllWarningParameters.FirstOrDefault(x => properties.Exists(setting => setting.Id == x));

private static AdditionalFiles PartitionAdditionalFiles(FileInfo[] allFiles, AnalysisConfig analysisConfig)
{
Expand Down

0 comments on commit 3b73e8c

Please sign in to comment.