Remove host boot image from boot.zip.
Host boot image is not needed in boot.zip, which is used for the ART
APK scanner and runs on target. This commit also changes the paths in
the boot.zip by removing OS subdirectory.
Test: lunch aosp_cf_x86_phone-userdebug && m
Test: m out/soong/vsoc_x86/dex_bootjars/boot.zip \
&& zipinfo -1 out/soong/vsoc_x86/dex_bootjars/boot.zip
system/framework/x86/boot-framework.art
system/framework/x86/boot-framework.oat
system/framework/x86/boot-ext.art
system/framework/x86/boot-ext.oat
system/framework/x86/boot-core-icu4j.art
system/framework/x86/boot-core-icu4j.oat
system/framework/x86/boot-telephony-common.art
system/framework/x86/boot-telephony-common.oat
system/framework/x86/boot-voip-common.art
system/framework/x86/boot-voip-common.oat
system/framework/x86/boot-ims-common.art
system/framework/x86/boot-ims-common.oat
system/framework/x86/boot-framework-atb-backward-compatibility.art
system/framework/x86/boot-framework-atb-backward-compatibility.oat
system/framework/x86/boot-framework.vdex
system/framework/x86/boot-ext.vdex
system/framework/x86/boot-core-icu4j.vdex
system/framework/x86/boot-telephony-common.vdex
system/framework/x86/boot-voip-common.vdex
system/framework/x86/boot-ims-common.vdex
system/framework/x86/boot-framework-atb-backward-compatibility.vdex
Change-Id: Idf0541908059c454348181d90b0b3e5d6d350057
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 9d93838..e6a4313 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -340,10 +340,12 @@
bootFrameworkProfileRule(ctx, image, missingDeps)
updatableBcpPackagesRule(ctx, image, missingDeps)
- var allFiles android.Paths
+ var zipFiles android.Paths
for _, variant := range image.variants {
files := buildBootImageVariant(ctx, variant, profile, missingDeps)
- allFiles = append(allFiles, files.Paths()...)
+ if variant.target.Os == android.Android {
+ zipFiles = append(zipFiles, files.Paths()...)
+ }
}
if image.zip != nil {
@@ -351,8 +353,8 @@
rule.Command().
BuiltTool(ctx, "soong_zip").
FlagWithOutput("-o ", image.zip).
- FlagWithArg("-C ", image.dir.String()).
- FlagWithInputList("-f ", allFiles, " -f ")
+ FlagWithArg("-C ", image.dir.Join(ctx, android.Android.String()).String()).
+ FlagWithInputList("-f ", zipFiles, " -f ")
rule.Build(pctx, ctx, "zip_"+image.name, "zip "+image.name+" image")
}