Hi, i want to migrate my kmp library from gradle t...
# kotlin-toolchain
r
Hi, i want to migrate my kmp library from gradle to kotlin-toolchain. I defining a custom SourceSet hierarchy with gradle, it's easy, how to do the same thing in kotlin-toolchain?
Copy code
kotlin {
    applyDefaultHierarchyTemplate {
        common {
            group("native") {
                withMingwX64()
                group("posix") {
                    withLinuxX64()
                    withLinuxArm64()
                    withApple()
                }
            }
        }
    }
}
It created a new sourceSet named posix, posix contains linux64, linuxArm64 & apple
👀 2
u
Hi! For
native
there is already a predefined group of platforms, and it's possible to add new groups of platforms via aliases. So, in your example the lib can be defined with the following `module.yaml`:
Copy code
product:
  type: kmp/lib
  platforms: [ mingwX64, iosArm64, iosSimulatorArm64, linuxX64, linuxArm64, macosArm64 ]

aliases:
  - posix: [ iosArm64, iosSimulatorArm64, linuxX64, linuxArm64, macosArm64 ]
This would allow using
@posix
qualifier in source folder names, settings, depedendencies, etc. It's a bit verbose at the moment, I have to agree, we would probably investigate possible solutions in the scope of KTC-5491.