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

faogustavo

09/29/2020, 6:57 PM
1. How does the sourceSets understand and resolve the “parent” dependency? Is it some naming convention from gradle?
I know that I can add a “dependsOn” to make the this dependency clear, but in my configuration I don’t have it and it’s “working”. Example:
Copy code
val commonMain by getting {
    dependencies {
        implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
    }
}
val commonTest by getting {
    dependencies {
        implementation(kotlin("test-common"))
        implementation(kotlin("test-annotations-common"))
    }
}
r

russhwolf

09/29/2020, 9:18 PM
When you declare your targets, they implicitly set a dependency on common. But if you create a custom sourceset (
val customMain by creating { ... }
) then you'd need to add the dependency on common manually. See docs here https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html#configure-the-hierarchical-structure-manually
f

faogustavo

09/29/2020, 9:22 PM
Nice! Thanks man 🙂
4 Views