Hi,
I’m unable to analyse a cpp files using the below command
build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory MSBuild.exe /t:Rebuild as mentioned in this document (C/C++/Objective-C | SonarQube Docs)
My main concern is, how do i compile/analyse my cpp files in bitbucket pipeline under windows platform, as i’m trying the below mentioned script in my pipeline
- step: &build-test-windows
name: Build, test and analyze Windows
image: mcr.microsoft.com/powershell
caches:
- sonar
script:
- set SONAR_SCANNER_VERSION=4.4.0.2170
- set SONAR_SCANNER_OPTS=-Xmx1024m
- set SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-windows
- set PATH=$SONAR_SCANNER_HOME/bin:$PATH
- set BW_OUTPUT=$HOME/.sonar/bw-output
- mkdir %BW_OUTPUT%
- pwsh -Command {Invoke-WebRequest -Uri https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip -OutFile .}
- pwsh -Command {Invoke-WebRequest -Uri https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-windows.zip -OutFile .}
- pwsh -Command {Expand-Archive -LiteralPath build-wrapper.zip -DestinationPath $HOME/.sonar/}
- pwsh -Command {Expand-Archive -LiteralPath sonar-scanner.zip -DestinationPath $HOME/.sonar/}
- set PATH=$HOME/.sonar/build-wrapper-win-x86:$PATH
- build-wrapper-win-x86-64.exe --out-dir $BW_OUTPUT MSBuild.exe /t:Rebuild
- sonar-scanner -X -Dsonar.cfamily.build-wrapper-output=$BW_OUTPUT -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=ABC -Dsonar.projectKey=ABC_cpp-proj -Dsonar.sources=.
my output as mentioned below.
build-wrapper-win-x86-64.exe --out-dir $BW_OUTPUT MSBuild.exe /t:Rebuild`
bash: build-wrapper-win-x86-64.exe: command not found`
Thanks, will be waiting for your response.