Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's this?
A new
parse-bridges
subcommand.Also, an update to the documentation in the example showing this feature's preview.
This is handy for usage in higher-level build systems.
For example, in my case, I build both Rust and Swift with CMake, and having this CLI command implemented would allow generating the glue code from CMake as well, as a dependency step before building Rust/Swift targets (via
add_custom_target
API).Notes
One caveat of the current implementation is that one would have to duplicate the crate name in the invocation line (the first argument).
This is fine for cases like mine, where this would be taken from the build system anyway, but it may not be handy for other cases.
The package name can be automatically deduced if one's running in the correct directory (the package root).
In this case, we can parse the
cargo read-manifest
output and get the name from there.This would require a new dependency, though (
serde_json
), so I decided not to do this just yet, but if this sounds okay to you, I'll go ahead and implement this as well.