aboutsummaryrefslogtreecommitdiff
path: root/rules/dex_desugar_aspect.bzl
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-10 01:06:58 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-10 01:06:58 +0000
commit91f5a4960f3c73a5e59b27bcc2f8ee4c31b08fc8 (patch)
treea58049c9682d6fd38e8408479340bf3911b87515 /rules/dex_desugar_aspect.bzl
parentbc67c32f96ccf8d0c503a88cbbf7b7ae91559be3 (diff)
parent9e965d6fece27a77de5377433c2f7e6999b8cc0b (diff)
downloadbazelbuild-rules_android-android14-qpr2-release.tar.gz
Change-Id: Ic28eeddca3097c154d1283e0670dc1c497bfc08b
Diffstat (limited to 'rules/dex_desugar_aspect.bzl')
-rw-r--r--rules/dex_desugar_aspect.bzl9
1 files changed, 6 insertions, 3 deletions
diff --git a/rules/dex_desugar_aspect.bzl b/rules/dex_desugar_aspect.bzl
index 9d692d3..066ad1a 100644
--- a/rules/dex_desugar_aspect.bzl
+++ b/rules/dex_desugar_aspect.bzl
@@ -14,7 +14,7 @@
"""Aspect that transitively build .dex archives and desugar jars."""
-load(":utils.bzl", _utils = "utils")
+load(":utils.bzl", _get_android_sdk = "get_android_sdk", _utils = "utils")
load(":dex.bzl", _dex = "dex")
load(":desugar.bzl", _desugar = "desugar")
load(":providers.bzl", "StarlarkAndroidDexInfo")
@@ -193,8 +193,10 @@ def _get_boot_classpath(target, ctx):
compilation_info = target[JavaInfo].compilation_info
if compilation_info and compilation_info.boot_classpath:
return compilation_info.boot_classpath
- if ctx.attr._android_sdk and ctx.attr._android_sdk[AndroidSdkInfo].android_jar:
- return [ctx.attr._android_sdk[AndroidSdkInfo].android_jar]
+
+ android_jar = _get_android_sdk(ctx).android_jar
+ if android_jar:
+ return [android_jar]
# This shouldn't ever be reached, but if it is, we should be clear about the error.
fail("No compilation info or android jar!")
@@ -249,5 +251,6 @@ dex_desugar_aspect = aspect(
_attrs.ANDROID_SDK,
),
fragments = ["android"],
+ toolchains = ["//toolchains/android_sdk:toolchain_type"],
required_aspect_providers = [[JavaInfo]],
)