-
Notifications
You must be signed in to change notification settings - Fork 15
RUM-11262: Upgrade Kotlin Version to 2.1.21 to remove metadata check error #420
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
RUM-11262: Upgrade Kotlin Version to 2.1.21 to remove metadata check error #420
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/kotlin-source-sets #420 +/- ##
================================================================
- Coverage 76.06% 75.78% -0.28%
+ Complexity 279 278 -1
================================================================
Files 35 35
Lines 1057 1057
Branches 129 129
================================================================
- Hits 804 801 -3
- Misses 194 195 +1
- Partials 59 61 +2 🚀 New features to boost your workflow:
|
26fab16 to
c4f9f5b
Compare
|
|
||
| // Dependencies used to configure the gradle plugins | ||
| implementation(embeddedKotlin("gradle-plugin")) | ||
| implementation(libs.kotlinPluginGradle) |
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.
Note: we must switch to the designated version of plugin gradle (2.1.21), otherwise the version embedded in AGP is always 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.
ideally we should just move away from buildSrc usage, because it leaks classpath
| compileOnly(libs.androidToolsPluginGradle) // for auto-wiring into Android projects | ||
| compileOnly(libs.kotlinPluginGradle) | ||
| compileOnly(libs.kotlinCompilerEmbeddable) | ||
| compileOnly(libs.kotlinPluginGradle) |
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.
There are few classes (only used for auto instrumentation, such as CommandLineProcessor) existing both in kotlinPluginGradle and kotlinCompilerEmbeddable, the compiler will resolve it by the order defined here. (And also weird enough, this conflict happens only with kotlin 2.1.x version, neither in 2.0.x nor 2.2.x)
In this case I need to reverse the order so that compiler take always the one from kotlinCompilerEmbeddable when there are some duplications. May be we need to consider something safer, but this is the easiest fix that I can find for now.
|
|
||
| // Dependencies used to configure the gradle plugins | ||
| implementation(embeddedKotlin("gradle-plugin")) | ||
| implementation(libs.kotlinPluginGradle) |
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.
ideally we should just move away from buildSrc usage, because it leaks classpath
Context
Prior to this PR, we use Kotlin 2.0.21 for the whole project, when compiling the
kotlin22source set, the compiler will throw the error saying:Then we have to add following argument to the compiler to let it pass:
What does this PR do?
To remove this, we need to upgrade Kotlin compiler version to 2.1.x.
Motivation
RUM-11262
Review checklist (to be filled by reviewers)