Copy white listed apex available settings into snapshot

Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.

Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
This commit is contained in:
Paul Duffin
2020-03-06 12:30:13 +00:00
parent f51768abce
commit 404db3f4e8
3 changed files with 47 additions and 15 deletions

View File

@@ -167,7 +167,7 @@ func (m *ApexModuleBase) IsInstallableToApex() bool {
const (
AvailableToPlatform = "//apex_available:platform"
availableToAnyApex = "//apex_available:anyapex"
AvailableToAnyApex = "//apex_available:anyapex"
)
func CheckAvailableForApex(what string, apex_available []string) bool {
@@ -177,7 +177,7 @@ func CheckAvailableForApex(what string, apex_available []string) bool {
return what == AvailableToPlatform
}
return InList(what, apex_available) ||
(what != AvailableToPlatform && InList(availableToAnyApex, apex_available))
(what != AvailableToPlatform && InList(AvailableToAnyApex, apex_available))
}
func (m *ApexModuleBase) AvailableFor(what string) bool {
@@ -203,7 +203,7 @@ func (m *ApexModuleBase) ChooseSdkVersion(versionList []string, maxSdkVersion in
func (m *ApexModuleBase) checkApexAvailableProperty(mctx BaseModuleContext) {
for _, n := range m.ApexProperties.Apex_available {
if n == AvailableToPlatform || n == availableToAnyApex {
if n == AvailableToPlatform || n == AvailableToAnyApex {
continue
}
if !mctx.OtherModuleExists(n) && !mctx.Config().AllowMissingDependencies() {