Merge "Cleaning up comment removal and version replacement"
This commit is contained in:
@@ -83,11 +83,6 @@ var (
|
|||||||
Description: "prepare ${out}",
|
Description: "prepare ${out}",
|
||||||
}, "provideNativeLibs", "requireNativeLibs", "default_version", "opt")
|
}, "provideNativeLibs", "requireNativeLibs", "default_version", "opt")
|
||||||
|
|
||||||
stripCommentsApexManifestRule = pctx.StaticRule("stripCommentsApexManifestRule", blueprint.RuleParams{
|
|
||||||
Command: `sed '/^\s*\/\//d' $in > $out`,
|
|
||||||
Description: "strip lines starting with // ${in}=>${out}",
|
|
||||||
})
|
|
||||||
|
|
||||||
stripApexManifestRule = pctx.StaticRule("stripApexManifestRule", blueprint.RuleParams{
|
stripApexManifestRule = pctx.StaticRule("stripApexManifestRule", blueprint.RuleParams{
|
||||||
Command: `rm -f $out && ${conv_apex_manifest} strip $in -o $out`,
|
Command: `rm -f $out && ${conv_apex_manifest} strip $in -o $out`,
|
||||||
CommandDeps: []string{"${conv_apex_manifest}"},
|
CommandDeps: []string{"${conv_apex_manifest}"},
|
||||||
@@ -113,7 +108,6 @@ var (
|
|||||||
`--canned_fs_config ${canned_fs_config} ` +
|
`--canned_fs_config ${canned_fs_config} ` +
|
||||||
`--include_build_info ` +
|
`--include_build_info ` +
|
||||||
`--payload_type image ` +
|
`--payload_type image ` +
|
||||||
`--apex_version ${apex_version} ` +
|
|
||||||
`--key ${key} ${opt_flags} ${image_dir} ${out} `,
|
`--key ${key} ${opt_flags} ${image_dir} ${out} `,
|
||||||
CommandDeps: []string{"${apexer}", "${avbtool}", "${e2fsdroid}", "${merge_zips}",
|
CommandDeps: []string{"${apexer}", "${avbtool}", "${e2fsdroid}", "${merge_zips}",
|
||||||
"${mke2fs}", "${resize2fs}", "${sefcontext_compile}", "${make_f2fs}", "${sload_f2fs}", "${make_erofs}",
|
"${mke2fs}", "${resize2fs}", "${sefcontext_compile}", "${make_f2fs}", "${sload_f2fs}", "${make_erofs}",
|
||||||
@@ -121,7 +115,7 @@ var (
|
|||||||
Rspfile: "${out}.copy_commands",
|
Rspfile: "${out}.copy_commands",
|
||||||
RspfileContent: "${copy_commands}",
|
RspfileContent: "${copy_commands}",
|
||||||
Description: "APEX ${image_dir} => ${out}",
|
Description: "APEX ${image_dir} => ${out}",
|
||||||
}, "tool_path", "image_dir", "copy_commands", "file_contexts", "canned_fs_config", "key", "opt_flags", "manifest", "payload_fs_type", "apex_version")
|
}, "tool_path", "image_dir", "copy_commands", "file_contexts", "canned_fs_config", "key", "opt_flags", "manifest", "payload_fs_type")
|
||||||
|
|
||||||
zipApexRule = pctx.StaticRule("zipApexRule", blueprint.RuleParams{
|
zipApexRule = pctx.StaticRule("zipApexRule", blueprint.RuleParams{
|
||||||
Command: `rm -rf ${image_dir} && mkdir -p ${image_dir} && ` +
|
Command: `rm -rf ${image_dir} && mkdir -p ${image_dir} && ` +
|
||||||
@@ -129,13 +123,12 @@ var (
|
|||||||
`APEXER_TOOL_PATH=${tool_path} ` +
|
`APEXER_TOOL_PATH=${tool_path} ` +
|
||||||
`${apexer} --force --manifest ${manifest} ` +
|
`${apexer} --force --manifest ${manifest} ` +
|
||||||
`--payload_type zip ` +
|
`--payload_type zip ` +
|
||||||
`--apex_version ${apex_version} ` +
|
|
||||||
`${image_dir} ${out} `,
|
`${image_dir} ${out} `,
|
||||||
CommandDeps: []string{"${apexer}", "${merge_zips}", "${soong_zip}", "${zipalign}", "${aapt2}"},
|
CommandDeps: []string{"${apexer}", "${merge_zips}", "${soong_zip}", "${zipalign}", "${aapt2}"},
|
||||||
Rspfile: "${out}.copy_commands",
|
Rspfile: "${out}.copy_commands",
|
||||||
RspfileContent: "${copy_commands}",
|
RspfileContent: "${copy_commands}",
|
||||||
Description: "ZipAPEX ${image_dir} => ${out}",
|
Description: "ZipAPEX ${image_dir} => ${out}",
|
||||||
}, "tool_path", "image_dir", "copy_commands", "manifest", "apex_version")
|
}, "tool_path", "image_dir", "copy_commands", "manifest")
|
||||||
|
|
||||||
apexProtoConvertRule = pctx.AndroidStaticRule("apexProtoConvertRule",
|
apexProtoConvertRule = pctx.AndroidStaticRule("apexProtoConvertRule",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
@@ -213,17 +206,10 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
|
|||||||
optCommands = append(optCommands, "-a jniLibs "+strings.Join(jniLibs, " "))
|
optCommands = append(optCommands, "-a jniLibs "+strings.Join(jniLibs, " "))
|
||||||
}
|
}
|
||||||
|
|
||||||
manifestJsonCommentsStripped := android.PathForModuleOut(ctx, "apex_manifest_comments_stripped.json")
|
|
||||||
ctx.Build(pctx, android.BuildParams{
|
|
||||||
Rule: stripCommentsApexManifestRule,
|
|
||||||
Input: src,
|
|
||||||
Output: manifestJsonCommentsStripped,
|
|
||||||
})
|
|
||||||
|
|
||||||
manifestJsonFullOut := android.PathForModuleOut(ctx, "apex_manifest_full.json")
|
manifestJsonFullOut := android.PathForModuleOut(ctx, "apex_manifest_full.json")
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: apexManifestRule,
|
Rule: apexManifestRule,
|
||||||
Input: manifestJsonCommentsStripped,
|
Input: src,
|
||||||
Output: manifestJsonFullOut,
|
Output: manifestJsonFullOut,
|
||||||
Args: map[string]string{
|
Args: map[string]string{
|
||||||
"provideNativeLibs": strings.Join(provideNativeLibs, " "),
|
"provideNativeLibs": strings.Join(provideNativeLibs, " "),
|
||||||
@@ -686,7 +672,6 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
|||||||
"file_contexts": fileContexts.String(),
|
"file_contexts": fileContexts.String(),
|
||||||
"canned_fs_config": cannedFsConfig.String(),
|
"canned_fs_config": cannedFsConfig.String(),
|
||||||
"key": a.privateKeyFile.String(),
|
"key": a.privateKeyFile.String(),
|
||||||
"apex_version": defaultManifestVersion,
|
|
||||||
"opt_flags": strings.Join(optFlags, " "),
|
"opt_flags": strings.Join(optFlags, " "),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -783,7 +768,6 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
|||||||
"image_dir": imageDir.String(),
|
"image_dir": imageDir.String(),
|
||||||
"copy_commands": strings.Join(copyCommands, " && "),
|
"copy_commands": strings.Join(copyCommands, " && "),
|
||||||
"manifest": a.manifestPbOut.String(),
|
"manifest": a.manifestPbOut.String(),
|
||||||
"apex_version": defaultManifestVersion,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user