https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
b

Big Chungus

12/27/2019, 2:36 PM
How do i share the same sourceSet between targets? i have common sourceSet with expect declarations and then another sourceSet with actual declarations which I want to compile to two different targets.
p

Prateek Grover

12/27/2019, 2:37 PM
this is how I did it.
Copy code
val ios32Main by getting {
    dependencies {
        implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.2-native-mt-1")
        implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.14.0")
    }
}

val ios32Test by getting {
    dependencies {

    }
}

val ios64Main by getting {
    dependsOn(ios32Main)
}

val ios64Test by getting {
    dependsOn(ios32Test)
}

val iosSimMain by getting {
    dependsOn(ios32Main)
}

val iosSimTest by getting {
    dependsOn(ios32Test)
}
d

Dominaezzz

12/27/2019, 7:22 PM
Your best bet would be to add the source folder to the defaultSourceSet of each target.