-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
30 lines (30 loc) · 1.56 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
jobs:
- job: BuildWindowsWithSonarQube
displayName: Build for Windows\MSBuild With SonarQube
pool:
vmImage: 'windows-latest'
variables:
SONARQUBE_HOST_URL: https://next.sonarqube.com/sonarqube
steps:
# Make Build Wrapper available
- task: SonarQubePrepare@5
inputs:
SonarQube: 'SonarQube' # Name of the SonarQube service endpoint you created
scannerMode: 'CLI'
configMode: 'file'
extraProperties:
"sonar.cfamily.compile-commands=build_wrapper_output_directory/compile_commands.json"
# if you are using using SonarQube 10.5 or earlier, replace "sonar.cfamily.compile-commands=build_wrapper_output_directory/compile_commands.json"
# with "sonar.cfamily.build-wrapper-output=build_wrapper_output_directory", as build-wrapper does not generate a compile_commands.json file before SonarQube 10.6
- pwsh: |
curl --create-dirs -sSLo $HOME\.sonar\build-wrapper-win-x86.zip ${{variables.SONARQUBE_HOST_URL}}/static/cpp/build-wrapper-win-x86.zip
unzip -o $HOME\.sonar\build-wrapper-win-x86.zip -d $HOME\.sonar\
displayName: Download and install build wrapper
- pwsh: |
$path = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
& "$HOME\.sonar\build-wrapper-win-x86\build-wrapper-win-x86-64.exe" --out-dir build_wrapper_output_directory $path sonar_scanner_example.vcxproj /t:rebuild /nodeReuse:false
workingDirectory: .
displayName: Build in build-wrapper
- task: SonarQubeAnalyze@5
inputs:
jdkversion: 'JAVA_HOME_17_X64'