-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Update 2.1.0 internal compiler APIs doc #4631
base: master
Are you sure you want to change the base?
Conversation
@@ -1249,16 +1249,21 @@ You can use the `KotlinAndroidExtension` in exactly the same way. | |||
|
|||
### Compiler symbols hidden from the Kotlin Gradle plugin API | |||
|
|||
Starting with Kotlin 2.1.0, | |||
you will receive a warning if you access compiler module symbols bundled within the Kotlin Gradle plugin (KGP). |
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.
I think this was technically not exact, right? The warning is based on the presence of a class file that is not bundled in KGP but build logic could still use the symbols bundled with KGP without being detected?
|
||
To guard against those issues, KGP will now display a warning if `org.jetbrains.kotlin:kotlin-compiler-embeddable` is loaded in the build classpath alongside KGP. | ||
|
||
As a long term fix, if you are a plugin author using `org.jetbrains.kotlin:kotlin-compiler-embeddable` classes, we recommend doing so in an isolated classloader. |
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.
Changed from a requirement to a recommendation. If KGP removes any dependency on compiler APIs and/or the compiler APIs become stable, it might become acceptable to do the work in the main build classpath?
Also Gradle Workers API is a possible solution but it comes with tradeoffs so it's leaving the door open to other solutions.
Follow up from this slack thread: https://kotlinlang.slack.com/archives/C19FD9681/p1735830883666549