When I run “build-wrapper-win-x86-64.exe --out-dir bw-output arduino-cli compile --fqbn esp8266:esp8266:d1_mini tag.ino” on Arduino CLI, it works.
I got very similar errors when I run sonar-scanner.bat -D"sonar.organization=[organizationkey]" -D"sonar.projectKey=[projectkey]" -D"sonar.sources=." -D"sonar.cfamily.build-wrapper-output=bw-output" -D"sonar.host.url=https://sonarcloud.io"
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
you are using the latest version of the build-wrapper and the CFamily analyzer
you are correctly invoking the scanner with correct configuration
your compiler is supported
you are wrapping your build correctly
you are wrapping a full/clean build
you are providing the path to the correct build-wrapper output directory
you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
Thanks for the info. I had difficulty following the .travis.yml. I have to build a CI pipeline on Azure DevOps, and the build pipeline is mainly using Arduino CLI tasks. From my understanding I have to run ArduinoCliBuild using Arduino CLI task and analyse using sonarcloud at the same time, how do I do that?
Due to the urgency of source code scan, I have decided to do the scan on my local machine instead. As I mentioned in the post, when I run “build-wrapper-win-x86-64.exe --out-dir bw-output arduino-cli compile --fqbn esp8266:esp8266:d1_mini tag.ino” on Arduino CLI, it works. However, I got the error during sonarscanner execution. I can send the build-wrapper-dump.json and sonarscanner log via PM to help in diagnosis.
Thanks for the suggestion. I tried on my local machine and it works. Next step, I will attempt doing this on project build pipeline and update here once I try.