blob: 929c7a6a34b3a8b177872c8f9cfcffc5130eafa2 [file] [log] [blame]
Xudong Maf88779e2015-06-10 17:36:55 -07001// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
3buildscript {
4 repositories {
5 jcenter()
Eric Gribkoff3beb73e2018-04-24 14:33:06 -07006 google()
Xudong Maf88779e2015-06-10 17:36:55 -07007 }
8 dependencies {
Eric Gribkoff9f023812018-06-13 10:06:43 -07009 classpath 'com.android.tools.build:gradle:3.1.2'
10 classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
Xudong Maf88779e2015-06-10 17:36:55 -070011
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()
Eric Gribkoff3beb73e2018-04-24 14:33:06 -070021 google()
Xudong Maf88779e2015-06-10 17:36:55 -070022 }
23}
Eric Anderson5a2e5e12016-05-16 11:23:55 -070024
25subprojects {
26 apply plugin: "checkstyle"
27
28 checkstyle {
Eric Anderson8188a3e2017-07-12 10:53:50 -070029 configDir = file("$rootDir/../buildscripts")
Eric Anderson5a2e5e12016-05-16 11:23:55 -070030 toolVersion = "6.17"
31 ignoreFailures = false
32 if (rootProject.hasProperty("checkstyle.ignoreFailures")) {
33 ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean()
34 }
Eric Anderson5a2e5e12016-05-16 11:23:55 -070035 }
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}