-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve bzlmod support for downstream users #147
base: main
Are you sure you want to change the base?
Improve bzlmod support for downstream users #147
Conversation
This adds a way to setup the androidsdk repo in a bzlmod compatible way.
@@ -91,7 +91,7 @@ TOOL_ATTRS = dict( | |||
executable = True, | |||
), | |||
_d8 = attr.label( | |||
default = Label("@bazel_tools//src/tools/android/java/com/google/devtools/build/android/r8:r8"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is invalid, but in general we have to break all the dependencies on //external:android
from bazel, and this is one of them.
@@ -80,6 +80,42 @@ def _create_config_setting_rule(): | |||
flag_values = {":allow_proguard": "false"}, | |||
) | |||
|
|||
def create_dummy_sdk_toolchain(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is required otherwise you get a toolchain resolution failure when it is looking for a android toolchain targeting the host. This likely shouldn't happen, but this is what bazel itself is doing so it's probably fine for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will it happen? In normal situation, shouldn't users always build apps targeting an Android platform with specific API level? Is it for avoiding setting up the target platforms/API level in examples?
**kwargs | ||
) | ||
|
||
android_sdk_extension = module_extension( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this extension allows multiple consumers to call it, and the root settings will take precedence, but importantly it's exposed to anyone who calls it
This adds a way to setup the androidsdk repo in a bzlmod compatible way.