diff options
author | Spandan Das <spandandas@google.com> | 2023-04-20 17:23:47 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-04-20 17:23:47 +0000 |
commit | e4001552d9d751ba0c70ed97d04bd25df756f74f (patch) | |
tree | 691f3d3f7d90c817a06b400c769f36b12be406bb /android | |
parent | be9da69fdc42d661d323ac588a1f48c8f2ef6831 (diff) | |
parent | 88b15818b5b4552178d6bd80d186f52d3f9e1e3c (diff) | |
download | soong-e4001552d9d751ba0c70ed97d04bd25df756f74f.tar.gz |
Merge changes I4129c2a9,I9af06f81 am: 0bf4ea53f5 am: 56797fd547 am: 88b15818b5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2535121
Change-Id: I3f43bc39e8cc0ea9d37f6ae64ca7993446b084da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'android')
-rw-r--r-- | android/apex.go | 11 | ||||
-rw-r--r-- | android/mutator.go | 8 |
2 files changed, 17 insertions, 2 deletions
diff --git a/android/apex.go b/android/apex.go index 3c7f4d0e8..c9b4a0b7c 100644 --- a/android/apex.go +++ b/android/apex.go @@ -356,9 +356,18 @@ func (m *ApexModuleBase) apexModuleBase() *ApexModuleBase { return m } +var ( + availableToPlatformList = []string{AvailableToPlatform} +) + // Implements ApexModule func (m *ApexModuleBase) ApexAvailable() []string { - return m.ApexProperties.Apex_available + aa := m.ApexProperties.Apex_available + if len(aa) > 0 { + return aa + } + // Default is availability to platform + return CopyOf(availableToPlatformList) } // Implements ApexModule diff --git a/android/mutator.go b/android/mutator.go index 676f8a511..4ec960472 100644 --- a/android/mutator.go +++ b/android/mutator.go @@ -747,7 +747,13 @@ func ApexAvailableTags(mod Module) bazel.StringListAttribute { // TODO(b/218841706): hidl_interface has the apex_available prop, but it's // defined directly as a prop and not via ApexModule, so this doesn't // pick those props up. - attr.Value = ConvertApexAvailableToTags(am.apexModuleBase().ApexAvailable()) + apexAvailable := am.apexModuleBase().ApexAvailable() + // If a user does not specify apex_available in Android.bp, then soong provides a default. + // To avoid verbosity of BUILD files, remove this default from user-facing BUILD files. + if len(am.apexModuleBase().ApexProperties.Apex_available) == 0 { + apexAvailable = []string{} + } + attr.Value = ConvertApexAvailableToTags(apexAvailable) } return attr } |