Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keith
Copy link
Member

@keith keith commented Sep 20, 2023

This adds a way to setup the androidsdk repo in a bzlmod compatible way.

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"),
Copy link
Member Author

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():
Copy link
Member Author

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

Copy link

@jylinv0 jylinv0 Dec 15, 2023

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(
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants