Get Android gradle plugin & checkstyle working together / command line usage

后端 未结 6 1725
礼貌的吻别
礼貌的吻别 2020-12-23 10:31

I\'m evaluating the ability of the new gradle-based build system to reproduce our current ant-based build process and, as a gradle beginner, I failed to get checkstyle runni

6条回答
  •  别那么骄傲
    2020-12-23 10:51

    To get this to work with my Android project, I had to declare the task explicitly.

    Here's what worked for me:

    apply plugin: 'checkstyle'
    
    task checkstyle(type: Checkstyle) {
        source 'src'
        include '**/*.java'
        exclude '**/gen/**'
    
        // empty classpath
        classpath = files()
    }
    

    Be mindful that the Android plugin may choose to create a task of the same name in the future or work in conjunction with the checkstyle plugin in different ways.

提交回复
热议问题