forked from JakeWharton/u2020
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
139 lines (130 loc) · 5.12 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
buildscript {
ext.isCi = Boolean.parseBoolean(System.getProperty('CI', 'false'))
ext.versions = [
'compileSdk': 26,
'buildTools': '26.0.1',
'minSdk': 19,
'targetSdk': 25,
'supportLibrary': '26.0.0',
'dagger': '1.2.5',
'okhttp': '3.8.1',
'retrofit': '2.3.0',
'butterKnife': '8.7.0',
'leakCanary': '1.5.1',
'espresso': '2.2.2',
'astl': '0.5',
'errorProne': '2.0.21',
]
ext.deps = [
'support': [
'annotations': "com.android.support:support-annotations:${versions.supportLibrary}",
'v4': "com.android.support:support-v4:${versions.supportLibrary}",
'appCompat': "com.android.support:appcompat-v7:${versions.supportLibrary}",
'design': "com.android.support:design:${versions.supportLibrary}",
'recyclerView': "com.android.support:recyclerview-v7:${versions.supportLibrary}",
],
'dagger': [
'runtime': "com.squareup.dagger:dagger:${versions.dagger}",
'compiler': "com.squareup.dagger:dagger-compiler:${versions.dagger}",
],
'okhttp': [
'core': "com.squareup.okhttp3:okhttp:${versions.okhttp}",
'logger': "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}",
],
'okio': 'com.squareup.okio:okio:1.13.0',
'picasso': 'com.squareup.picasso:picasso:2.5.2',
'picassoOkHttpDownloader': 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0',
'retrofit': [
'core': "com.squareup.retrofit2:retrofit:${versions.retrofit}",
'mock': "com.squareup.retrofit2:retrofit-mock:${versions.retrofit}",
'moshi': "com.squareup.retrofit2:converter-moshi:${versions.retrofit}",
'rxjava': "com.squareup.retrofit2:adapter-rxjava:${versions.retrofit}",
],
'moshi': 'com.squareup.moshi:moshi:1.5.0',
'butterKnife': [
'runtime': "com.jakewharton:butterknife:${versions.butterKnife}",
'compiler': "com.jakewharton:butterknife-compiler:${versions.butterKnife}",
],
'timber': 'com.jakewharton.timber:timber:4.5.1',
'byteUnits': 'com.jakewharton.byteunits:byteunits:0.9.1',
'rxbinding': 'com.jakewharton.rxbinding:rxbinding:1.0.1',
'madge': 'com.jakewharton.madge:madge:1.1.4',
'scalpel': 'com.jakewharton.scalpel:scalpel:1.1.2',
'processPhoenix': 'com.jakewharton:process-phoenix:2.0.0',
'leakCanary': [
'real': "com.squareup.leakcanary:leakcanary-android:${versions.leakCanary}",
'noOp': "com.squareup.leakcanary:leakcanary-android-no-op:${versions.leakCanary}",
],
'rx': [
'core': 'io.reactivex:rxjava:1.3.0',
'android': 'io.reactivex:rxandroid:1.2.1',
'preferences': 'com.f2prateek.rx.preferences:rx-preferences:1.0.2',
],
'threeTenAbp': 'com.jakewharton.threetenabp:threetenabp:1.0.5',
'telescope': 'com.mattprecious.telescope:telescope:2.1.0',
'junit': 'junit:junit:4.12',
'espresso': [
'core': "com.android.support.test.espresso:espresso-core:${versions.espresso}",
'contrib': "com.android.support.test.espresso:espresso-contrib:${versions.espresso}",
],
'astl': [
'runner': "com.android.support.test:runner:${versions.astl}",
'rules': "com.android.support.test:rules:${versions.astl}",
],
'spoon': 'com.squareup.spoon:spoon-client:1.7.1',
'truth': 'com.google.truth:truth:0.34',
'errorProneAnnotations': "com.google.errorprone:error_prone_annotations:${versions.errorProne}",
]
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'https://plugins.gradle.org/m2'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
classpath 'com.stanfy.spoon:spoon-gradle-plugin:1.2.2'
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.11'
}
}
subprojects {
repositories {
google()
mavenCentral()
jcenter()
}
configurations.all {
resolutionStrategy {
eachDependency { details ->
// Force all of the primary support libraries to use the same version.
if (details.requested.group == 'com.android.support'
&& details.requested.name != 'multidex'
&& details.requested.name != 'multidex-instrumentation') {
details.useVersion versions.supportLibrary
}
// Force all the error-prone dependencies to use the same version.
if (details.requested.group == 'com.google.errorprone'
&& details.requested.name.startsWith('error_prone_')) {
details.useVersion versions.errorProne
}
}
}
}
if (isCi) {
project.apply(plugin: 'net.ltgt.errorprone')
project.tasks.withType(JavaCompile) {
options.compilerArgs += [
'-Xep:UnnecessaryDefaultInEnumSwitch:ERROR',
'-Xep:TypeParameterUnusedInFormals:ERROR',
'-Xep:MissingOverride:ERROR',
'-Xep:ClassCanBeStatic:ERROR',
'-Xep:OperatorPrecedence:ERROR',
'-Xep:ReferenceEquality:ERROR',
'-Xep:FloatingPointLiteralPrecision:ERROR',
'-Xep:SimpleDateFormatConstant:ERROR',
]
}
}
}