Static analyze tool for native plugin (GCC)


I’d like to add static analyze tools (PRQA QAC) for analyze my C/C++ project. As a standard static analyze tool it should work like a wrapper for compilator. It should have the same compilation option and the same includes.

I have few option to handle such a thing:

  1. Add parallel toolchain e.g.

    QAC(Gcc) {
    cCompiler.executable = ‘qac.exe’

  2. Write a plugin

  3. A task, which would read all sources and one by one replace complication command from gcc to another. Something like that:

    task (“qac”){
    binaries.all { binary ->
    sources.withType(CSourceSet) { source ->
    … do some magic to read each compilaton line

What would be the most sufficient way implement it?