diff options
author | Cole Faust <colefaust@google.com> | 2022-10-19 11:14:31 -0700 |
---|---|---|
committer | Cole Faust <colefaust@google.com> | 2023-01-05 12:41:29 -0800 |
commit | f453fe83d9cfdcc4299f1729491ea7325d53774c (patch) | |
tree | 599664529d094ed631e28acce873abe6a7a5e185 /rules/apex/apex_aab.bzl | |
parent | 89318f00525509b977ae13d75c596f2df89707a6 (diff) | |
download | bazel-f453fe83d9cfdcc4299f1729491ea7325d53774c.tar.gz |
Support multiple android products in a single bazel build
We create an android_product macro that replaces a lot
of the existing platform code. It takes a soong.variables
file, and creates bazel platforms for the android product,
various other arches, and the host platforms. (currently
host builds still depend on product config variables)
To change products, you'll be able to pass
--platform=//build/bazel/product_config/generated/products/<product_name>,
however currently we only generate the platforms for the
currently lunched product for performance. When the other
products are in starlark, we can allow using all of them.
Bug: 249685973
Test: Presubmits
Change-Id: Ic1b0942a60c66eb3fe2b1aa7a2ff436ec9b3c3fb
Diffstat (limited to 'rules/apex/apex_aab.bzl')
-rw-r--r-- | rules/apex/apex_aab.bzl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/rules/apex/apex_aab.bzl b/rules/apex/apex_aab.bzl index 7de7ec51..e89679c2 100644 --- a/rules/apex/apex_aab.bzl +++ b/rules/apex/apex_aab.bzl @@ -26,25 +26,31 @@ def _arch_transition_impl(settings, attr): """Implementation of arch_transition. Four archs are included for mainline modules: x86, x86_64, arm and arm64. """ + old_platform = str(settings["//command_line_option:platforms"][0]) + + # TODO(b/249685973) Instead of using these __internal_x86 platforms, use + # the mainline_modules_<arch> android products return { "x86": { - "//command_line_option:platforms": "//build/bazel/platforms:android_x86", + "//command_line_option:platforms": old_platform + "__internal_x86", }, "x86_64": { - "//command_line_option:platforms": "//build/bazel/platforms:android_x86_64", + "//command_line_option:platforms": old_platform + "__internal_x86_64", }, "arm": { - "//command_line_option:platforms": "//build/bazel/platforms:android_arm", + "//command_line_option:platforms": old_platform + "__internal_arm", }, "arm64": { - "//command_line_option:platforms": "//build/bazel/platforms:android_arm64", + "//command_line_option:platforms": old_platform + "__internal_arm64", }, } # Multi-arch transition. arch_transition = transition( implementation = _arch_transition_impl, - inputs = [], + inputs = [ + "//command_line_option:platforms", + ], outputs = [ "//command_line_option:platforms", ], |