diff options
author | Liz Kammer <eakammer@google.com> | 2020-06-12 16:38:45 -0700 |
---|---|---|
committer | Liz Kammer <eakammer@google.com> | 2020-07-27 09:14:06 -0700 |
commit | dd849a81f30d38db789499e1e404def6d3f71783 (patch) | |
tree | 69b046c4a98914ffd496fdfbacab0db3d78f5cef /python/python.go | |
parent | 41b4d79dab95b97352dfbc894e65eec7832211ed (diff) |
Add `data_native_bins` property to java_test_host
When multiple os/arch variants are supported, java_test_host could not
find a matching arch due to java having arch:common, whereas native
binaries support a specific architecture. This change adds the property
`data_native_bins` in order to support binaries with the appropriate
os/arch variants.
Test: m FirmwareDtboVerification with data_native_bins
Test: forrest
Bug: 153848038
Change-Id: I45adebff0fde2811d5ef5620c697b97b768c951f
Diffstat (limited to 'python/python.go')
-rw-r--r-- | python/python.go | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/python/python.go b/python/python.go index a6c9e2a07..479c7291d 100644 --- a/python/python.go +++ b/python/python.go @@ -30,9 +30,11 @@ import ( ) func init() { - android.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { - ctx.BottomUp("version_split", versionSplitMutator()).Parallel() - }) + android.PreDepsMutators(RegisterPythonPreDepsMutators) +} + +func RegisterPythonPreDepsMutators(ctx android.RegisterMutatorsContext) { + ctx.BottomUp("version_split", versionSplitMutator()).Parallel() } // the version properties that apply to python libraries and binaries. @@ -226,15 +228,20 @@ func versionSplitMutator() func(android.BottomUpMutatorContext) { return func(mctx android.BottomUpMutatorContext) { if base, ok := mctx.Module().(*Module); ok { versionNames := []string{} - if base.properties.Version.Py2.Enabled != nil && - *(base.properties.Version.Py2.Enabled) == true { - versionNames = append(versionNames, pyVersion2) - } + // PY3 is first so that we alias the PY3 variant rather than PY2 if both + // are available if !(base.properties.Version.Py3.Enabled != nil && *(base.properties.Version.Py3.Enabled) == false) { versionNames = append(versionNames, pyVersion3) } + if base.properties.Version.Py2.Enabled != nil && + *(base.properties.Version.Py2.Enabled) == true { + versionNames = append(versionNames, pyVersion2) + } modules := mctx.CreateVariations(versionNames...) + if len(versionNames) > 0 { + mctx.AliasVariation(versionNames[0]) + } for i, v := range versionNames { // set the actual version for Python module. modules[i].(*Module).properties.Actual_version = v |