Configure native toolchain in a rulesource plugin

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.

1 Like

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++"
            }
        }
    }
}