-
Notifications
You must be signed in to change notification settings - Fork 136
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
[Deps] Update Kotlin to 2.0.21 #12896
base: trunk
Are you sure you want to change the base?
Conversation
FYI: This kotlinOptions/jvmTarget configuration is already available on the root level 'build.gradle' file, which applies that automatically to all modules.
Although this change is not required, it is high time it is done in order to update the Java target and compatibility across the project and thus be prepared for any future updates. ------------------------------------------------------------------------ FYI: For example, on JP/WPAndroid this change was actually necessary because otherwise updating to Kotlin 2.0 was failing the build with the below: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':libs:processors:compileKotlin'. > Could not resolve all files for configuration ':libs:processors:compileClasspath'. > Could not resolve com.google.devtools.ksp:symbol-processing-api: 2.0.21-1.0.26. Required by: project :libs:processors > Dependency resolution is looking for a library compatible with JVM runtime version 8, but 'com.google.devtools.ksp: symbol-processing-api:2.0.21-1.0.26' is only compatible with JVM runtime version 11 or newer. PR Commit: https://github.com/wordpress-mobile/WordPress-Android/pull/ 21428/commits/6abe01ec983d0765d4bd1466030097109867ac56
With this change, changing the 'java' version value within the 'libs.versions.toml' next time, will be all it takes to update JVM to point to '17' or beyond.
Starting in Kotlin 2.0, the Compose Compiler Gradle plugin is required when compose is enabled. This change addresses that, along with removing the outdated 'androidx-compose-compiler' configuration. ------------------------------------------------------------------------ FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':WooCommerce'. > com.android.builder.errors.EvalIssueException: Starting in Kotlin 2.0, the Compose Compiler Gradle plugin is required when compose is enabled. See the following link for more information: https://d.android.com/r/studio-ui/compose-compiler
Warning Messages: "This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the '@deprecated' annotation or suppress the diagnostic."
Warning Messages: "Inline property cannot have a backing field. This will become an error in Kotlin 2.1." FYI: For both, the 'ProductListAdapter' and 'AttributeBaseAdapter' classes, this 'inline' keyword got added to 'clickListener' and 'onItemClick' correspondingly, but for no good reason other than fixing an unknown Lint error, and then, probably due to copy-pasting. For more info refer to commits below: - 499904a - 16fb4f5
Warning Messages: "Non-public primary constructor is exposed via the generated 'copy()' method of the 'data' class." FYI: There is no good reason for this constructor to be 'private', that is, instead of it being the default 'public'.
------------------------------------------------------------------------ UpdateAnalyticsHubStatsTest > when syncing stats data starts with forceUpdate false, then follow data store response FAILED kotlin.NoWhenBranchMatchedException at UpdateAnalyticsHubStatsTest.kt:478 UpdateAnalyticsHubStatsTest > when data store allows new stats fetch, then request data with ForceNew strategy FAILED kotlin.NoWhenBranchMatchedException at UpdateAnalyticsHubStatsTest.kt:385 UpdateAnalyticsHubStatsTest > when syncing stats data stats with Stored strategy, then do not store the timestamp FAILED kotlin.NoWhenBranchMatchedException at UpdateAnalyticsHubStatsTest.kt:526 UpdateAnalyticsHubStatsTest > when syncing stats data starts with forceUpdate true, then trigger update with ForceNew Strategy FAILED kotlin.NoWhenBranchMatchedException at UpdateAnalyticsHubStatsTest.kt:453 UpdateAnalyticsHubStatsTest > when selection type is CUSTOM, then follow the data store and request data with Stored strategy FAILED kotlin.NoWhenBranchMatchedException at UpdateAnalyticsHubStatsTest.kt:425 UpdateAnalyticsHubStatsTest > when data store does NOT allows net stats fetch, then request data with Saved strategy FAILED kotlin.NoWhenBranchMatchedException at UpdateAnalyticsHubStatsTest.kt:397
This is done in order to avoid having the generated during build time Kotlin session files being seen by Git.
Build environment changesContent exceeds 65400 characters. Navigate to Buildkite build artifacts to see details. |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #12896 +/- ##
============================================
- Coverage 40.17% 39.61% -0.57%
- Complexity 5798 5918 +120
============================================
Files 1258 1258
Lines 71547 72739 +1192
Branches 9979 9950 -29
============================================
+ Hits 28747 28813 +66
- Misses 40161 41362 +1201
+ Partials 2639 2564 -75 ☔ View full report in Codecov by Sentry. |
…to deps/update-kotlin-to-2.0.21
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.
Leaving some suggestions. Is there any place to review build performance changes for this update?
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/reviews/ReviewModeration.kt
Show resolved
Hide resolved
👋 @wzieba !
Don't you mean this: Associated Metrics: paaHJt-7n2-p2#comment-9682 (see PR description, on top) 🤔 Or, do you have something else in mind? 🤔 |
Yes, thanks! |
This way both the non-public primary constructor being exposed via the generated 'copy()' method of the 'data' class warning, as well as the 'DataClassPrivateConstructor' warning are solved, but at the same time the signature and functionality of the 'ReviewModerationRequest' data class remains unchanged. PR Comment: https://github.com/woocommerce/woocommerce-android/pull/ 12896#discussion_r1837889124
…to deps/update-kotlin-to-2.0.21
PR Comment: https://github.com/woocommerce/woocommerce-android/pull/ 12896#discussion_r1837878971
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 for considering and applying improvements! All LGTM 👍
Project Thread: paaHJt-7n2-p2
Associated Metrics: paaHJt-7n2-p2#comment-9682
This PR updates Kotlin to 2.0 (2.0.21).
Description
FYI: I recommend reviewing this PR commit-by-commit just to make sure that Kotlin has been updated appropriately and that there isn't any left-overs that need addressing.
PS: Main commits for some extra focus:
Testing information
./gradlew buildHealth
task locally and verify that everything is working as expected (CI).(*) Unfortunately, this comment exceeds 65400 characters and thus the only way for us to check on the diff is to do it via the CI artifacts. You could focus on:
tldr_diff_dependencies.txt
tldr_diff_build_env.txt
I have considered if this change warrants release notes and have added them to
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: