-
Notifications
You must be signed in to change notification settings - Fork 109
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
Include desugaring lib also in library modules #1604
Conversation
As per: https://developer.android.com/studio/write/java8-support#library-desugaring Rationale is that desugaring is applied by D8/R8 when generating dex files, so libraries alone are never desugared because AARs carry .class files. Another thing to always make sure of is that, whenever `isCoreLibraryDesugaringEnabled = true` to always add the relative dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1604 +/- ##
========================================
Coverage 58.96% 58.96%
========================================
Files 1199 1199
Lines 30961 30961
Branches 6343 6343
========================================
Hits 18257 18257
Misses 9959 9959
Partials 2745 2745 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. ./gradlew tasks
works again with this.
Kudos, SonarCloud Quality Gate passed! |
Unfortunately this change triggers lint errors on the library modules which use java8 apis. I had to reverse course: Will enable desugaring AND include the desugar dep in all modules. |
Type of change
Content
Includes the
coreLibraryDesugaring(libs.android.desugar)
dependency in all modules which use one of our gradle plugins.Motivation and context
Right now desugaring is enabled also in library modules but the desugar dependency is not included in those.
This causes some unwanted side effects such as being unable to run compose previews in an emu.
This change will also include the desugar dependency in those libraries.