Skip to content

[META] AndroidX migration plan #23112

@dulmandakh

Description

@dulmandakh

Google introduced AndroidX as a new era for the Support Library https://android-developers.googleblog.com/2018/05/hello-world-androidx.html, and it is the future. I would like to talk and plan migration to it.

About AndroidX

For more information about AndroidX please visit https://developer.android.com/jetpack/androidx/.
And migration guide https://developer.android.com/jetpack/androidx/migrate.

Buck target naming

BUCK is used to run build and run tests both on Circle CI and FB internally. But there are differences in setup (or configuration) due to special requirements. And there are many complications due to this difference, which results in many Import Failed even when CI is passing.

To resolve Import failed issues and make contributions easier we need to make sure that AndroidX target names are same in both GitHub and FB, even though the setup is different.

Proposal

I think it's best to try to follow AndroidX package naming and dependency as much possible. See https://developer.android.com/jetpack/androidx/migrate

Let's assume we have third-party/android/androidx as root, then target names will be third-party/android/androidx:annotation, third-party/android/androidx:core-common, third-party/android/androidx:lifecycle-common etc.

And use exported_deps to export libraries that it depends on. For example, androidx:core-common will export itself and androidx:annotations, because it depends on it. So it's enough to import just androidx:core-common and not think about its dependencies like in Gradle.

Only AndroidX package names or targets will have visibility of PUBLIC or ReactAndroid, and other targets or implementations details remain only visible in the file. Make sure that no other BUCK rules depend on internal targets, but only exported ones.

Todo

  • Agree on BUCK target naming
  • Agree on deadline
  • Land AndroidX in BUCK
  • Land AndroidX in Gradle
  • Change target names in BUCK files and package names in .java files. And export to GitHub.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions