Note that the project is not based on .project or .sln file, its a folder from a microchip project
Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Server ID 10173C1E-AW-OunQtiDNiDb7hDFkk Version 220.127.116.11237 SonarCFamilyLANGUAGES Code Analyzer for C, C++, Objective-C 6.5.0 (build 12506)installed I currentlty have a 2 week trial edition of the developer edition
- what are you trying to achieve
I try to analyse a folder containing .c and .h files for misra faults. Note there is no other files just 1 folder containing source files.
- what have you tried so far to achieve this
I created a folder named trunk. Inside this folder I created a folder named source and in this folder I placed a lot of .c and .h files. Then I added another folder named analyse in the folder trunk.
I then run the following command.
sonar-scanner.bat -X -Dsonar.host.url=http://10.10.20.211:9001 -Dsonar.login=dbcc2f2e50fc45d5b8b9129d4de69bc38fe888bd -Dsonar.sourceEncoding=UTF-8 -Dsonar.sources=source -Dsonar.working.directory=sonarWD -Dsonar.projectKey=mykey- -Dsonar.cfamily.build-wrapper-output=analyse -Dsonar.sourceEncoding=UTF-8"
I got a warning message with:
java.lang.IllegalStateException: java.nio.file.NoSuchFileException: C:\trunk\analyse\build-wrapper-dump.json at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:340)
I then looked in the documentation and found I need to execute a process named:
build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory MSBuild.exe /t:Rebuild
This is strange for me. Because Msbuild is based on .project or .sln file to build code.
But in this case I only want that sonarqube analyse the .c and .h files and shows me faults in sonarqube. I dont want to build any code I want to analyse a source folder.
What is going on here or isnt sonarqube capable of this?
I created a project file manual named: project.vcxproj
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" /> <PropertyGroup> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ItemGroup> <ClCompile Include="source/action_states.c" /> </ItemGroup> <ItemGroup> <ClInclude Include="source/action_states.h" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" /> </Project>
Then I ran the msbuild command in any hope and got this
C:\build-wrapper-win-x86-64.exe --out-dir C:\trunk\analyse C:\trunk\MSBuild.exe /t:Rebuild [SONARSOURCE BUILD-WRAPPER] failed to execute C:\trunk\MSBuild.exe /t:Rebuild: The system cannot find the file specified.