Multiplatform support
nbransby opened this issue · 4 comments
Does this library only work on the jvm or is it implemented in pure Kotlin?
It's implemented in pure Kotlin. However I'm not sure what would be needed in order for it to work with JS / Native. The only JVM dependency is opentest4j. I'd be perfectly happy with making that optional if it would help multiplatform compatibility.
There's an open issue #100 for JS support. It's not a super-high priority for me personally as I'm using Strikt purely for JVM work and have never done anything with Kotlin JS or Native. I'm very open to any discussion on Slack / here or pull requests.
Just had a quick flick through the code and can see lots of import java....
statements so it would not be straightforward to turn this into multiplatform project
There are 4 files that import from something other than kotlin.*
or other parts of Strikt:
Any.kt
usesjava.beans.Introspector
to implementpropertiesAreEqualTo
.FilePeek.kt
usesjava.io.File
to read source code files.ResultWriter.kt
usesjava.io.StringWriter
to append error messages to a string.TemporalAccessor.kt
imports a bunch of classes fromjava.time
and provides extension functions for assertions on them.
The first and last could be moved out of core to a strikt-jvm
module, the second is an optional, non-core behavior. The third could be implemented differently.
That's only counting production files, not tests.
Closing as sub-task of #100