-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
83 lines (72 loc) · 2.54 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: 'versions.gradle'
apply from: 'publish.gradle'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
apply plugin: 'checkstyle'
//add checkstyle to each module
task checkstyle(type: Checkstyle) {
configFile = new File(rootDir, "config/checkstyle/checkstyle.xml")
//use same config file for each module
source 'src/'
include '**/*.java'
exclude '**/gen/**'
classpath = files()
reports {
xml {
destination "build/outputs/reports/checkstyle-results.xml"
}
}
}
task checkstyleReport(dependsOn: 'checkstyle') {
doLast {
if (file("build/outputs/reports/checkstyle-results.xml").exists()) {
ant.xslt(in: "build/outputs/reports/checkstyle-results.xml",
style: "${rootDir}/config/checkstyle/checkstyle.xsl",
out: "build/outputs/reports/checkstyle-results.html"
)
}
}
}
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
def config = android.defaultConfig
def ext = rootProject.ext
if (android.compileSdkVersion == null)
android.compileSdkVersion ext.compileSdkVersion
if (config.minSdkVersion == null)
config.minSdkVersion ext.minSdkVersion
if (config.targetSdkVersion == null)
config.targetSdkVersion ext.targetSdkVersion
if (config.versionCode == null)
config.versionCode ext.versionCode
if (config.versionName == null)
config.versionName ext.versionName
if (config.testInstrumentationRunner == null)
config.testInstrumentationRunner ext.testInstrumentationRunner
}
}
}
ext {
testInstrumentationRunner = 'android.support.test.runner.AndroidJUnitRunner'
}
task clean(type: Delete) {
delete project.buildDir
}