-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parse-bridges CLI subcommand (#274)
## 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. ## Examples Single file: ```shell swift-bridge-cli parse-bridges --crate-name my-awesome-crate -f src/lib.rs -o generated ``` Multiple files: ```shell swift-bridge-cli parse-bridges --crate-name my-superb-crate \ -f src/lib.rs \ -f src/some_other_file.rs \ -o generated ```
- Loading branch information
1 parent
ef01d21
commit 717fcef
Showing
4 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters