Xudong Ma | f88779e | 2015-06-10 17:36:55 -0700 | [diff] [blame] | 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. |
| 2 | |
| 3 | buildscript { |
| 4 | repositories { |
Eric Gribkoff | 3beb73e | 2018-04-24 14:33:06 -0700 | [diff] [blame] | 5 | google() |
Eric Gribkoff | 56ff8da | 2018-10-24 20:07:16 +0900 | [diff] [blame] | 6 | jcenter() |
Xudong Ma | f88779e | 2015-06-10 17:36:55 -0700 | [diff] [blame] | 7 | } |
| 8 | dependencies { |
Eric Gribkoff | 9f02381 | 2018-06-13 10:06:43 -0700 | [diff] [blame] | 9 | classpath 'com.android.tools.build:gradle:3.1.2' |
| 10 | classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5" |
Xudong Ma | f88779e | 2015-06-10 17:36:55 -0700 | [diff] [blame] | 11 | |
| 12 | // NOTE: Do not place your application dependencies here; they belong |
| 13 | // in the individual module build.gradle files |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | allprojects { |
| 18 | repositories { |
Eric Gribkoff | 56ff8da | 2018-10-24 20:07:16 +0900 | [diff] [blame] | 19 | google() |
Xudong Ma | f88779e | 2015-06-10 17:36:55 -0700 | [diff] [blame] | 20 | mavenLocal() |
| 21 | jcenter() |
| 22 | } |
| 23 | } |
Eric Anderson | 5a2e5e1 | 2016-05-16 11:23:55 -0700 | [diff] [blame] | 24 | |
| 25 | subprojects { |
| 26 | apply plugin: "checkstyle" |
| 27 | |
| 28 | checkstyle { |
Eric Anderson | 8188a3e | 2017-07-12 10:53:50 -0700 | [diff] [blame] | 29 | configDir = file("$rootDir/../buildscripts") |
Eric Anderson | 5a2e5e1 | 2016-05-16 11:23:55 -0700 | [diff] [blame] | 30 | toolVersion = "6.17" |
| 31 | ignoreFailures = false |
| 32 | if (rootProject.hasProperty("checkstyle.ignoreFailures")) { |
| 33 | ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean() |
| 34 | } |
Eric Anderson | 5a2e5e1 | 2016-05-16 11:23:55 -0700 | [diff] [blame] | 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 | } |