I have C++ projects with source code libraries in sub-modules and am using the Sonar commercial C++ plugin. I wish to analyze all the sources.
The parent project needs access to some of the headers (and compiled libs) in the sub-modules and therefore by using sub-modules I can readily pin (and hence compile against) the right library version.
eg ./main.c contains #include sub/someinclude.h
where sub is the directory containing the git sub-module
When analysing with sonar with SCM enabled I am getting:
INFO: -----------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: -----------------------------------------------------------------------
Total time: 2:17.478s
Final Memory: 27M/617M
INFO: -----------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to blame file sub/someinclude.h. No blame info at line 1. Is file commited?
Sonar appears to be failing to do a git blame probably because it tries to reference the projectBaseDir rather than the current file directory and someinclude.h is not in the parent git repo.
I have tried several multi-project sonar property file configurations placed in the parent and the sub-module or even externally but cannot find one that works.
This looks like a normal use case so can anybody advise a solution or is this a bug/limitation that needs fixing?