Configure native toolchain in a rulesource plugin


(dresserd) #1

How can I do this in a rulesource plugin?

model {
   toolChains {
      all {
         eachPlatform {
            cCompiler.executable "coverity_arm_gcc"
            cppCompiler.executable "coverity_arm_g++"
         }
      }
   }
 }

`

I can’t seem to find the object that will allow me to set the compiler executable.


(Gary Hale) #2

Hey Derek! You can do it like this:

class ToolchainPlugin extends RuleSource {
    @Mutate
    void configureToolchains(NativeToolChainRegistry toolChains) {
        toolChains.all {
            eachPlatform {
                cCompiler.executable "coverity_arm_gcc"
                cppCompiler.executable "coverity_arm_g++"
            }
        }
    }
}