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
This commit is contained in:
Nan Zhang 2017-12-06 15:13:10 -08:00
parent e15ddaf4ae
commit b8bdacfd0b
1 changed files with 8 additions and 0 deletions

View File

@ -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: