Merge changes Ifd3117a4,Ic4f8b2b1
* changes:
Revert "apex: skip symbol files when replaced with prebuilt"
override_apex can be replaced with apex_set
diff --git a/android/override_module.go b/android/override_module.go
index 2d30a85..86f582b 100644
--- a/android/override_module.go
+++ b/android/override_module.go
@@ -304,8 +304,9 @@
for i, o := range overrides {
mods[i+1].(OverridableModule).override(ctx, o)
if o.getOverriddenByPrebuilt() {
- // The overriding module itself, too, is overridden by a prebuilt. Skip its installation.
- mods[i+1].HideFromMake()
+ // The overriding module itself, too, is overridden by a prebuilt.
+ // Copy the flag and hide it in make
+ mods[i+1].ReplacedByPrebuilt()
}
}
} else if o, ok := ctx.Module().(OverrideModule); ok {
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 440afec..d08d246 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -5689,67 +5689,6 @@
})
}
-func TestPrebuiltSkipsSymbols(t *testing.T) {
- testCases := []struct {
- name string
- usePrebuilt bool
- installSymbolFiles bool
- }{
- {
- name: "Source module build rule doesn't install symbol files",
- usePrebuilt: true,
- installSymbolFiles: false,
- },
- {
- name: "Source module is installed with symbols",
- usePrebuilt: false,
- installSymbolFiles: true,
- },
- }
- for _, tc := range testCases {
- t.Run(tc.name, func(t *testing.T) {
- preferProperty := "prefer: false"
- if tc.usePrebuilt {
- preferProperty = "prefer: true"
- }
- ctx := testApex(t, `
- // Source module
- apex {
- name: "myapex",
- binaries: ["foo"],
- key: "myapex.key",
- updatable: false,
- }
-
- apex_key {
- name: "myapex.key",
- public_key: "testkey.avbpubkey",
- private_key: "testkey.pem",
- }
-
- apex_set {
- name: "myapex",
- set: "myapex.apks",
- `+preferProperty+`
- }
-
- cc_binary {
- name: "foo",
- srcs: ["mylib.cpp"],
- system_shared_libs: [],
- stl: "none",
- apex_available: [ "myapex" ],
- }
- `)
- // Symbol files are installed by installing entries under ${OUT}/apex/{apex name}
- android.AssertStringListContainsEquals(t, "Installs",
- ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().FilesToInstall().Strings(),
- filepath.Join(ctx.Config().SoongOutDir(), "target/product/test_device/apex/myapex/bin/foo"),
- tc.installSymbolFiles)
- })
- }
-}
-
func TestApexWithTests(t *testing.T) {
ctx := testApex(t, `
apex_test {
diff --git a/apex/builder.go b/apex/builder.go
index 3c7671b..2efdf1e 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -468,10 +468,6 @@
imageDir := android.PathForModuleOut(ctx, "image"+suffix)
installSymbolFiles := (!ctx.Config().KatiEnabled() || a.ExportedToMake()) && a.installable()
- // We can't install symbol files when prebuilt is used.
- if a.IsReplacedByPrebuilt() {
- installSymbolFiles = false
- }
// set of dependency module:location mappings
installMapSet := make(map[string]bool)