# Kotlin 1.9.20: Streamlining Source Sets in Multiplatform Project

DevFeed: [Kotlin 1.9.20: Streamlining Source Sets in Multiplatform Project](<https://devfeed.tech/articles/kotlin-1-9-20-streamlining-source-sets-in-multiplatform-project-24717.md>)

Original publisher: [Read original article](<https://dev.to/touchlab/kotlin-1920-streamlining-source-sets-in-multiplatform-project-27ak>)

Author: Jigar Brahmbhatt

Published: 2024-03-26T13:57:17Z

Content type: release

Language: en

Sources: [Touchlab](<https://devfeed.tech/sources/touchlab.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Boilerplate](<https://devfeed.tech/topics/boilerplate.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [coding](<https://devfeed.tech/tags/coding.md>), [community](<https://devfeed.tech/tags/community.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [development](<https://devfeed.tech/tags/development.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gradle-plugin](<https://devfeed.tech/tags/gradle-plugin.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlinmultiplatform](<https://devfeed.tech/tags/kotlinmultiplatform.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [readability](<https://devfeed.tech/tags/readability.md>), [software](<https://devfeed.tech/tags/software.md>)

## AI overview

Kotlin 1.9.20 makes Kotlin Multiplatform stable and introduces a default source set hierarchy template through the Kotlin Gradle Plugin. The update simplifies iOS target configuration, custom source sets, dependency setup, and IDE code completion while reducing boilerplate.

## Source excerpt

The release of Kotlin 1.9.20 marked a significant milestone for Kotlin Multiplatform enthusiasts, as this update moved Kotlin Multiplatform to Stable. Kotlin 1.9.20 introduces several notable features and enhancements. Among these updates, the new source set hierarchy template by the Kotlin Gradle Plugin stands out to me for its ability to simplify configuration complexities. It was launched as experimental in Kotlin 1.8.20 and has been made default in Kotlin 1.9.20. Simplified iOS Target Configuration In the common Kotlin Multiplatform project set-up, you would have seen specific source set setup for two or three iOS targets like for X64, Arm64. Instead of the common and confusing 'ios()' target, one must always declare specific targets like 'iosArm64()' as required. Once one of the iOS targets is declared, the default template would automatically create iosMain source set. So no more val iosMain by creating boilerplate required. Before 1.9.20 After 1.9.20 kotlin { ios() iosSimulatorArm64() sourceSets { val commonMain by getting val iosMain by creating { dependsOn(commonMain) } val iosX64Main by getting { dependsOn(iosMain) } val iosArm64Main by getting { dependsOn(iosMain) } val iosSimulatorArm64Main by getting { dependsOn(iosMain) } } } kotlin { iosX64() iosArm64() iosSimulatorArm64() // The iosMain source set is now created automatically // You can directly use the reference now iosMain.dependencies { implementation("...") } } If you've an old KMP project and still have reference of darwinMain, you can simply rename it to appleMain now as that encapsulates all other apple targets. Checkout the full hierarchy template! Streamlined Custom Source Sets Managing custom source sets in Kotlin Multiplatform projects is now more straightforward with Kotlin 1.9.20. The update simplifies the process of setting up dependencies between source sets, reducing the need for extensive boilerplate code and enhancing overall readability. For example, let's assume that you already h