Merge "apex: respect PRODUCT_COMPRESSED_APEX for prebuilt APEXes" into main am: b42b703f53 am: de22d9608a

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3201250

Change-Id: I7a27e264cffe85996836e0a3f0ccc5812ab99d53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jooyung Han
2024-08-01 01:38:43 +00:00
committed by Automerger Merge Worker
2 changed files with 36 additions and 1 deletions

View File

@@ -8992,6 +8992,30 @@ func TestCompressedApex(t *testing.T) {
ensureContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.capex\n")
}
func TestApexSet_ShouldRespectCompressedApexFlag(t *testing.T) {
for _, compressionEnabled := range []bool{true, false} {
t.Run(fmt.Sprintf("compressionEnabled=%v", compressionEnabled), func(t *testing.T) {
ctx := testApex(t, `
apex_set {
name: "com.company.android.myapex",
apex_name: "com.android.myapex",
set: "company-myapex.apks",
}
`, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.CompressedApex = proptools.BoolPtr(compressionEnabled)
}),
)
build := ctx.ModuleForTests("com.company.android.myapex", "android_common_com.android.myapex").Output("com.company.android.myapex.apex")
if compressionEnabled {
ensureEquals(t, build.Rule.String(), "android/soong/android.Cp")
} else {
ensureEquals(t, build.Rule.String(), "android/apex.decompressApex")
}
})
}
}
func TestPreferredPrebuiltSharedLibDep(t *testing.T) {
ctx := testApex(t, `
apex {