Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
src/ | 23-Nov-2023 | - | 6,508 | 5,633 | ||
.cargo_vcs_info.json | D | 23-Nov-2023 | 74 | 6 | 5 | |
Android.bp | D | 23-Nov-2023 | 1.3 KiB | 61 | 54 | |
Cargo.lock | D | 23-Nov-2023 | 386 | 17 | 14 | |
Cargo.toml | D | 23-Nov-2023 | 1.2 KiB | 38 | 33 | |
Cargo.toml.orig | D | 23-Nov-2023 | 750 | 36 | 26 | |
LICENSE | D | 23-Nov-2023 | 1 KiB | 19 | 16 | |
LICENSE.txt | D | 23-Nov-2023 | 1 KiB | 19 | 16 | |
METADATA | D | 23-Nov-2023 | 511 | 20 | 19 | |
MODULE_LICENSE_MIT | D | 23-Nov-2023 | 0 | |||
NOTICE | D | 23-Nov-2023 | 1 KiB | 19 | 16 | |
OWNERS | D | 23-Nov-2023 | 40 | 2 | 1 | |
README.android | D | 23-Nov-2023 | 619 | 16 | 12 | |
README.md | D | 23-Nov-2023 | 1.6 KiB | 58 | 36 |
README.android
1Since we do not run build.rs during an Android build, 2we need to set up the version number in src/lib.rs 3until we have a smarter way to patch it based on new 4version number in Cargo.toml. 5 6To update this package, please make sure that the following code 7in src/lib.rs is up to data. 8 9 // Hack: hard code version number here because Android.bp 10 // rust modules cannot pass it though env variable yet. 11 w.write_generated_by("rust-protobuf", "2.16.2"); 12 13If there are non-trivial changes in build.rs or src/lib.rs, 14please rerun cargo2android.py and verify the differences in 15Android.bp and src/lib.rs. 16
README.md
1# protobuf-codegen 2 3This crate contains protobuf code generator and a `protoc-gen-rust` `protoc` plugin. 4 5## protoc-gen-rust 6 7`protoc-gen-rust` implements standard protobuf `protoc` plugin conventions. 8 9Probably you do not want to use it directly in Rust environment, there are easier to use alternatives: 10 11* [protoc-rust crate](https://github.com/stepancheg/rust-protobuf/tree/master/protoc-rust) 12 which can be invoked programmatically from `build.rs` of your project 13 which requires only `protoc` in `$PATH` but not `protoc-gen-rust`. 14* [protobuf-codegen-pure crate](https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-codegen-pure) 15 which behaves like protoc-rust, but does not depend on `protoc` binary 16 17## But if you really want to use that plugin, here's the instruction 18 19(Note `protoc` can be invoked programmatically with 20[protoc crate](https://github.com/stepancheg/rust-protobuf/tree/master/protoc/)) 21 220) Install protobuf for `protoc` binary. 23 24On OS X [Homebrew](https://github.com/Homebrew/brew) can be used: 25 26``` 27brew install protobuf 28``` 29 30On Ubuntu, `protobuf-compiler` package can be installed: 31 32``` 33apt-get install protobuf-compiler 34``` 35 36Protobuf is needed only for code generation, `rust-protobuf` runtime 37does not use `protobuf` library. 38 391) Install `protoc-gen-rust` program (which is `protoc` plugin) 40 41It can be installed either from source or with `cargo install protobuf` command. 42 432) Add `protoc-gen-rust` to $PATH 44 45If you installed it with cargo, it should be 46 47``` 48PATH="$HOME/.cargo/bin:$PATH" 49``` 50 513) Generate .rs files: 52 53``` 54protoc --rust_out . foo.proto 55``` 56 57This will generate .rs files in current directory. 58