aboutsummaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorSpandan Das <spandandas@google.com>2023-04-20 15:30:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-04-20 15:30:20 +0000
commit0bf4ea53f51c9a9c2310514cd446a98dd699e8c5 (patch)
treeb58fe561d747674d5bdd16221fd502736516f1be /android
parent0933fd59d7bddcface4fddbb1b61d42c4a0a39cd (diff)
parent2dc6dfcb16e5cb25a1a52f9a96e80a51947b3978 (diff)
downloadsoong-0bf4ea53f51c9a9c2310514cd446a98dd699e8c5.tar.gz
Merge changes I4129c2a9,I9af06f81
* changes: Drop the default apex_available value from BUILD files Make //apex_available:platform the default.
Diffstat (limited to 'android')
-rw-r--r--android/apex.go11
-rw-r--r--android/mutator.go8
2 files changed, 17 insertions, 2 deletions
diff --git a/android/apex.go b/android/apex.go
index 87bff74c3..5bbc02e51 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
}