Revert "apex: skip symbol files when replaced with prebuilt"
This reverts commit9551384f65
.5bedfee448
is a better solution for the same problem. Bug: 279247159 Test: m checkbuild (presubmit) Change-Id: Ifd3117a4450b5275c09258d1ce896adb41a75158
This commit is contained in:
parent
912c4ab16f
commit
418364213a
2 changed files with 0 additions and 133 deletions
|
@ -5689,135 +5689,6 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestPrebuiltSkipsSymbols(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
usePrebuilt bool
|
||||
installSymbolFiles bool
|
||||
}{
|
||||
{
|
||||
name: "Source module biuld 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 TestPrebuiltSkipsSymbols_WorksWithOverrideApex(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, `
|
||||
apex {
|
||||
name: "myapex",
|
||||
binaries: ["foo"],
|
||||
key: "myapex.key",
|
||||
updatable: false,
|
||||
}
|
||||
|
||||
// Source module
|
||||
override_apex {
|
||||
name: "myapex2",
|
||||
base: "myapex",
|
||||
package_name: "myapex2,"
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "myapex.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
}
|
||||
|
||||
apex_set {
|
||||
name: "myapex2",
|
||||
apex_name: "myapex", // needed to replace override_apex
|
||||
set: "myapex2.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, "Implicits",
|
||||
ctx.ModuleForTests("myapex", "android_common_myapex2_myapex_image").Module().FilesToInstall().Strings(),
|
||||
filepath.Join(ctx.Config().SoongOutDir(), "target/product/test_device/apex/myapex2/bin/foo"),
|
||||
tc.installSymbolFiles)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestApexWithTests(t *testing.T) {
|
||||
ctx := testApex(t, `
|
||||
apex_test {
|
||||
|
|
|
@ -468,10 +468,6 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue