Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplatform support #113

Closed
nbransby opened this issue Sep 24, 2018 · 4 comments
Closed

Multiplatform support #113

nbransby opened this issue Sep 24, 2018 · 4 comments
Labels
🤔 question Further information is requested

Comments

@nbransby
Copy link

Does this library only work on the jvm or is it implemented in pure Kotlin?

@robfletcher
Copy link
Owner

robfletcher commented Sep 24, 2018

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.

@robfletcher robfletcher added the 🤔 question Further information is requested label Sep 24, 2018
@nbransby
Copy link
Author

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

@robfletcher
Copy link
Owner

robfletcher commented Sep 25, 2018

There are 4 files that import from something other than kotlin.* or other parts of Strikt:

  • Any.kt uses java.beans.Introspector to implement propertiesAreEqualTo.
  • FilePeek.kt uses java.io.File to read source code files.
  • ResultWriter.kt uses java.io.StringWriter to append error messages to a string.
  • TemporalAccessor.kt imports a bunch of classes from java.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.

@robfletcher
Copy link
Owner

Closing as sub-task of #100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants