diff options
author | Nan Zhang <nanzhang@google.com> | 2017-12-06 15:13:10 -0800 |
---|---|---|
committer | Nan Zhang <nanzhang@google.com> | 2017-12-06 15:13:10 -0800 |
commit | b8bdacfd0b2262250ce375af2729b39d66eeec59 (patch) | |
tree | acd97017647f4b0a2a9f1b53de6d3a01da0b5c29 /python | |
parent | e15ddaf4ae1de2e789197de3eb3f70ff40327a5b (diff) | |
download | build_soong-b8bdacfd0b2262250ce375af2729b39d66eeec59.tar.gz build_soong-b8bdacfd0b2262250ce375af2729b39d66eeec59.tar.bz2 build_soong-b8bdacfd0b2262250ce375af2729b39d66eeec59.zip |
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
Diffstat (limited to 'python')
-rw-r--r-- | python/python.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/python.go b/python/python.go index 05efbeae..9a3b1bbc 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: |