Add property to apex soong modules to generate an APEX without hashtree
This will help testing on-device hashtree generation.
Test: see other CL in topic
Bug: 145670581
Change-Id: I96b1b2392302aed8a6e80ed52de2d057a532a288
diff --git a/apex/builder.go b/apex/builder.go
index 0232c1e..0bb6891 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -375,7 +375,11 @@
optFlags = append(optFlags, "--assets_dir "+filepath.Dir(noticeFile.String()))
}
- if !ctx.Config().UnbundledBuild() && a.installable() {
+ if ctx.ModuleDir() != "system/apex/apexd/apexd_testdata" && a.testOnlyShouldSkipHashtreeGeneration() {
+ ctx.PropertyErrorf("test_only_no_hashtree", "not available")
+ return
+ }
+ if (!ctx.Config().UnbundledBuild() && a.installable()) || a.testOnlyShouldSkipHashtreeGeneration() {
// Apexes which are supposed to be installed in builtin dirs(/system, etc)
// don't need hashtree for activation. Therefore, by removing hashtree from
// apex bundle (filesystem image in it, to be specific), we can save storage.