From b8bdacfd0b2262250ce375af2729b39d66eeec59 Mon Sep 17 00:00:00 2001 From: Nan Zhang Date: Wed, 6 Dec 2017 15:13:10 -0800 Subject: [PATCH] Add HostToolPath() for Python binary So in the genrule, Python binary module can be used as tool. Test: manually write a test genrule. Change-Id: Idfd3af4c1002dd608e1bdffa203e01c802f1bf21 --- python/python.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/python.go b/python/python.go index 05efbeae9..9a3b1bbc3 100644 --- a/python/python.go +++ b/python/python.go @@ -242,6 +242,14 @@ func versionSplitMutator() func(android.BottomUpMutatorContext) { } } +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{} + } + return android.OptionalPathForPath(p.installer.(*binaryDecorator).path) +} + func (p *Module) isEmbeddedLauncherEnabled(actual_version string) bool { switch actual_version { case pyVersion2: