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

Kris Wong

12/31/2019, 4:09 PM
is there any way to specify that one source set depends on another (i.e., iosArm64Main depends on iosMain), but add a dependency to iosMain that is not included in iosArm64Main?
d

Dominaezzz

12/31/2019, 4:23 PM
Why would you want to do this?
k

Kris Wong

12/31/2019, 4:28 PM
a library I am using makes things difficult because you have to specify each iOS target dependency individually, instead of one common iOS dependency
d

Dominaezzz

12/31/2019, 4:30 PM
Ah, so you want to apply all of them in the
iosMain
and have the specific sourceSets pick the appropriate ones.
k

Kris Wong

12/31/2019, 4:31 PM
iosMain needs iOS X64 artifact, and iosArm64Main needs the Arm64 artifact
as to how I accomplish that, i'm indifferent 🙂
d

Dominaezzz

12/31/2019, 4:32 PM
Oh.
iosMain
is a platform specific source set?
k

Kris Wong

12/31/2019, 4:32 PM
yes - X64
otherwise IDEA is completely broken when editing files in that source set
d

Dominaezzz

12/31/2019, 4:33 PM
You can probably achieve what you want with a for loop in gradle and some name mangling.
What's do the dependency names look like?
k

Kris Wong

12/31/2019, 4:35 PM
Copy code
suparnatural-kotlin-multiplatform:fs-iosarm64:1.0.8
d

Dominaezzz

12/31/2019, 4:36 PM
You can apply the dependency directly to the
compilation
as supposed to the sourceSet.
Copy code
compilations {
    "main" {
        dependencies {
            // Deps here shouldn't infect the sourceSet.
            implementation("suparnatural-kotlin-multiplatform:fs-iosarm64:1.0.8")
        }
    }
}
k

Kris Wong

12/31/2019, 4:45 PM
oh that's interesting
w00t! that worked. cheers!
👍🏼 1
I understand JB is working on this issue so hopefully this workaround won't be necessary for too much longer