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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions topics/development/multiplatform-build-native-binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<FatFrameworkTask>("debugFatFramework") {
// The fat framework must have the same base name as the initial frameworks.
baseName = "my_framework"
baseName = "MyFramework"
// The default destination directory is "<build directory>/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"),
Expand All @@ -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 "<build directory>/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"),
Expand Down
52 changes: 37 additions & 15 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,28 @@ 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 bitcode embedding

**What's changed?**

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?**

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.20: the Kotlin/Native compiler no longer supports bitcode embedding
* 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

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

Expand Down Expand Up @@ -282,9 +305,9 @@ 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
* &gt;2.0: remove support for dependencies on legacy libraries; using such dependencies can cause build failures
* 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
* &gt;2.0.0: remove support for dependencies on legacy libraries; using such dependencies can cause build failures

<anchor name="deprecate-hmpp-properties"/>
### Deprecated Gradle properties for hierarchical structure support
Expand Down Expand Up @@ -317,18 +340,18 @@ 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.

**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.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).

Expand All @@ -342,8 +365,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
Expand Down Expand Up @@ -387,8 +410,8 @@ 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
* &gt;2.0: remove the presets-related API from the public API of the Kotlin Gradle plugin; sources that still use it fail
* 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

Expand Down Expand Up @@ -527,7 +550,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 Expand Up @@ -688,7 +711,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
* &gt;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.
>
Expand Down Expand Up @@ -831,7 +854,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:
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
14 changes: 7 additions & 7 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,18 +22,18 @@

<!-- 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.10.0" type="string"/>

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

<!-- Libraries and Frameworks -->
<var name="coroutinesVersion" value="1.10.2" type="string"/>
<var name="serializationVersion" value="1.8.1" type="string"/>
<var name="sqlDelightVersion" value="2.0.1" type="string"/>
<var name="ktorVersion" value="3.1.3" type="string"/>
<var name="sqlDelightVersion" value="2.1.0" type="string"/>
<var name="ktorVersion" value="3.2.0" type="string"/>
<var name="dateTimeVersion" value="0.6.2" type="string"/>
<var name="koinVersion" value="4.1" type="string"/>
<var name="skieVersion" value="0.10.2" type="string"/>
Expand Down