From 925aa09ea1525030be3bbdd00842a8787f879fd2 Mon Sep 17 00:00:00 2001 From: Rob Seymour Date: Tue, 10 Aug 2021 20:42:03 +0000 Subject: 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 --- python/python.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'python/python.go') diff --git a/python/python.go b/python/python.go index 0f5b7880e..2a848ca9c 100644 --- a/python/python.go +++ b/python/python.go @@ -310,13 +310,16 @@ func versionSplitMutator() func(android.BottomUpMutatorContext) { // HostToolPath returns a path if appropriate such that this module can be used as a host tool, // fulfilling HostToolProvider interface. func (p *Module) HostToolPath() android.OptionalPath { - if p.installer == nil { - // python_library is just meta module, and doesn't have any installer. - return android.OptionalPath{} + if p.installer != nil { + if bin, ok := p.installer.(*binaryDecorator); ok { + // TODO: This should only be set when building host binaries -- tests built for device would be + // setting this incorrectly. + return android.OptionalPathForPath(bin.path) + } } - // TODO: This should only be set when building host binaries -- tests built for device would be - // setting this incorrectly. - return android.OptionalPathForPath(p.installer.(*binaryDecorator).path) + + return android.OptionalPath{} + } // OutputFiles returns output files based on given tag, returns an error if tag is unsupported. -- cgit v1.2.3-59-g8ed1b