1// Top-level build file where you can add configuration options common to all sub-projects/modules. 2 3buildscript { 4 repositories { 5 jcenter() 6 google() 7 } 8 dependencies { 9 classpath 'com.android.tools.build:gradle:3.1.2' 10 classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5" 11 12 // NOTE: Do not place your application dependencies here; they belong 13 // in the individual module build.gradle files 14 } 15} 16 17allprojects { 18 repositories { 19 mavenLocal() 20 jcenter() 21 google() 22 } 23} 24 25subprojects { 26 apply plugin: "checkstyle" 27 28 checkstyle { 29 configDir = file("$rootDir/../buildscripts") 30 toolVersion = "6.17" 31 ignoreFailures = false 32 if (rootProject.hasProperty("checkstyle.ignoreFailures")) { 33 ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean() 34 } 35 } 36 37 // Checkstyle doesn't run automatically with android 38 task checkStyleMain(type: Checkstyle) { 39 source 'src/main/java' 40 include '**/*.java' 41 classpath = files() 42 } 43 44 task checkStyleTest(type: Checkstyle) { 45 source 'src/test/java' 46 include '**/*.java' 47 classpath = files() 48 } 49 50 afterEvaluate { project -> 51 project.tasks['check'].dependsOn checkStyleMain, checkStyleTest 52 } 53} 54