Successful use of swift-java in "production"

Just finished deploying a Hummingbird based website for processing XLS files (output of a hardware device, can't upgrade it to return more modern formats). Since I could not find any Swift package to handle XLS files natively, I had to resort to an initial implementation in Python. While this worked, I was a bit annoyed I could not do this in Swift which is my preferred language for building stuff.

After watching this year's WWDC video on Java interoperability with Swift, decided to give it a go to use Apache's POI Java library that supports XLS parsing and writing. It took a bit to understand swift-java's architecture and make it work, but I have succeeded in building a Swift package that can run in macOS (CLI and Xcode with debug support) and Linux (Docker running in GCP).

Thanks so much @ktoso and the rest of the team involved in SwiftJava for opening this door to allow so much new functionality in Swift codebases :slight_smile:

21 Likes

I think there is a lack of a good tutorial on this topic.

This is really nice to hear, thanks for the post Sergio :-)

It's quite evolving, so we didn't go deep on documentation as we weren't sure what will work out. See my latest post here which changed around entirely how commands and plugins are used: Swift-java command line subcommands refactor It's fair to request more documentation, but the context here is that we weren't even sure ourselfes about exact usage patterns. Things are getting more stable now so we should be able to provide more docs in the near future once we are sure which is the way this package will be used in practice.

7 Likes