Saturday, August 20, 2016

Apply a plugin to some sub-projects in Gradle

To apply a plugin to some sub-projects in Gradle, do as follows:

configure(subprojects.findAll {it.name == 'ask-anything-api' || it.name == 'ask-anything-answer-module-ua-analyzer'}) {
    apply plugin: 'checkstyle'

    checkstyle {
        toolVersion = '7.0'
        configFile = rootProject.file("config/checkstyle/checkstyle.xml")
        configProperties = [
                'headerLocation': 'config/checkstyle/checkstyle-header.txt',
                'suppressionsLocation': 'config/checkstyle/checkstyle-suppressions.xml'
        ]
    }
}

No comments:

Post a Comment