I have this:
withSonarQubeEnv(SONAR_INSTANCE_NAME)
{
bat “${sqScannerMsBuildHome}\SonarScanner.MSBuild.exe begin /k:${projectSonarKey} /n:${projectSonarName} /v:1.0 /d:sonar.host.url=${sonarQubeUrl} /d:sonar.login=${login} /d:sonar.cfamily.build-wrapper-output=build_wrapper_output_directory”
bat “${MSBUILD} ${SOLUTION_FILE} /p:Configuration=Release /p:Platform=“Win32"”
bat “”${sonarScanner}” end /d:sonar.login=${login}"
}
I created build_wrapper_output_directory directory anticipating generated json file. Instead i got exception:
java.lang.IllegalStateException: java.nio.file.NoSuchFileException: D:\apps\jenkins\324b2421\workspace\CBPrimeCppBuild\build_wrapper_output_directory\build-wrapper-dump.json
There is a build-wrapper output directory parameter. What is wrong with my definition?
See Solution with Mix of C# and C++. I don’t see your script running the build-wrapper, which is what you need to combine with your ${MSBUILD} command. You need to combine build-wrapper with MSBUILD, then run the END step of SonarScanner for MSBuild.
Like that?
bat "build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory ${MSBUILD} ${SOLUTION_FILE} /p:Configuration=Release /p:Platform=“Win32"”
withSonarQubeEnv(SONAR_INSTANCE_NAME)
{
bat “${sqScannerMsBuildHome}\SonarScanner.MSBuild.exe begin /k:${projectSonarKey} /n:${projectSonarName} /v:1.0 /d:sonar.host.url=${sonarQubeUrl} /d:sonar.login=${login} /d:sonar.cfamily.build-wrapper-output=build_wrapper_output_directory”
bat "build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory ${MSBUILD} ${SOLUTION_FILE} /p:Configuration=Release /p:Platform=“Win32"”
bat “”${sonarScanner}” end /d:sonar.login=${login}"
}
What is wrong with below command. I think i passed all needed params.
D:\apps\jenkins\324b2421\workspace\CBPrimeCppBuild>"“D:\apps\sonar-scanner-msbuild\build-wrapper-win-x86\build-wrapper-win-x86-64.exe”" --out-dir build_wrapper_output_directory ““D:\apps\visualstudio\16.0\MSBuild\Current\Bin\msbuild.exe”” CBPrime_Repository_AsOf24Oct2014/convertibles/CBPrime_All.sln /p:Configuration=Release /p:Platform=“Win32”
build-wrapper, version 6.3 (win-x86-64)
Copyright (C) 2014-2019 SonarSource SA, info@sonarsource.com