Skip to content

update: 2.2.0 changes #431

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

Merged
merged 6 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 deletions topics/development/multiplatform-compatibility-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ When configuring your project, check the compatibility of a particular version o

| Kotlin Multiplatform plugin version | Gradle | Android Gradle plugin | Xcode |
|-------------------------------------|---------------------------------------|-----------------------------------------------------|---------|
| 2.1.21 | %minGradleVersion%–%maxGradleVersion% | %minAndroidGradleVersion%–%maxAndroidGradleVersion% | %xcode% |
| 2.2.0 | %minGradleVersion%–%maxGradleVersion% | %minAndroidGradleVersion%–%maxAndroidGradleVersion% | %xcode% |
| 2.1.21 | 7.6.3–8.12.1 | 7.3.1–8.7.2 | 16.3 |
| 2.1.20 | 7.6.3–8.11 | 7.4.2–8.7.2 | 16.0 |
| 2.1.0–2.1.10 | 7.6.3-8.10* | 7.4.2–8.7.2 | 16.0 |
| 2.0.21 | 7.5-8.8* | 7.4.2–8.5 | 16.0 |
Expand All @@ -39,6 +40,29 @@ When configuring your project, check the compatibility of a particular version o

This section covers incompatible changes that end their deprecation cycle and come into effect in Kotlin 2.0.0−%kotlinVersion%.

### Deprecated disambiguation classifier properties

**What's changed?**

Options that were used to control how the Kotlin Gradle plugin disambiguates source set names and IDE imports
become obsolete. Therefore, the following properties are now deprecated in the `KotlinTarget` interface:

* `useDisambiguationClassifierAsSourceSetNamePrefix`
* `overrideDisambiguationClassifierOnIdeImport`

**What's the best practice now?**

The Kotlin Gradle plugin now handles disambiguation of source set names automatically.
You can remove these properties from your build files.

**When do the changes take effect?**

Here's the planned deprecation cycle:

* 2.0.0: report a warning when the Gradle properties are used
* 2.1.0: raise this warning to an error
* 2.2.0: remove Gradle properties

<anchor name="java-source-set-created-by-default"/>
### Java source sets created by default

Expand Down Expand Up @@ -310,25 +334,32 @@ The following properties are now deprecated:
* `kotlin.mpp.enableGranularSourceSetsMetadata`
* `kotlin.native.enableDependencyPropagation`

The following compiler options are removed:

* `isCompatibilityMetadataVariantEnabled`
* `withGranularMetadata`
* `isKotlinGranularMetadataEnabled`

**What's the best practice now?**

* Remove these properties from your `gradle.properties` and `local.properties` files.
* Avoid setting them programmatically in the Gradle build scripts or your Gradle plugins.
* In case deprecated properties are set by some third-party Gradle plugin used in your build, ask the plugin maintainers
not to set these properties.

As the default behavior of the Kotlin toolchain doesn't include such properties since 1.6.20, we don't expect
any serious impact from removing them. Most possible consequences will be visible immediately after the project rebuild.
As the default behavior of the Kotlin toolchain doesn't include such properties since Kotlin 1.6.20, we don't expect
any serious impact. Most possible consequences will be visible immediately after the project rebuilds.

If you're a library author and want to be extra safe, check that consumers can work with your library.

**When do the changes take effect?**

Here's the planned deprecation cycle:

* 1.8.20: report a warning when these properties are used
* 1.8.20: report a warning when Gradle properties are used
* 1.9.20: raise this warning to an error
* 2.0: remove these properties; the Kotlin Gradle plugin ignores their usages
* 2.0: remove Gradle properties; the Kotlin Gradle plugin ignores their usages
* 2.2.0: remove compiler options from the Kotlin Gradle plugin

In the unlikely case you face some problems after removing these properties, create an [issue in YouTrack](https://kotl.in/issue).

Expand Down Expand Up @@ -388,7 +419,7 @@ Here's the planned deprecation cycle:

* 1.9.20: report a warning on any usages of the presets-related API
* 2.0: raise this warning to an error
* &gt;2.0: remove the presets-related API from the public API of the Kotlin Gradle plugin; sources that still use it fail
* 2.2.0: remove the presets-related API from the public API of the Kotlin Gradle plugin; sources that still use it fail
with "unresolved reference" errors, and binaries (for example, Gradle plugins) might fail with linkage errors
unless recompiled against the latest versions of the Kotlin Gradle plugin

Expand Down Expand Up @@ -527,7 +558,7 @@ Here's the planned deprecation cycle:

* 1.9.0: introduce a deprecation warning when `KotlinComplation.source` is used
* 1.9.20: raise this warning to an error
* &gt;1.9.20: remove `KotlinComplation.source` from the Kotlin Gradle plugin, attempts to use it lead to "unresolved
* 2.2.0: remove `KotlinComplation.source` from the Kotlin Gradle plugin, attempts to use it lead to "unresolved
reference" errors during the buildscript compilation

<anchor name="kotlin-js-plugin-deprecation"/>
Expand Down
5 changes: 2 additions & 3 deletions topics/tools/multiplatform-dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,12 @@ For more cinterop properties, see [Definition file](https://kotlinlang.org/docs/

### Android targets

The Kotlin Multiplatform plugin contains two specific functions for android targets.
Two functions help you configure [build variants](https://developer.android.com/studio/build/build-variants):
The Kotlin Multiplatform plugin has a specific function that helps you configure [build variants](https://developer.android.com/studio/build/build-variants)
for the Android target:

| **Name** | **Description** |
|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `publishLibraryVariants()` | Specifies build variants to publish. Learn more about [publishing Android libraries](multiplatform-publish-lib-setup.md#publish-an-android-library). |
| `publishAllLibraryVariants()` | Publishes all build variants. |

```kotlin
kotlin {
Expand Down
10 changes: 5 additions & 5 deletions v.list
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

<vars>
<!-- Kotlin -->
<var name="kotlinVersion" value="2.1.21" type="string"/>
<var name="languageVersion" value="2.1" type="string"/>
<var name="apiVersion" value="2.1" type="string"/>
<var name="kotlinVersion" value="2.2.0" type="string"/>
<var name="languageVersion" value="2.2" type="string"/>
<var name="apiVersion" value="2.2" type="string"/>

<!-- Compose -->
<var name="composeVersion" value="1.8.1" type="string"/>
Expand All @@ -22,10 +22,10 @@

<!-- KGP, AGP, Xcode -->
<var name="minGradleVersion" value="7.6.3" type="string"/>
<var name="maxGradleVersion" value="8.12.1" type="string"/>
<var name="maxGradleVersion" value="8.14" type="string"/>

<var name="minAndroidGradleVersion" value="7.3.1" type="string"/>
<var name="maxAndroidGradleVersion" value="8.7.2" type="string"/>
<var name="maxAndroidGradleVersion" value="8.9.2" type="string"/>

<var name="xcode" value="16.3" type="string"/>

Expand Down