Problem: Using FOR Loop to cycle through array of build commands actually does nothing.
I have the dotnet-sonarscanner working if I do not use the FOR Loop.
Now, I want the ability to run multiple build commands after the “dotnet sonarscanner begin…” command. This way Sonarqube will scan the whole project.
I use a Powershell script to run all the commands. This currently works:
- dotnet test …
- dotnet build-server shutdown
- dotnet sonarscanner begin
- dotnet build
- dotnet sonarscanner end
This does not work
- dotnet test …
- dotnet build-server shutdown
- dotnet sonarscanner begin
- FOR Loop (loop through array of build commands)
{
dotnet build
} - dotnet sonarscanner end
There is zero output from the FOR Loop. and then “dotnet sonarscanner end” fails since there is no analysis.
This even happens if I only have 1 solution file in the array. It seems Sonarqube will not let the FOR Loop execute. It seems it wants the next command to be dotnet build …
I am running this version:
Package Id Version Commands
dotnet-sonarscanner 4.10.0 dotnet-sonarscanner