Is it possible to use the same code between multip...
# multiplatform
a
Is it possible to use the same code between multiple iOS targets? I don’t really want to redefine my
actual
stuff for every iOS target
d
You can share a sourceSet between the targets or share a source folder.
a
Yeah, that’s what I figured. Any examples? Do I just have to do it manually or is there a build in way?
a
Right, thanks! It would be nice if there was an alias for iOS that would add all targets
l
In this module, I do it to share code between macOS and all iOS targets (3 CPU architectures): https://github.com/LouisCAD/Splitties/tree/aa28eaaa6da877f09f8565ec6c6f4d3825b2d291/modules/preferences All the "magic" that allows this to work well in the IDE is here: https://github.com/LouisCAD/Splitties/blob/aa28eaaa6da877f09f8565ec6c6f4d3825b2d291/buildSrc/src/main/kotlin/config/KotlinSourceSetsConfig.kt#L40 And here's the (Kotlin) script that creates the proper symlinks and directory structure for each target I want to add: https://github.com/LouisCAD/Splitties/blob/aa28eaaa6da877f09f8565ec6c6f4d3825b2d291/scripts/Add-Kotlin-Targets.kts