You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/labels.list
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
<primary-labelid="alpha"name="Alpha"short-name="α"href="components-stability.html#stability-levels-explained"color="strawberry">The feature is in Alpha. It may change incompatibly and require manual migration in the future.</primary-label>
9
9
<primary-labelid="beta"name="Beta"short-name="β"href="components-stability.html#stability-levels-explained"color="tangerine">The feature is in Beta. It is almost stable, but migration steps may be required in the future. We'll do our best to minimize any changes you have to make.</primary-label>
<p><a href="https://github.com/JetBrains/kotlin/releases/tag/v2.1.20-RC" target="_blank">Release on GitHub</a></p>
49
49
</td>
50
50
<td>
51
51
<p>A tooling release with K2 kapt enabled by default.</p>
52
-
<p>For more details, please refer to the <a href="https://github.com/JetBrains/kotlin/releases/tag/v2.1.20-Beta2">changelog</a> or <a href="whatsnew-eap.md">What's new in Kotlin 2.1.20-Beta2</a>.</p>
52
+
<p>For more details, please refer to the <a href="https://github.com/JetBrains/kotlin/releases/tag/v2.1.20-RC">changelog</a> or <a href="whatsnew-eap.md">What's new in Kotlin 2.1.20-RC</a>.</p>
To align Kotlin Multiplatform with upcoming changes in Gradle, we are phasing out the `withJava()` function. The `withJava()`
47
+
function enabled integration with Gradle's Java plugins by creating the necessary Java source sets. From Kotlin %kotlinEapVersion%,
48
+
these Java source sets are created by default.
49
+
50
+
**What's the best practice now?**
51
+
52
+
Previously, you had to explicitly use the `withJava()` function to create `src/jvmMain/java` and `src/jvmTest/java` source sets:
53
+
54
+
```kotlin
55
+
kotlin {
56
+
jvm {
57
+
withJava()
58
+
}
59
+
}
60
+
```
61
+
62
+
From Kotlin %kotlinEapVersion%, you can remove the `withJava()` function from your build script.
63
+
64
+
In addition, Gradle now only runs Java compile tasks if Java sources are present, triggering a JVM validation
65
+
diagnostic that previously didn't run before. This diagnostic fails if you explicitly configure an incompatible JVM target
66
+
for `KotlinJvmCompile` tasks or inside `compilerOptions`. For guidance on ensuring JVM target compatibility, see
67
+
[Check for JVM target compatibility of related compile tasks](gradle-configure-project.md#check-for-jvm-target-compatibility-of-related-compile-tasks).
68
+
69
+
If your project uses Gradle versions higher than 8.7 and doesn't rely on Gradle Java plugins, like [Java](https://docs.gradle.org/current/userguide/java_plugin.html),
70
+
[Java Library](https://docs.gradle.org/current/userguide/java_library_plugin.html), or [Application](https://docs.gradle.org/current/userguide/application_plugin.html),
71
+
or a third party Gradle plugin that has a dependency on a Gradle Java plugin, you can remove the `withJava()` function.
72
+
73
+
If your project uses the [Application](https://docs.gradle.org/current/userguide/application_plugin.html) Gradle Java plugin,
74
+
we recommend migrating to the [new Experimental DSL](whatsnew-eap.md#kotlin-multiplatform-new-dsl-to-replace-gradle-s-application-plugin).
75
+
Starting with Gradle 8.7, the Application plugin will no longer work with the Kotlin Multiplatform Gradle plugin.
76
+
77
+
If you want to use both the Kotlin Multiplatform Gradle plugin and other Gradle plugins for
78
+
Java in your multiplatform project, see [Deprecated compatibility with Kotlin Multiplatform Gradle plugin and Java plugins](multiplatform-compatibility-guide.md#deprecated-compatibility-with-kotlin-multiplatform-gradle-plugin-and-gradle-java-plugins).
79
+
80
+
If you run into any issues, report them in our [issue tracker](https://kotl.in/issue) or ask for help in our [public Slack channel](https://kotlinlang.slack.com/archives/C19FD9681).
81
+
82
+
**When do the changes take effect?**
83
+
84
+
Here's the planned deprecation cycle:
85
+
86
+
* Gradle >8.6: introduce a deprecation warning for any previous version of Kotlin in multiplatform projects using the `withJava()` function.
87
+
* Gradle 9.0: raise this warning to an error.
88
+
* %kotlinEapVersion%: introduce a deprecation warning when using the `withJava()` function with any version of Gradle.
89
+
40
90
<anchorname="android-target-rename"/>
41
91
### Rename of `android` target to `androidTarget`
42
92
@@ -633,7 +683,7 @@ Here's the planned deprecation cycle:
633
683
634
684
*1.3.40: introduce a warning when `targetPresets.jvmWithJava` is used
635
685
*1.9.20: raise this warning to an error
636
-
*>1.9.20: remove `targetPresets.jvmWithJava` API; attempts to use it lead to the buildscript compilation failure
686
+
*>1.9.20: remove `targetPresets.jvmWithJava` API; attempts to use it lead to the buildscript compilation failure
637
687
638
688
>Even though the whole `targetPresets` APIis deprecated, the `jvmWithJava` preset has a different deprecation timeline.
639
689
>
@@ -764,6 +814,7 @@ declarations. Also, it's now only possible to import forward declarations by usi
764
814
765
815
This section covers incompatible changes that end their deprecation cycle and come into effect inKotlin1.7.0−1.8.22.
0 commit comments