Skip to content

feat(android_sdk_repository): support string-based platform API level#473

Open
larryxiao625 wants to merge 1 commit intobazelbuild:mainfrom
larryxiao625:feat/support_string_based_platform_api_levels
Open

feat(android_sdk_repository): support string-based platform API level#473
larryxiao625 wants to merge 1 commit intobazelbuild:mainfrom
larryxiao625:feat/support_string_based_platform_api_levels

Conversation

@larryxiao625
Copy link
Copy Markdown

Previously, API levels were handled as integers, which prevented support for minor version formats like "36.1". This change migrates the entire android_sdk_repository rule to treat API levels as strings throughout. This is intend to fix #472

Changes:

  • Rename int_flag/_int_flag_impl to string_flag/_string_flag_impl in helper.bzl; update config type and formatting from int to string
  • Update _read_api_levels in rule.bzl to use is_android_revision and store levels as strings; update default API level selection to parse and compare major.minor.micro components
  • Update all name/path/log formatting from %d to %s for api_level
  • Pass default_api_level as string in template.bzl
  • Add test_platforms_with_minor_versions test to verify "36.1" style API levels are correctly recognized and logged

…s (e.g., "36.1")

Previously, API levels were handled as integers, which prevented support
for minor version formats like "36.1". This change migrates the entire
android_sdk_repository rule to treat API levels as strings throughout.

Changes:
- Rename `int_flag`/`_int_flag_impl` to `string_flag`/`_string_flag_impl`
  in helper.bzl; update config type and formatting from int to string
- Update `_read_api_levels` in rule.bzl to use `is_android_revision` and
  store levels as strings; update default API level selection to parse and
  compare major.minor.micro components
- Update all name/path/log formatting from `%d` to `%s` for api_level
- Pass `default_api_level` as string in template.bzl
- Add `test_platforms_with_minor_versions` test to verify "36.1" style
  API levels are correctly recognized and logged
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.

android_sdk_repository: Support string-based platform API levels (e.g., "36.1")

1 participant