Merge "Allow libcore to have NewApi warnings"
This commit is contained in:
@@ -331,12 +331,18 @@ func (l *linter) lint(ctx android.ModuleContext) {
|
|||||||
|
|
||||||
if l.minSdkVersion != l.compileSdkVersion {
|
if l.minSdkVersion != l.compileSdkVersion {
|
||||||
l.extraMainlineLintErrors = append(l.extraMainlineLintErrors, updatabilityChecks...)
|
l.extraMainlineLintErrors = append(l.extraMainlineLintErrors, updatabilityChecks...)
|
||||||
|
// Skip lint warning checks for NewApi warnings for libcore where they come from source
|
||||||
|
// files that reference the API they are adding (b/208656169).
|
||||||
|
if ctx.ModuleDir() != "libcore" {
|
||||||
_, filtered := android.FilterList(l.properties.Lint.Warning_checks, updatabilityChecks)
|
_, filtered := android.FilterList(l.properties.Lint.Warning_checks, updatabilityChecks)
|
||||||
|
|
||||||
if len(filtered) != 0 {
|
if len(filtered) != 0 {
|
||||||
ctx.PropertyErrorf("lint.warning_checks",
|
ctx.PropertyErrorf("lint.warning_checks",
|
||||||
"Can't treat %v checks as warnings if min_sdk_version is different from sdk_version.", filtered)
|
"Can't treat %v checks as warnings if min_sdk_version is different from sdk_version.", filtered)
|
||||||
}
|
}
|
||||||
_, filtered = android.FilterList(l.properties.Lint.Disabled_checks, updatabilityChecks)
|
}
|
||||||
|
|
||||||
|
_, filtered := android.FilterList(l.properties.Lint.Disabled_checks, updatabilityChecks)
|
||||||
if len(filtered) != 0 {
|
if len(filtered) != 0 {
|
||||||
ctx.PropertyErrorf("lint.disabled_checks",
|
ctx.PropertyErrorf("lint.disabled_checks",
|
||||||
"Can't disable %v checks if min_sdk_version is different from sdk_version.", filtered)
|
"Can't disable %v checks if min_sdk_version is different from sdk_version.", filtered)
|
||||||
|
Reference in New Issue
Block a user