nokeedev / gradle-native

The home of anything about Gradle support for natively compiled languages
https://nokee.dev
Apache License 2.0
47 stars 8 forks source link

Invoking Sonarqube using generated VS IDE is slower due to multiple Gradle invocation #265

Open khickel opened 3 years ago

khickel commented 3 years ago

Using SonarQube to scan C/C++ code from the command line, such as in a daily build from Jenkins requires the use of their build-wrapper. The build-wrapper does not detect the compiler/linker invocation from gradle, and there isn't any documentation that would help to understand why.

When building a generated visual studio project, either from the VS IDE, or from MSBuild, the build of each project invokes gradle, which represents a lot of overhead.

lacasseio commented 3 years ago

I don't believe running the build-wrapper on MSBuild using the VS solution generated by Nokee is the right path. The execution chain would be as follow: build-wrapper -- monitor --> MSBuild -- delegate --> Gradle/Nokee. There are several "middle" layer that just adds complexity and failure point. The generated VS Solution/Project from Nokee is close to vanilla but we do overwrite some key tasks which probably confuses the build-wrapper. You can see the result here.

I wrote a demonstration that improve upon the official Gradle plugin. I also kick off the discussion for a feature request in the official plugin.

Try the plugin in the demonstration and tell me if that solve your issue.