-
Notifications
You must be signed in to change notification settings - Fork 1
/
lint.gradle
29 lines (25 loc) · 867 Bytes
/
lint.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
subprojects {
project.afterEvaluate {
if (isAndroidAppOrLib(project)) {
applyLintOptionsConfig(project, android.lintOptions)
} else if (isJavaLibrary(project)) {
project.apply plugin: 'com.android.lint'
applyLintOptionsConfig(project, lintOptions)
}
}
}
static boolean isAndroidAppOrLib(project) {
return project.getPlugins().hasPlugin('android') ||
project.getPlugins().hasPlugin('android-library')
}
static boolean isJavaLibrary(project) {
return project.getPlugins().hasPlugin('java-library')
}
static def applyLintOptionsConfig(project, lintOptions) {
project.configure(lintOptions) {
abortOnError false
absolutePaths false
lintConfig project.rootProject.file('lint.xml')
baseline project.rootProject.file("lint-baseline.xml")
}
}