Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin requested a review from a team as a code owner January 3, 2025 19:00
@@ -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).
Copy link
Contributor Author

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.
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant