From c939b0181d097c1a560e9de905fdfa59e4f7ea75 Mon Sep 17 00:00:00 2001 From: Alexei Nicoara Date: Wed, 6 Jul 2022 12:03:11 +0100 Subject: [PATCH] Passing default version to zipApex as well Test: presubmit Bug: 231691643 Change-Id: Ic751d7ea2d23180855897702a03bf1b589d7ef80 --- apex/builder.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apex/builder.go b/apex/builder.go index fc9bb3bec..244dee617 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -107,6 +107,7 @@ var ( `--canned_fs_config ${canned_fs_config} ` + `--include_build_info ` + `--payload_type image ` + + `--apex_version ${apex_version} ` + `--key ${key} ${opt_flags} ${image_dir} ${out} `, CommandDeps: []string{"${apexer}", "${avbtool}", "${e2fsdroid}", "${merge_zips}", "${mke2fs}", "${resize2fs}", "${sefcontext_compile}", "${make_f2fs}", "${sload_f2fs}", "${make_erofs}", @@ -114,7 +115,7 @@ var ( Rspfile: "${out}.copy_commands", RspfileContent: "${copy_commands}", Description: "APEX ${image_dir} => ${out}", - }, "tool_path", "image_dir", "copy_commands", "file_contexts", "canned_fs_config", "key", "opt_flags", "manifest", "payload_fs_type") + }, "tool_path", "image_dir", "copy_commands", "file_contexts", "canned_fs_config", "key", "opt_flags", "manifest", "payload_fs_type", "apex_version") zipApexRule = pctx.StaticRule("zipApexRule", blueprint.RuleParams{ Command: `rm -rf ${image_dir} && mkdir -p ${image_dir} && ` + @@ -122,12 +123,13 @@ var ( `APEXER_TOOL_PATH=${tool_path} ` + `${apexer} --force --manifest ${manifest} ` + `--payload_type zip ` + + `--apex_version ${apex_version} ` + `${image_dir} ${out} `, CommandDeps: []string{"${apexer}", "${merge_zips}", "${soong_zip}", "${zipalign}", "${aapt2}"}, Rspfile: "${out}.copy_commands", RspfileContent: "${copy_commands}", Description: "ZipAPEX ${image_dir} => ${out}", - }, "tool_path", "image_dir", "copy_commands", "manifest") + }, "tool_path", "image_dir", "copy_commands", "manifest", "apex_version") apexProtoConvertRule = pctx.AndroidStaticRule("apexProtoConvertRule", blueprint.RuleParams{ @@ -655,8 +657,6 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { optFlags = append(optFlags, "--manifest_json "+a.manifestJsonOut.String()) } - optFlags = append(optFlags, "--apex_version "+defaultManifestVersion) - optFlags = append(optFlags, "--payload_fs_type "+a.payloadFsType.string()) ctx.Build(pctx, android.BuildParams{ @@ -672,6 +672,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { "file_contexts": fileContexts.String(), "canned_fs_config": cannedFsConfig.String(), "key": a.privateKeyFile.String(), + "apex_version": defaultManifestVersion, "opt_flags": strings.Join(optFlags, " "), }, }) @@ -768,6 +769,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { "image_dir": imageDir.String(), "copy_commands": strings.Join(copyCommands, " && "), "manifest": a.manifestPbOut.String(), + "apex_version": defaultManifestVersion, }, }) }