Add module based host-tools snapshot

Add new module:
host_snapshot {
    name: "host-snapshot"
    deps: [
      (list of host tools)
    ],
    ...
}

Package host tools using android.PackagingBase to capture host tools and transitive packaging data.
Add JSON meta data to snapshot that allows snapshot to be installed via development/vendor_snapshot/update.py

Add support to generate a fake host snapshot of all host modules that is used to detect required
modules via development/vendor_snapshot/update.py.

Bug: 192556798
Bug: 194799048
Bug: 192896149
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist -- check snapshot exists in dist

Change-Id: I849c4db801cd858408f6fe6a3ce69262a23a5be9
This commit is contained in:
Rob Seymour
2021-08-10 20:42:03 +00:00
parent bf49705608
commit 925aa09ea1
15 changed files with 642 additions and 20 deletions

View File

@@ -519,13 +519,6 @@ func PrebuiltRFSAFactory() android.Module {
return module
}
// Flags to be included in the snapshot
type snapshotJsonFlags struct {
ModuleName string `json:",omitempty"`
Filename string `json:",omitempty"`
RelativeInstallPath string `json:",omitempty"`
}
// Copy file into the snapshot
func copyFile(ctx android.SingletonContext, path android.Path, out string, fake bool) android.OutputPath {
if fake {
@@ -612,7 +605,7 @@ func generatePrebuiltSnapshot(s snapshot.SnapshotSingleton, ctx android.Singleto
snapshotLibOut := filepath.Join(snapshotArchDir, targetArch, "etc", m.BaseModuleName())
snapshotOutputs = append(snapshotOutputs, copyFile(ctx, m.OutputFile(), snapshotLibOut, s.Fake))
prop := snapshotJsonFlags{}
prop := snapshot.SnapshotJsonFlags{}
propOut := snapshotLibOut + ".json"
prop.ModuleName = m.BaseModuleName()
if m.subdirProperties.Relative_install_path != nil {