realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Migrate to new transformer API #7714

Closed sync-by-unito[bot] closed 1 year ago

sync-by-unito[bot] commented 1 year ago

Due to removal of the old transformer API we will have to migrate to the new AGP transformer infrastructure: https://developer.android.com/studio/releases/gradle-plugin-api-updates#agp-8-0-0

From AGP 7.2.x using the old transformer API will issue the below warning during the build.

AGPBI: {"kind":"warning","text":"API 'android.registerTransform' is obsolete.\nIt will be removed in version 8.0 of the Android Gradle plugin.\nThe Transform API is removed to improve build performance. Projects that use the\nTransform API force the Android Gradle plugin to use a less optimized flow for the\nbuild that can result in large regressions in build times. It’s also difficult to\nuse the Transform API and combine it with other Gradle features; the replacement\nAPIs aim to make it easier to extend the build without introducing performance or\ncorrectness issues.\n\nThere is no single replacement for the Transform API—there are new, targeted\nAPIs for each use case. All the replacement APIs are in the\nandroidComponents {} block.\nFor more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.\nTo determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.","sources":[{}]}

TylerMcCraw commented 1 year ago

@rorbech Hey! I saw that you all did some work to fix this issue in the https://github.com/realm/realm-java/pull/7694 PR. Is there anything I can do to help test it out and provide feedback? Is there a snapshot build with this update?

Thanks for taking care of this update!

rorbech commented 1 year ago

Hi @TylerMcCraw. We are working on doing a proper named release, but you are very welcome to try out the 10.12.0-transformer-api-SNAPSHOT until then. You can use snapshot releases following the instructions of https://github.com/realm/realm-java#using-snapshots

rorbech commented 1 year ago

We have released a 10.12.0-transformer-api-version of 10.12.0 that uses the new transformer API from the Android Gradle Plugin. Due to issues in the Android Gradle Plugin it only works from AGP 7.4 and above. See https://github.com/realm/realm-java/blob/release/transformer-api/CHANGELOG.md for the details.

We will keep doing these kind of release side by side with our normal releases until we deem it appropriately to make use of this new API the default.