aboutsummaryrefslogtreecommitdiff
path: root/snapshot
diff options
context:
space:
mode:
authorRob Seymour <rseymour@google.com>2022-01-31 20:33:52 +0000
committerRob Seymour <rseymour@google.com>2022-01-31 20:38:00 +0000
commit0800ef7007c16e19b772d14eb53b58e10c17069f (patch)
tree8338653c1e082d90f211b89b56ec0f16ae65e3e1 /snapshot
parent7afffe6af099b8ceb578c839d86b69d8e2f5889d (diff)
Fix host snapshot dependency cycle
Test: m host-snapshot Bug: 216351382 Change-Id: Iaa8b7e8373fab0db931cbe7a6328c2adca27d95b
Diffstat (limited to 'snapshot')
-rw-r--r--snapshot/host_snapshot.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/snapshot/host_snapshot.go b/snapshot/host_snapshot.go
index 252cef816..09a382e6e 100644
--- a/snapshot/host_snapshot.go
+++ b/snapshot/host_snapshot.go
@@ -58,7 +58,7 @@ type hostSnapshot struct {
android.ModuleBase
android.PackagingBase
- zipFile android.OptionalPath
+ outputFile android.OutputPath
installDir android.InstallPath
}
@@ -141,7 +141,7 @@ func (f *hostSnapshot) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// Create a zip file for the binaries, and a zip of the meta data, then merge zips
depsZipFile := android.PathForModuleOut(ctx, f.Name()+"_deps.zip").OutputPath
modsZipFile := android.PathForModuleOut(ctx, f.Name()+"_mods.zip").OutputPath
- outputFile := android.PathForModuleOut(ctx, f.installFileName()).OutputPath
+ f.outputFile = android.PathForModuleOut(ctx, f.installFileName()).OutputPath
f.installDir = android.PathForModuleInstall(ctx)
@@ -158,26 +158,21 @@ func (f *hostSnapshot) GenerateAndroidBuildActions(ctx android.ModuleContext) {
builder.Command().
BuiltTool("merge_zips").
- Output(outputFile).
+ Output(f.outputFile).
Input(metaZipFile).
Input(modsZipFile)
builder.Build("manifest", fmt.Sprintf("Adding manifest %s", f.installFileName()))
- zip := ctx.InstallFile(f.installDir, f.installFileName(), outputFile)
- f.zipFile = android.OptionalPathForPath(zip)
+ ctx.InstallFile(f.installDir, f.installFileName(), f.outputFile)
}
// Implements android.AndroidMkEntriesProvider
func (f *hostSnapshot) AndroidMkEntries() []android.AndroidMkEntries {
- if !f.zipFile.Valid() {
- return []android.AndroidMkEntries{}
- }
-
return []android.AndroidMkEntries{android.AndroidMkEntries{
Class: "ETC",
- OutputFile: f.zipFile,
- DistFiles: android.MakeDefaultDistFiles(f.zipFile.Path()),
+ OutputFile: android.OptionalPathForPath(f.outputFile),
+ DistFiles: android.MakeDefaultDistFiles(f.outputFile),
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
entries.SetString("LOCAL_MODULE_PATH", f.installDir.String())