Create allowlist to skip strict updatability lint check
As of Jan 2022, some updatable mainline modules have (transitive) deps with NewApi in their respective lint-baseline.xml. Create an allowlist to relax this check temporarily for those mainline modules. Test: m lint-check Test: TH Bug: 182349282 Change-Id: I9ccda6fccb973e9100e31b7e559f5642289ac717
This commit is contained in:
23
apex/apex.go
23
apex/apex.go
@@ -1009,7 +1009,7 @@ func apexStrictUpdatibilityLintMutator(mctx android.TopDownMutatorContext) {
|
||||
if !mctx.Module().Enabled() {
|
||||
return
|
||||
}
|
||||
if apex, ok := mctx.Module().(*apexBundle); ok && apex.Updatable() {
|
||||
if apex, ok := mctx.Module().(*apexBundle); ok && apex.checkStrictUpdatabilityLinting() {
|
||||
mctx.WalkDeps(func(child, parent android.Module) bool {
|
||||
if lintable, ok := child.(java.LintDepSetsIntf); ok {
|
||||
lintable.SetStrictUpdatabilityLinting(true)
|
||||
@@ -1020,6 +1020,27 @@ func apexStrictUpdatibilityLintMutator(mctx android.TopDownMutatorContext) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: b/215736885 Whittle the denylist
|
||||
// Transitive deps of certain mainline modules baseline NewApi errors
|
||||
// Skip these mainline modules for now
|
||||
var (
|
||||
skipStrictUpdatabilityLintAllowlist = []string{
|
||||
"com.android.art",
|
||||
"com.android.art.debug",
|
||||
"com.android.conscrypt",
|
||||
"com.android.media",
|
||||
// test apexes
|
||||
"test_com.android.art",
|
||||
"test_com.android.conscrypt",
|
||||
"test_com.android.media",
|
||||
"test_jitzygote_com.android.art",
|
||||
}
|
||||
)
|
||||
|
||||
func (a *apexBundle) checkStrictUpdatabilityLinting() bool {
|
||||
return a.Updatable() && !android.InList(a.ApexVariationName(), skipStrictUpdatabilityLintAllowlist)
|
||||
}
|
||||
|
||||
// apexUniqueVariationsMutator checks if any dependencies use unique apex variations. If so, use
|
||||
// unique apex variations for this module. See android/apex.go for more about unique apex variant.
|
||||
// TODO(jiyong): move this to android/apex.go?
|
||||
|
Reference in New Issue
Block a user