Skip to content

Commit

Permalink
Wire up the Rust code generator to pb-jelly-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
goffrie committed Feb 12, 2024
1 parent 9500dea commit 134b1fc
Show file tree
Hide file tree
Showing 17 changed files with 92 additions and 2,560 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ generated/
.DS_Store
__pycache__/
*~

pb-jelly-gen/codegen/.black_venv
pb-jelly-gen/codegen/.mypy_venv
pb-jelly-gen/codegen/proto/rust/extensions_pb2.pyi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pb-jelly = "0.0.16"
##### `pb-jelly-gen`

A framework for generating Rust structs and implementations for `.proto` files.
In order to use pb-jelly, you need to add the pb-jelly-gen/codegen/codegen.py as a plugin to your protoc invocation.
In order to use pb-jelly, you need to add the pb-jelly-gen as a plugin to your protoc invocation.

We added some code here to handle the protoc invocation if you choose to use it.
You'll need to add a generation crate (see `examples_gen` for an example)
Expand Down
3 changes: 3 additions & 0 deletions examples/examples_gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ publish = false
[dependencies]
#pb-jelly-gen = "0.0.16" # If copying this example - use this
pb-jelly-gen = { path = "../../pb-jelly-gen" }

[patch.crates-io]
pb-jelly = { path = "../../pb-jelly" }
3 changes: 2 additions & 1 deletion examples/examples_gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ fn main() -> std::io::Result<()> {
.src_path("../protos")
.include_path("../includes")
.cleanup_out_path(true)
.gen_protos();
.gen_protos()
.expect("Failed to generate protos");

Ok(())
}
3 changes: 1 addition & 2 deletions pb-jelly-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ categories = ["encoding", "parsing", "web-programming"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
include_dir = "0.6"
tempfile = "3.1.0"
walkdir = "2"

pb-jelly = { path = "../pb-jelly" }
pb-jelly = { version = "0.0.16" }
proto_google = { path = "./proto_google" }
proto_rust = { path = "./proto_rust" }
regex = "1.10.2"
Expand Down
Loading

0 comments on commit 134b1fc

Please sign in to comment.