Gradle plugin c++ code Analisys

Must-share information (formatted with Markdown):

  • Enterprise Edition
  • Version 8.9.9
  • Gradle V7.6
  • Gradle plugin: id “org.sonarqube” version “4.0.0.2929”
  • I am attempting achieve static analysis of c++ code using the grade native build, code coverage, and gtest results.

I have run build-wrapper --out-dir build-wrapper-output gradlew.bat clean build --no-daemon and generated the build-wrapper-dump.json and the wrapper log files. I have then run gradlew sonarqube trying to pass sonar.cfamily.build-wrapper-output=build-wrapper-output. I have used the -D and -P flags to pass it. I have placed sonar.cfamily.build-wrapper-output=build-wrapper-output in the gradle.property file.

Command I have run and the output:

.\build-wrapper-win-x86-64.exe --out-dir build-wrapper-output .\gradlew.bat clean build --no-daemon
.\gradlew sonar -D sonar.cfamily.build-wrapper-output=.\build-wrapper-output
BUILD SUCCESSFUL

SonarQube Report shows: The main branch of this project is empty.

.\gradlew sonar -P sonar.cfamily.build-wrapper-output=.\build-wrapper-output
BUILD SUCCESSFUL

SonarQube Report shows: The main branch of this project is empty.

.\gradlew sonar -D sonar.cfamily.build-wrapper-output=.\build-wrapper-output
BUILD FAILED
Task ‘.cfamily.build-wrapper-output=.\build-wrapper-output’ not found in root project ‘**********’ and its subprojects.

.\gradlew sonar -Psonar.cfamily.build-wrapper-output=.\build-wrapper-output
BUILD FAILED
Task ‘.cfamily.build-wrapper-output=.\build-wrapper-output’ not found in root project ‘**********’ and its subprojects.

Nothing I have tried has generated anything in the reports.

Thanks for any help.

.\gradlew sonar -D sonar.cfamily.build-wrapper-output=.\build-wrapper-output
BUILD FAILED
Task ‘.cfamily.build-wrapper-output=.\build-wrapper-output’ not found in root project ‘**********’ and its subprojects.

In Windows, I believe you should quote the whole parameter. It looks like gradle interprets .cfamily.build-wrapper... as a task, and not as part of the parameter.

Try removing the space and quoting the full parameter.

.\gradlew sonar "-Dsonar.cfamily.build-wrapper-output=.\build-wrapper-output"