forked from square/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
135 lines (114 loc) · 3.51 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
buildscript {
ext.versions = [
'compileSdk': 29,
'minSdk': 14,
'targetSdk': 29,
'sourceCompatibility': JavaVersion.VERSION_1_7,
'targetCompatibility': JavaVersion.VERSION_1_7,
'kotlin': '1.3.61',
'okhttp': '4.2.2',
'okio': '2.4.2',
]
ext.deps = [
androidPlugin: 'com.android.tools.build:gradle:3.5.3',
kotlinPlugin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
kotlinStdlibJdk8: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}",
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.1.0',
androidxCore: 'androidx.core:core:1.0.0',
androidxExifInterface: 'androidx.exifinterface:exifinterface:1.1.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.7.9',
]
ext.isCi = "true" == System.getenv('CI')
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath deps.androidPlugin
classpath deps.kotlinPlugin
classpath 'com.github.ben-manes:gradle-versions-plugin:0.27.0'
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.16'
}
}
apply plugin: 'com.github.ben-manes.versions'
allprojects {
repositories {
mavenCentral()
google()
jcenter()
}
}
subprojects {
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
}
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
configurations {
osstrich
}
dependencies {
osstrich 'com.squareup.osstrich:osstrich:1.4.0'
}
tasks.register('deployJavadoc', JavaExec) {
classpath = configurations.osstrich
main = 'com.squareup.osstrich.JavadocPublisher'
args "$buildDir/osstrich", '[email protected]:square/picasso.git', 'com.squareup.picasso'
}