-
Notifications
You must be signed in to change notification settings - Fork 48
[WIP] JExtractSwiftPlugin #138
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
Conversation
arguments.append(sourceDir) | ||
|
||
return [ | ||
.prebuildCommand( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can't work, since we need this to act on swiftinterface files of the module it's acting on. It has to be a "post build" plugin really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: make this into a command plugin people would have to invoke manually swift package jextract
which would generate the bindings.
We could also then swift package jextract jar
to produce a jar or even publish it etc.
Before weekend snapshot:
Basically this means you "just" write some swift sources, add the extract plugin to the given target. Add a small task in gradle to trigger swiftpm and this way gradle/java immediately see the wrappers. Upon changing swift -> gradle triggers swift build again and it's all very seamless 🥳 |
cd1a2b4
to
354ea56
Compare
🚧 early work in progress 🚧
This is first steps to make an jextract-swift plugin.
If we're able to pull this off as a swiftpm plugin we would basically have a way to "make me a jar that exposes this swift module, that would be super simple to consume from Java.
Need to figure out how to actually make this work -- it can't be a build plugin, but preBuild also isn't quite enough.
We may have to make it a command plugin, since we need compilation OUTPUT of the module to then act on the swift interfaces.