https://kotlinlang.org logo
#touchlab-tools
Title
# touchlab-tools
j

Jon Bailey

11/13/2023, 6:33 PM
Hello, for SKIE is the ability to have custom Swift files compiled into the framework in a
swift
directory alongside the
kotlin
directory in a source set documented anywhere? (if not is there a chance that feature will be removed)
f

Filip Dolník

11/13/2023, 6:47 PM
Hi! The feature is not documented and that’s because it’s not fully supported yet - it’s basically a remnant of our old prototype. We do have a plan to add official support in the (maybe near) future, but right now the feature is not fully ready and more importantly: it’s not actively tested. So while we don’t plan to remove it intentionally, it’s possible that it will get broken. One part of the support that will likely not get broken is the fact that SKIE takes all swift files from the
build/skie/....../swift
directory (because that’s where SKIE generates its files) - so you could always write your own task that puts your swift files in that directory. So, if the feature works enough for your use case as of 0.5.5, then it’s likely you will be able to use it in it’s current state until we introduce a proper support.
j

Jon Bailey

11/13/2023, 6:51 PM
Cool thanks 🙂 I'll move to putting the Swift code in
build/skie/....../swift
then.
f

Filip Dolník

11/13/2023, 6:52 PM
just make sure you automatically copy the files from some permanent directory there because the build directory is only temporary
but if the way the src/swift directory works right now is good enough for your use case then I’d recommend using that and you can fallback to copying the files yourself if needed
j

Jon Bailey

11/13/2023, 7:00 PM
Currently I'm copying the files from the output of KSP into the src/swift directory. I saw the
build/skie/....../swift
first but didn't copy them there because I was lazy on how to figure
.....
bit based on the architecture etc.
f

Filip Dolník

11/13/2023, 7:02 PM
yeah, if you want to put time into it, then look at SKIE Gradle plugin code where this logic is handled. But as I said, if it works in 0.5.5 use the src/swift and if stops working, you can use the other method
j

Jon Bailey

11/13/2023, 7:12 PM
Yep I'll leave it then for now, thanks for your help!