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

后端 未结 6 1737
礼貌的吻别
礼貌的吻别 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 11:03

    You can try Android Check plugin (https://github.com/noveogroup/android-check):

    • Checkstyle
    • PMD

    Configuration:

    buildscript {
        repositories { jcenter() }
        dependencies {
            ...
            classpath 'com.noveogroup.android:check:+'
            ...
        }
    }
    
    apply plugin: 'com.noveogroup.android.check'
    

    You can use hardcore configuration:

    check {
        abortOnError true
        checkstyle { config hard() }
        pmd { config hard() }
    }
    

提交回复
热议问题