How to set checkstyle configuration from Gradle in IDEA

Viewed 6943

I am using the Checkstyle plugin in IDEA. I want to set up different checkstyle configurations to my different modules. I am using gradle as build tool-version 4- and I want to write a task that modifies the corresponding .iml files of the modules. Any idea how to do that?

My very first attempt in modifying the iml file looking over here

apply plugin: 'idea'


task setCheckStylePluginSettings {
    group = "Idea"
    description = "Copies CheckStyle plugin settings to Idea workspace."

    println "Step 1."
    idea.module.iml {
    withXml {xmlProvider ->
        // Get root node.
        println "Step 2."
        def project = xmlProvider.asNode()
        }
    }
 }

However, I am stuck just at the beginning that I cant event see the Step 2 printed on the Console.

2 Answers
Related