summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
author Rob Seymour <rseymour@google.com> 2021-09-14 14:47:03 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-09-14 14:47:03 +0000
commitf6c37cc87d9452d6e51b6e53a5f0a8e81b8a489a (patch)
treecd25591f961c7ec9d356c52b0635df09f4f04fc5 /python
parent04e0a1551d87dcc553aa3d0df0c6d837cd23483e (diff)
parent925aa09ea1525030be3bbdd00842a8787f879fd2 (diff)
Merge "Add module based host-tools snapshot"
Diffstat (limited to 'python')
-rw-r--r--python/python.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/python/python.go b/python/python.go
index 83844e642..a35a1ac9c 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.