forked from square/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
110 lines (93 loc) · 2.87 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
buildscript {
ext.versions = [
'compileSdk': 28,
'minSdk': 14,
'targetSdk': 28,
'sourceCompatibility': JavaVersion.VERSION_1_7,
'targetCompatibility': JavaVersion.VERSION_1_7,
'okhttp': '3.11.0',
'okio': '2.1.0',
]
ext.deps = [
androidPlugin: 'com.android.tools.build:gradle:3.2.1',
okhttp: "com.squareup.okhttp3:okhttp:${versions.okhttp}",
okio: "com.squareup.okio:okio:${versions.okio}",
mockWebServer: "com.squareup.okhttp3:mockwebserver:${versions.okhttp}",
pollexor: 'com.squareup:pollexor:2.0.4',
androidxAnnotations: 'androidx.annotation:annotation:1.0.0',
androidxCore: 'androidx.core:core:1.0.0',
androidxExifInterface: 'androidx.exifinterface:exifinterface:1.0.0',
androidxFragment: 'androidx.fragment:fragment:1.0.0',
androidxLifecycle: 'androidx.lifecycle:lifecycle-common:2.0.0',
errorProne: 'com.google.errorprone:error_prone_core:2.3.2',
junit: 'junit:junit:4.12',
truth: 'com.google.truth:truth:0.42',
robolectric: 'org.robolectric:robolectric:4.0.1',
mockito: 'org.mockito:mockito-core:2.23.0',
nullaway: 'com.uber.nullaway:nullaway:0.6.0'
]
ext.isCi = "true" == System.getenv('CI')
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath deps.androidPlugin
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.16'
}
}
apply plugin: 'com.github.ben-manes.versions'
subprojects {
repositories {
google()
jcenter()
}
tasks.withType(JavaCompile) {
options.compilerArgs += [
'-Xep:UnnecessaryDefaultInEnumSwitch:ERROR',
'-Xep:TypeParameterUnusedInFormals:ERROR',
'-Xep:OperatorPrecedence:ERROR',
'-Xep:ReferenceEquality:ERROR',
'-Xep:FloatingPointLiteralPrecision:ERROR',
'-Xep:DateFormatConstant:ERROR',
'-Xep:PrivateConstructorForUtilityClass:ERROR',
'-Xep:DateFormatConstant:ERROR',
'-XepExcludedPaths:.*/build/.*'
]
if (!name.toLowerCase().contains("test")) {
// NullAway args
options.compilerArgs += [
'-Xep:NullAway:ERROR',
'-XepOpt:NullAway:AnnotatedPackages=com.squareup.picasso3'
]
}
}
tasks.withType(Test) {
testLogging {
events "failed"
exceptionFormat "full"
showExceptions true
showStackTraces true
showCauses true
}
}
plugins.apply('checkstyle')
task('checkstyle', type: Checkstyle) {
configFile rootProject.file('checkstyle.xml')
source 'src/main/java'
ignoreFailures false
showViolations true
include '**/*.java'
classpath = files()
}
group = GROUP
version = VERSION_NAME
afterEvaluate {
tasks.findByName('check').dependsOn('checkstyle')
}
apply plugin: 'net.ltgt.errorprone'
dependencies {
errorprone deps.errorProne
}
}