diff options
author | 2025-02-10 16:10:04 -0800 | |
---|---|---|
committer | 2025-02-10 16:58:46 -0800 | |
commit | a472a6f0c809334823bcc2c897b7a577c5994f59 (patch) | |
tree | e137318a0d9c8389940c76ac7cf6cba304024428 /filesystem/android_device.go | |
parent | aee4d3e145361b0b434aac85d9693a8f6a28fa13 (diff) |
Build zip of all soong-built images
For use in a diff test against make-built images.
Bug: 376539388
Test: m soong_only_diff_test
Change-Id: Idac01d3dfd075b650a44058c57a88520b314cec4
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r-- | filesystem/android_device.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go index 6c048287b..b783d0f57 100644 --- a/filesystem/android_device.go +++ b/filesystem/android_device.go @@ -79,6 +79,8 @@ type androidDevice struct { partitionProps PartitionNameProperties deviceProps DeviceProperties + + allImagesZip android.Path } func AndroidDeviceFactory() android.Module { @@ -202,6 +204,17 @@ func (a *androidDevice) GenerateAndroidBuildActions(ctx android.ModuleContext) { deps = append(deps, imageOutput.DefaultOutputFiles[0]) }) + allImagesZip := android.PathForModuleOut(ctx, "all_images.zip") + allImagesZipBuilder := android.NewRuleBuilder(pctx, ctx) + cmd := allImagesZipBuilder.Command().BuiltTool("soong_zip").Flag("--sort_entries") + for _, dep := range deps { + cmd.FlagWithArg("-e ", dep.Base()) + cmd.FlagWithInput("-f ", dep) + } + cmd.FlagWithOutput("-o ", allImagesZip) + allImagesZipBuilder.Build("soong_all_images_zip", "all_images.zip") + a.allImagesZip = allImagesZip + allImagesStamp := android.PathForModuleOut(ctx, "all_images_stamp") var validations android.Paths if !ctx.Config().KatiEnabled() && proptools.Bool(a.deviceProps.Main_device) { @@ -226,6 +239,12 @@ func (a *androidDevice) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.setVbmetaPhonyTargets(ctx) } +func (a *androidDevice) MakeVars(ctx android.MakeVarsModuleContext) { + if proptools.Bool(a.deviceProps.Main_device) { + ctx.StrictRaw("SOONG_ONLY_ALL_IMAGES_ZIP", a.allImagesZip.String()) + } +} + // Helper structs for target_files.zip creation type targetFilesZipCopy struct { srcModule *string |