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

Android Rules Starlark Migration #5354

Closed
jin opened this issue Jun 8, 2018 · 13 comments
Closed

Android Rules Starlark Migration #5354

jin opened this issue Jun 8, 2018 · 13 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Android Issues for Android team type: process

Comments

@jin
Copy link
Member

jin commented Jun 8, 2018

Tracking bug for the Starlark migration of android_* rules to https://github.com/bazelbuild/rules_android

cc @bazelbuild/android

Timeline

June 4, 2018

Related issues:

@jin jin added P1 I'll work on this now. (Assignee required) category: rules > android type: process labels Jun 8, 2018
@jin jin assigned jin and ahumesky Jun 8, 2018
@jin jin changed the title Android Skylark Migration Android Rules Skylark Migration Jun 8, 2018
@aj-michael
Copy link
Contributor

Why is moving android tools out of the binary a blocking issue?

@jin
Copy link
Member Author

jin commented Jun 27, 2018

@aj-michael renamed it to "related". It doesn't block the rewrite, but will be good to also migrate our tools out to tools_android (which @ahumesky is making)

@jin jin added team-Android Issues for Android team and removed category: rules > android labels Aug 11, 2018
@jin jin changed the title Android Rules Skylark Migration Android Rules Starlark Migration Dec 11, 2018
@jin
Copy link
Member Author

jin commented Dec 19, 2018

/tag @bazelbuild/android

@jin
Copy link
Member Author

jin commented Dec 19, 2018

It would be great to have an update on the progress of the rules, considering that it's been 6 months since rules_android was created. @10-10-11 / @ahumesky?

@jin
Copy link
Member Author

jin commented Apr 18, 2019

The rules_android roadmap is live: https://github.com/bazelbuild/rules_android/blob/master/ROADMAP.md

@cgruber
Copy link
Contributor

cgruber commented Aug 3, 2019

Given the impending Bazel 1.0 release, can we get some progress update here? There are a lot of us, and several substantial migrations (including ours at Square), hanging on this dropping, so it would be nice to get a picture of where we're at. (@jin @ahumesky etc).

@keith
Copy link
Member

keith commented Aug 3, 2019

Just want to throw in a +1 that the Lyft migration is also waiting on these and the kotlin rules.

@artem-zinnatullin
Copy link
Contributor

Posted PR that updates Android tutorial on the website to use rules_android: #9220

@jin jin mentioned this issue Sep 3, 2019
@jin jin removed their assignment May 6, 2020
@steeve
Copy link
Contributor

steeve commented Jun 13, 2020

Hey folks,

During BazelCon 2019, it was said that the starlark Android rules where at feature parity with the Java, in-Bazel ones. It was also said they were already used inside Google and that open source was going to be soon-ish.

Would it be possible to have an official statement as to what the roadmap is?
Since the rules_android repository hasn't had a commit in almost a year.

This also means that legacy Android rules won't probably much development, and issues such as #11497 don't have any clear way on how to approach them.

Thanks you

@ahumesky
Copy link
Contributor

ahumesky commented Dec 3, 2020

Although we don't have a concrete timeline, this is being actively worked on this quarter and next. The soonest we can publish something that works in a minimal way is probably middle of Q1 2021.

@ahumesky
Copy link
Contributor

ahumesky commented Feb 3, 2021

Hi all,
We've pushed a few updates to a "pre-alpha" branch of the rules_android repo:
https://github.com/bazelbuild/rules_android/tree/pre-alpha

These updates contain a significant amount of the Starlark code for the Android toolchains, resource processing, and the android_library rule. It should be possible to build an Android app using the Starlark version of android_library, and the native (i.e. Java) version of android_binary (the Starlark version of android_binary is still just a simple wrapper around the native version). See the readme for requirements.

Some of the next steps are to publish the Starlark version of aar_import, and to enable rules_jvm_external to generate dependencies using that Starlark version. After that, there is still a fair bit of work to be done to finish and publish the Starlark version of android_binary. We might also publish some intermediate steps (e.g. an android_binary that delegates functionality to helper rules written in Starlark, all wrapped in an android_binary macro. then over time the helper functions do more and more and the native version goes away).

@ahumesky
Copy link
Contributor

ahumesky commented Dec 6, 2024

To update on the progress here, the 0.5.1 release of rules_android contains mostly Starlark rules, with notable exception android_sdk_repository, android_local_test, android_sdk, android_ndk_repository, and all Android providers still relying on native rules.

rules_android 0.6.0 will contain fully Starlark rules, and the progress of the 0.6.0 release is being tracked in bazelbuild/rules_android#278

The native Android rules have been removed from Bazel 8, and rules_android 0.6.0 will be compatible with Bazel 8 for migration.

@ahumesky
Copy link
Contributor

ahumesky commented Dec 13, 2024

rules_android 0.6.0 has been released: https://github.com/bazelbuild/rules_android/releases/tag/v0.6.0. rules_android 0.6.0 contains fully Starlark Android rules, including Starlark Android Providers and the native Android rules have been removed in Bazel 8.

While the Starlark rules are near 1:1 replacements for the native, some differences should be noted:

  1. R8 is supported, proguard is no longer supported
  2. Legacy Android flags (--fat_apk_cpu, --android_crosstool_top, --android_cpu) are no-ops and replaced with toolchains and platforms (--android_platforms)
  3. android_ndk_repository is migrated to https://github.com/bazelbuild/rules_android_ndk
  4. android_instrumentation_test is migrated to https://github.com/bazelbuild/rules_utp
  5. Manifests are merged in dependency order rather than legacy alphabetical order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Android Issues for Android team type: process
Projects
None yet
Development

No branches or pull requests

8 participants