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
|
import com.vanniktech.maven.publish.SonatypeHost
import net.ltgt.gradle.errorprone.CheckSeverity
plugins {
id 'com.android.library'
id 'net.ltgt.errorprone'
id 'com.vanniktech.maven.publish'
id 'androidx.baselineprofile'
}
android {
namespace 'com.airbnb.lottie'
resourcePrefix 'lottie_'
compileSdk 34
defaultConfig {
minSdk 16
targetSdk 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
abortOnError true
textReport true
textOutput 'stdout'
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()
}
baselineProfile {
filter {
include 'com.airbnb.lottie.**'
exclude 'com.airbnb.lottie.compose.**'
}
}
dependencies {
implementation libs.androidx.appcompat
// Do not upgrade to 2.0 because it will bring in Kotlin as a transitive dependency.
//noinspection GradleDependency
implementation libs.okio
annotationProcessor libs.nullaway
errorprone libs.errorprone.core
baselineProfile project(':baselineprofile')
testImplementation libs.mockito.core
testImplementation libs.robolectric
testImplementation libs.junit4
androidTestImplementation libs.androidx.test.junit
androidTestImplementation libs.androidx.test.espresso
}
tasks.withType(JavaCompile).configureEach {
// remove the if condition if you want to run NullAway on test code
if (!name.toLowerCase().contains("test")) {
options.errorprone {
option("NullAway:AnnotatedPackages", "com.airbnb.lottie")
// TODO: enable these and fix errors one by one.
check("NullAway", CheckSeverity.OFF)
check("StringSplitter", CheckSeverity.OFF)
check("DefaultCharset", CheckSeverity.OFF)
check("HidingField", CheckSeverity.OFF)
check("NarrowingCompoundAssignment", CheckSeverity.OFF)
check("MissingOverride", CheckSeverity.OFF)
check("ReferenceEquality", CheckSeverity.OFF)
check("FallThrough", CheckSeverity.OFF)
check("FloatingPointLiteralPrecision", CheckSeverity.OFF)
check("MissingCasesInEnumSwitch", CheckSeverity.OFF)
check("OperatorPrecedence", CheckSeverity.OFF)
// Disabled checks
check("MixedMutabilityReturnType", CheckSeverity.OFF)
check("MissingSummary", CheckSeverity.OFF)
check("InlineMeSuggester", CheckSeverity.OFF)
}
}
}
|