Hello,
I’m trying to scan a solution with a mix of projects in c++ and c#. For that, I’m using the following tasks in my pipeline:
- task: PowerShell@2
displayName: Get the latest version of the SonarCloud BuildWrapper for C++
condition: and(succeeded(),eq(variables['executeSonarAnalisys'],'yes'))
continueOnError: true
inputs:
targetType: 'inline'
script: |
Invoke-WebRequest -Uri 'https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip' -OutFile 'build-wrapper.zip'
Expand-Archive -Path 'build-wrapper.zip' -DestinationPath '$(Agent.BuildDirectory)\'
showWarnings: true
- task: SonarCloudPrepare@1
displayName: Sonar Cloud Prepare
condition: and(succeeded(),eq(variables['executeSonarAnalisys'],'yes'))
inputs:
SonarCloud: 'blblablabla'
organization: 'bleblebleble'
scannerMode: 'MSBuild'
configMode: 'manual'
cliProjectKey: 'myprojectkey'
cliProjectName: 'ProjectName'
cliProjectVersion: '1.3.1.0'
projectKey: 'myprojectkey'
projectName: 'ProjectName'
projectVersion: '1.3.1.0'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
sonar.exclusions=pipelines/**, 3rdPartyLibs/**, build/**, Backup/**, Debug/**, **/bin/**, **/x86/**, **/x64/**, **/debug/**, **/release/**, Web/**
sonar.cfamily.build-wrapper-output=$(Agent.BuildDirectory)
sonar.cfamily.cache.enabled=false
sonar.log.level=DEBUG
sonar.verbose=true
- task: CmdLine@2
condition: and(succeeded(),eq(variables['executeSonarAnalisys'],'yes'))
inputs:
script: |
"$(Agent.BuildDirectory)\build-wrapper-win-x86\build-wrapper-win-x86-64.exe" --out-dir $(Agent.BuildDirectory) "%msbuildpath%" "DigitalTV_Projects_v2.sln" /p:Configuration=$(buildConfiguration) /p:Platform=$(buildPlatform)
dir $(Agent.BuildDirectory)\
- task: SonarCloudAnalyze@1
condition: and(succeeded(),eq(variables['executeSonarAnalisys'],'yes'))
continueOnError: true
- task: SonarCloudPublish@1
condition: and(succeeded(),eq(variables['executeSonarAnalisys'],'yes'))
continueOnError: true
inputs:
pollingTimeoutSec: '300'
The pipeline executes correctly and the solution is built OK and completely, but in the final summary MANY c# projects are missing (but not all!!!).
The finishing log of the analyze part:
12:15:49.623 INFO: CPD Executor CPD calculation finished (done) | time=344ms
12:15:51.994 DEBUG: Could not detect the dotnet / msbuild version
12:15:52.604 INFO: Analysis report generated in 2918ms, dir size=24 MB
12:15:54.570 INFO: Analysis report compressed in 1966ms, zip size=7 MB
12:15:54.570 INFO: Analysis report generated in D:\a\1\.sonarqube\out\.sonar\scanner-report
12:15:54.570 DEBUG: Upload report
12:15:55.422 DEBUG: POST 200 https://sonarcloud.io/api/ce/submit?organization=bñabñabña&projectKey=bñabñebñebñe&projectName=lolollo | time=852ms
12:15:55.425 INFO: Analysis report uploaded in 855ms
12:15:55.425 DEBUG: Report metadata written to D:\a\_temp\sonar\20220831.7\0afbeee0-7681-e173-926a-c1ba4d01aa09\report-task.txt
12:15:55.425 INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=lolololo
12:15:55.425 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
12:15:55.425 INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AYLz1FVYZCbh_BmWFY4L
12:15:55.425 DEBUG: Post-jobs :
12:15:55.425 INFO: Closing heartbeat service
12:15:55.534 INFO: Analysis total time: 11:48.341 s
12:15:55.534 INFO: ------------------------------------------------------------------------
12:15:55.534 INFO: EXECUTION SUCCESS
12:15:55.534 INFO: ------------------------------------------------------------------------
12:15:55.534 INFO: Total time: 12:02.104s
12:15:55.784 INFO: Final Memory: 43M/144M
12:15:55.784 INFO: ------------------------------------------------------------------------
Process returned exit code 0
The SonarScanner CLI has finished
12:15:56.41 Post-processing succeeded.
If I execute the pipeline using the PrepareTask with scannerMode: MSBuild, then all c# projects appear, but obviously then all the c++ projects are missing.
Any ideas on how to get results for both c++ and c# projects together please?
Thank you!
Jordi.