apex: skip symbol files when replaced with prebuilt am: 9551384f65
am: 7feafd1599
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2539650 Change-Id: I0eaebfef83f4d529fc266a9bd7ecab311e97e159 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -5646,6 +5646,58 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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",
|
||||||
|
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+`
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
// Symbol files are installed by installing entries under ${OUT}/apex/{apex name}
|
||||||
|
android.AssertStringListContainsEquals(t, "Implicits",
|
||||||
|
ctx.ModuleForTests("myapex", "android_common_myapex_image").Rule("apexRule").Implicits.Strings(),
|
||||||
|
"out/soong/target/product/test_device/apex/myapex/apex_manifest.pb",
|
||||||
|
tc.installSymbolFiles)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestApexWithTests(t *testing.T) {
|
func TestApexWithTests(t *testing.T) {
|
||||||
ctx := testApex(t, `
|
ctx := testApex(t, `
|
||||||
apex_test {
|
apex_test {
|
||||||
|
@@ -468,6 +468,10 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
|||||||
imageDir := android.PathForModuleOut(ctx, "image"+suffix)
|
imageDir := android.PathForModuleOut(ctx, "image"+suffix)
|
||||||
|
|
||||||
installSymbolFiles := (!ctx.Config().KatiEnabled() || a.ExportedToMake()) && a.installable()
|
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
|
// set of dependency module:location mappings
|
||||||
installMapSet := make(map[string]bool)
|
installMapSet := make(map[string]bool)
|
||||||
|
Reference in New Issue
Block a user