Skip to content

Automatically configure checkstyle plugin based on gradle build #439

@orionlee

Description

@orionlee

I believe this is essentially the gradle counterpart for #107.

It'd be great if the plugin can honor the existing checkstyle settings in the project gradle build files, at the minimal the checkstyle config files and checkstyle cache.

E.g., configure checkstyle once it recognizes something like the following in the project gradle.

apply plugin: 'checkstyle'

checkstyle {
    configFile = file("${project.rootDir}/config/checkstyle.xml")
configProperties = [
            'checkstyle.cache.file': rootProject.file('build/checkstyle.cache'),
    ]
}

And the android gradle variant (android builds use slightly different config)

apply plugin: 'checkstyle'

task checkstyle(type: Checkstyle) {
    configFile file("${project.rootDir}/config/checkstyle.xml")
    configProperties = [
            'checkstyle.cache.file': rootProject.file('build/checkstyle.cache'),
    ]
// ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequest for new functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions