All the samples in the <Hierarchical Project Struc...
# multiplatform
m
All the samples in the Hierarchical Project Structure doc show nice tree-like sourceSet dependencies but can I make my sourceSet graph a bit more involved and have 2 parents for the same sourceSet?
o
yes, it’s possible 🙂 at least at my side (https://github.com/whyoleg/ffi-kotlin/blob/compiler-plugin/build-logic/src/main/kotlin/buildx-multiplatform.gradle.kts#L17) I have a hierarchy (via new
targetHierarchy
API) where native targets has 2 parents:
native
and
platformInt/platformLong
(both of them then depend on
common
). Plus other targets (js, jvm, wasm) has similar with
nonNative
and
platformInt/platformLong
There were some problems with such hierarchies before 1.8.20, but now everything works fine at my side One more addition, I have enabled new flag there:
kotlin.mpp.import.enableKgpDependencyResolution=true
, not sure if it affects something here in scope of IDE support And thanks to this new
targetHierarchy
API, such things are super simple to do!
💙 1
Note: project is a little outdated now, but should work and uses kotlin 1.9.0-Beta
m
Ah nice! This is also what my early tests seem to be indicating 🙂 . This is really cool
👍 1