Skip to content

Commit a766b4c

Browse files
update: update 2.1.0 internal compiler APIs doc (#4631)
* Update 2.1.0 internal compiler APIs doc * Cosmetics * Update whatsnew21.md * Update whatsnew21.md * update: update whatsnew21.md apply Kotlin documentation styleguide * chore: update whatsnew21.md delete unnecessary new lines --------- Co-authored-by: Andrey Polyakov <[email protected]>
1 parent f16e280 commit a766b4c

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

docs/topics/whatsnew21.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,16 +1249,20 @@ You can use the `KotlinAndroidExtension` in exactly the same way.
12491249

12501250
### Compiler symbols hidden from the Kotlin Gradle plugin API
12511251

1252-
Starting with Kotlin 2.1.0,
1253-
you will receive a warning if you access compiler module symbols bundled within the Kotlin Gradle plugin (KGP).
1254-
Previously, the KGP included `org.jetbrains.kotlin:kotlin-compiler-embeddable` in its runtime dependencies,
1255-
making internal compiler symbols, such as `KotlinCompilerVersion`, available in the build script classpath.
1252+
Previously, KGP included `org.jetbrains.kotlin:kotlin-compiler-embeddable` in its runtime dependencies,
1253+
making internal compiler symbols available in the build script classpath.
1254+
These symbols were intended for internal use only.
12561255

1257-
These symbols are intended for internal use only.
1258-
Access to them will be removed in upcoming Kotlin releases to prevent compatibility issues and simplify KGP maintenance.
1259-
If your build logic relies on any compiler symbols,
1260-
you need to update it and use the [Gradle Workers API](https://docs.gradle.org/current/userguide/worker_api.html)
1261-
with classloader or process isolation to ensure safe interaction with the compiler.
1256+
Starting with Kotlin 2.1.0, KGP bundles a subset of `org.jetbrains.kotlin:kotlin-compiler-embeddable` class files in its JAR file and progressively removes them.
1257+
This change aims to prevent compatibility issues and simplify KGP maintenance.
1258+
1259+
If other parts of your build logic, such as plugins like `kotlinter`, depend on a different version of `org.jetbrains.kotlin:kotlin-compiler-embeddable`
1260+
than the one bundled with KGP, it can lead to conflicts and runtime exceptions.
1261+
1262+
To prevent such issues, KGP now shows a warning if `org.jetbrains.kotlin:kotlin-compiler-embeddable` is present in the build classpath alongside KGP.
1263+
1264+
As a long-term solution, if you're a plugin author using `org.jetbrains.kotlin:kotlin-compiler-embeddable` classes, we recommend running them in an isolated classloader.
1265+
For example, you can achieve it using the [Gradle Workers API](https://docs.gradle.org/current/userguide/worker_api.html) with classloader or process isolation.
12621266

12631267
#### Using the Gradle Workers API
12641268

@@ -1597,4 +1601,4 @@ Starting from IntelliJ IDEA 2023.3 and Android Studio Iguana (2023.2.1) Canary 1
15971601
bundled plugin included in your IDE. This means that you can't install the plugin from JetBrains Marketplace anymore.
15981602

15991603
To update to the new Kotlin version, [change the Kotlin version](releases.md#update-to-a-new-kotlin-version)
1600-
to 2.1.0 in your build scripts.
1604+
to 2.1.0 in your build scripts.

0 commit comments

Comments
 (0)