Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Support Swift Package Manager #86

Open
LouisCAD opened this issue Aug 22, 2020 · 2 comments
Open

Support Swift Package Manager #86

LouisCAD opened this issue Aug 22, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@LouisCAD
Copy link

LouisCAD commented Aug 22, 2020

Hi, here's the problem:
I'd like to have MongoKitten converted to Kotlin.

Unfortunately, it currently doesn't work because Swift Package Manager dependencies are used (for Swift NIO and other source libraries that depend on Swift NIO too.).

Swift NIO definitely has equivalents in Kotlin libraries, the Android platform and Java libraries. I can find them if needed.

I'd like this project to support converting libraries that depend on other Swift libraries so long as these are source libraries (and not binary libraries), or at least for select libraries like Swift NIO and other first-party Swift libraries.

@LouisCAD LouisCAD added the enhancement New feature or request label Aug 22, 2020
@vinivendra
Copy link
Owner

Hi! Thanks for bringing this to my attention. SPM support sounds like a great idea, but it's been a while since I've thought about it.

This isn't supported right now because the current frontend is based on AST dumps from the Swift compiler, and I don't know how (or even if it's possible) to get those AST dumps for a Swift Package Manager project. I just asked about it on the forums, though, so here's hoping.

The good news is that I'm working on rewriting that frontend (to use SwiftSyntax and SourceKit instead of the AST dumps), and I think the new implementation will be more stable and more compatible with things like the Swift Package Manager. Once that's done, I can come back to this issue.

If you still want to move forward in the meantime, I'd suggest trying to change the files you want to translate so that you can compile them with swiftc (instead of swift build). This might involve, for instance, replacing references to the SwiftNIO API with your own protocols (or empty classes, etc). The swiftc compilation doesn't have to be functional, but if it compiles without errors you should be able to run Gryphon on it.

Let me know if I can help with anything.

@LouisCAD
Copy link
Author

Sounds good!

Please, let me know if it doesn't go as expected and you need ideas for ways to support this :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants