From 75730f7036034bd26e3b7650cbbda1b37b2d8723 Mon Sep 17 00:00:00 2001 From: "Danil.Pavlov" Date: Wed, 4 Jun 2025 20:14:46 +0200 Subject: [PATCH 1/6] update: 2.2.0 changes --- .../multiplatform-compatibility-guide.md | 45 ++++++++++++++++--- topics/tools/multiplatform-dsl-reference.md | 5 +-- v.list | 10 ++--- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/topics/development/multiplatform-compatibility-guide.md b/topics/development/multiplatform-compatibility-guide.md index 53a28089..63b74a27 100644 --- a/topics/development/multiplatform-compatibility-guide.md +++ b/topics/development/multiplatform-compatibility-guide.md @@ -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 | @@ -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 + ### Java source sets created by default @@ -310,6 +334,12 @@ 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. @@ -317,8 +347,8 @@ The following properties are now deprecated: * 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. @@ -326,9 +356,10 @@ If you're a library author and want to be extra safe, check that consumers can w 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). @@ -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 -* >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 @@ -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 -* >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 diff --git a/topics/tools/multiplatform-dsl-reference.md b/topics/tools/multiplatform-dsl-reference.md index 1c87b9ba..e5874261 100644 --- a/topics/tools/multiplatform-dsl-reference.md +++ b/topics/tools/multiplatform-dsl-reference.md @@ -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 { diff --git a/v.list b/v.list index d29e4df4..e6cead08 100644 --- a/v.list +++ b/v.list @@ -4,9 +4,9 @@ - - - + + + @@ -22,10 +22,10 @@ - + - + From 278b7cc96e66eb6e065e24b81c2b254ad958d9a0 Mon Sep 17 00:00:00 2001 From: "Danil.Pavlov" Date: Wed, 11 Jun 2025 17:59:39 +0200 Subject: [PATCH 2/6] feat: bitcode embedding --- .../multiplatform-build-native-binaries.md | 12 +++---- .../multiplatform-compatibility-guide.md | 34 +++++++------------ v.list | 2 +- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/topics/development/multiplatform-build-native-binaries.md b/topics/development/multiplatform-build-native-binaries.md index ae78a1dc..ce50ab66 100644 --- a/topics/development/multiplatform-build-native-binaries.md +++ b/topics/development/multiplatform-build-native-binaries.md @@ -349,15 +349,15 @@ kotlin { val watchos64 = watchosArm64("watchos64") configure(listOf(watchos32, watchos64)) { binaries.framework { - baseName = "my_framework" + baseName = "MyFramework" } } // Create a task to build a fat framework. tasks.register("debugFatFramework") { // The fat framework must have the same base name as the initial frameworks. - baseName = "my_framework" + baseName = "MyFramework" // The default destination directory is "/fat-framework". - destinationDir = buildDir.resolve("fat-framework/debug") + destinationDirProperty.set(layout.buildDirectory.dir("fat-framework/debug")) // Specify the frameworks to be merged. from( watchos32.binaries.getFramework("DEBUG"), @@ -380,16 +380,16 @@ kotlin { watchosArm64("watchos64") configure([watchos32, watchos64]) { binaries.framework { - baseName = "my_framework" + baseName = "MyFramework" } } } // Create a task building a fat framework. tasks.register("debugFatFramework", FatFrameworkTask) { // The fat framework must have the same base name as the initial frameworks. - baseName = "my_framework" + baseName = "MyFramework" // The default destination directory is "/fat-framework". - destinationDir = file("$buildDir/fat-framework/debug") + destinationDirProperty.set(layout.buildDirectory.dir("fat-framework/debug")) // Specify the frameworks to be merged. from( targets.watchos32.binaries.getFramework("DEBUG"), diff --git a/topics/development/multiplatform-compatibility-guide.md b/topics/development/multiplatform-compatibility-guide.md index 63b74a27..5b06ad89 100644 --- a/topics/development/multiplatform-compatibility-guide.md +++ b/topics/development/multiplatform-compatibility-guide.md @@ -40,28 +40,25 @@ 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 +### Deprecated bitcode embedding **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` +Bitcode embedding was deprecated in Xcode 14 and removed in Xcode 15 for all Apple targets. In turn, the `embedBitcode` +parameter for the framework configuration, as well as the `-Xembed-bitcode` and `-Xembed-bitcode-marker` command line +arguments are deprecated in Kotlin. **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. +If you still use earlier versions of Xcode but want to upgrade to Kotlin 2.0.20 or later, +disable bitcode embedding in your Xcode projects. **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 +* 2.0.20: the Kotlin/Native compiler no longer supports bitcode embedding +* 2.2.0: the `embedBitcode` DSL is removed from the Kotlin Multiplatform Gradle plugin ### Java source sets created by default @@ -307,8 +304,8 @@ The Kotlin team is eager to help the ecosystem migrate, so if you face any issue Here's the planned deprecation cycle: * 1.9: introduce a deprecation warning for dependencies on legacy libraries -* 2.0: raise the warning for dependencies on legacy libraries to an error -* >2.0: remove support for dependencies on legacy libraries; using such dependencies can cause build failures +* 2.0.0: raise the warning for dependencies on legacy libraries to an error +* >2.0.0: remove support for dependencies on legacy libraries; using such dependencies can cause build failures ### Deprecated Gradle properties for hierarchical structure support @@ -334,12 +331,6 @@ 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. @@ -358,8 +349,7 @@ Here's the planned deprecation cycle: * 1.8.20: report a warning when Gradle properties are used * 1.9.20: raise this warning to an error -* 2.0: remove Gradle properties; the Kotlin Gradle plugin ignores their usages -* 2.2.0: remove compiler options from the Kotlin Gradle plugin +* 2.0.0: remove Gradle properties; the Kotlin Gradle plugin ignores their usages In the unlikely case you face some problems after removing these properties, create an [issue in YouTrack](https://kotl.in/issue). @@ -418,7 +408,7 @@ kotlin { 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 +* 2.0.0: raise this warning to an error * 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 diff --git a/v.list b/v.list index e6cead08..f4562bd9 100644 --- a/v.list +++ b/v.list @@ -25,7 +25,7 @@ - + From 5534bf0596e7e71332111ed1357296d906f70a43 Mon Sep 17 00:00:00 2001 From: "Danil.Pavlov" Date: Mon, 16 Jun 2025 18:21:40 +0200 Subject: [PATCH 3/6] fix: deprecation cycle --- topics/development/multiplatform-compatibility-guide.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/topics/development/multiplatform-compatibility-guide.md b/topics/development/multiplatform-compatibility-guide.md index 5b06ad89..362edd92 100644 --- a/topics/development/multiplatform-compatibility-guide.md +++ b/topics/development/multiplatform-compatibility-guide.md @@ -58,7 +58,8 @@ disable bitcode embedding in your Xcode projects. Here's the planned deprecation cycle: * 2.0.20: the Kotlin/Native compiler no longer supports bitcode embedding -* 2.2.0: the `embedBitcode` DSL is removed from the Kotlin Multiplatform Gradle plugin +* 2.2.0: the `embedBitcode` DSL is deprecated in the Kotlin Multiplatform Gradle plugin +* 2.3.0: the `embedBitcode` DSL is removed ### Java source sets created by default @@ -709,7 +710,7 @@ Here's the planned deprecation cycle: * 1.3.40: introduce a warning when `targetPresets.jvmWithJava` is used * 1.9.20: raise this warning to an error -* >1.9.20: remove `targetPresets.jvmWithJava` API; attempts to use it lead to the buildscript compilation failure +* >1.9.20: remove `targetPresets.jvmWithJava` API; attempts to use it lead to the buildscript compilation failure > Even though the whole `targetPresets` API is deprecated, the `jvmWithJava` preset has a different deprecation timeline. > From e1a8f0b8522976dbdf8186a79019b72a9d632a72 Mon Sep 17 00:00:00 2001 From: "Danil.Pavlov" Date: Tue, 17 Jun 2025 13:54:59 +0200 Subject: [PATCH 4/6] chore: versions --- topics/development/multiplatform-compatibility-guide.md | 5 ++--- v.list | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/topics/development/multiplatform-compatibility-guide.md b/topics/development/multiplatform-compatibility-guide.md index 362edd92..4f63b554 100644 --- a/topics/development/multiplatform-compatibility-guide.md +++ b/topics/development/multiplatform-compatibility-guide.md @@ -364,8 +364,8 @@ Each target preset essentially represented a factory for Kotlin Multiplatform ta redundant, as DSL functions like `jvm()` or `iosSimulatorArm64()` cover the same use cases while being much more straightforward and concise. -To reduce the confusion and provide clearer guidelines, all presets-related APIs are now deprecated and will be -removed from the public API of the Kotlin Gradle plugin in future releases. This includes: +To reduce the confusion and provide clearer guidelines, all presets-related APIs are now deprecated in the public API of +the Kotlin Gradle plugin. This includes: * The `presets` property in `org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension` * The `org.jetbrains.kotlin.gradle.plugin.KotlinTargetPreset` interface and all its inheritors @@ -853,7 +853,6 @@ and [Application](https://docs.gradle.org/current/userguide/application_plugin.h there is now a deprecation warning when you apply these plugins to the same project. The warning also appears when another Gradle plugin in your multiplatform project applies a Gradle Java plugin. For example, the [Spring Boot Gradle Plugin](https://docs.spring.io/spring-boot/gradle-plugin/index.html) automatically applies the Application plugin. -In future Kotlin releases, the warning will be increased to an error. We've added this deprecation warning due to fundamental compatibility issues between Kotlin Multiplatform's project model and Gradle's Java ecosystem plugins. Gradle's Java ecosystem plugins currently don't take into account that other plugins may: diff --git a/v.list b/v.list index f4562bd9..00c63cf6 100644 --- a/v.list +++ b/v.list @@ -32,8 +32,8 @@ - - + + From c02358424bda201a1c8888c11c5a3ac58bd35a93 Mon Sep 17 00:00:00 2001 From: Danil Pavlov Date: Wed, 18 Jun 2025 18:00:14 +0200 Subject: [PATCH 5/6] fix: review suggestions --- topics/development/multiplatform-compatibility-guide.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/topics/development/multiplatform-compatibility-guide.md b/topics/development/multiplatform-compatibility-guide.md index 4f63b554..08759178 100644 --- a/topics/development/multiplatform-compatibility-guide.md +++ b/topics/development/multiplatform-compatibility-guide.md @@ -58,7 +58,8 @@ disable bitcode embedding in your Xcode projects. Here's the planned deprecation cycle: * 2.0.20: the Kotlin/Native compiler no longer supports bitcode embedding -* 2.2.0: the `embedBitcode` DSL is deprecated in the Kotlin Multiplatform Gradle plugin +* 2.1.0: the `embedBitcode` DSL is deprecated in the Kotlin Multiplatform Gradle plugin with a warning +* 2.2.0: the warning is raised to an error * 2.3.0: the `embedBitcode` DSL is removed @@ -304,7 +305,7 @@ The Kotlin team is eager to help the ecosystem migrate, so if you face any issue Here's the planned deprecation cycle: -* 1.9: introduce a deprecation warning for dependencies on legacy libraries +* 1.9.0: introduce a deprecation warning for dependencies on legacy libraries * 2.0.0: raise the warning for dependencies on legacy libraries to an error * >2.0.0: remove support for dependencies on legacy libraries; using such dependencies can cause build failures From 98dd630186a1d57eff3010a3ad94ae0cba40fac4 Mon Sep 17 00:00:00 2001 From: Danil Pavlov Date: Fri, 20 Jun 2025 13:19:51 +0200 Subject: [PATCH 6/6] fix: review suggestions Co-authored-by: Aleksey Zamulla --- topics/development/multiplatform-compatibility-guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/topics/development/multiplatform-compatibility-guide.md b/topics/development/multiplatform-compatibility-guide.md index 08759178..dbcceb5f 100644 --- a/topics/development/multiplatform-compatibility-guide.md +++ b/topics/development/multiplatform-compatibility-guide.md @@ -341,7 +341,7 @@ The following properties are now deprecated: not to set these properties. 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. +any serious impact. Most consequences will be visible immediately after a project is rebuilt. If you're a library author and want to be extra safe, check that consumers can work with your library. @@ -349,9 +349,9 @@ If you're a library author and want to be extra safe, check that consumers can w Here's the planned deprecation cycle: -* 1.8.20: report a warning when Gradle properties are used +* 1.8.20: report a warning when the deprecated Gradle properties are used * 1.9.20: raise this warning to an error -* 2.0.0: remove Gradle properties; the Kotlin Gradle plugin ignores their usages +* 2.0.0: remove the deprecated properties; the Kotlin Gradle plugin ignores their usages In the unlikely case you face some problems after removing these properties, create an [issue in YouTrack](https://kotl.in/issue).