Analyze Gradle C++ project on macOS 13

Hello @mpaladin, now that the build-wrapper is not supported on macOS >= 13 how can we use gradle to compile C++ and scan it with sonarqube ? Thanks in advance !

Hi @pavin117 ,

are you using Gradle to build native code or are you using it to invoke another build system?

@mpaladin We are using it to build both native code and Kotlin.

Hi @mpaladin do you have an update on the above topic ? Thank you in advance !

Hi @pavin117 ,

sorry for the delay, I was off. If you are using Clang compiler you can generate a compilation database as described in [CPP-3987] - Jira

  • Add -gen-cdb-fragment-path path/to/CompilationDatabaseDir to the Clang compiler calls
  • Merge the fragment into a single compilation database file:
    cd CompilationDatabaseDir
    sed -e '1s/^/[\'$'\n''/' -e '$s/,$/\'$'\n'']/' *.json > ../compile_commands.json