Skip to content

Commit 64139c0

Browse files
DMoscickistepancheg
authored andcommitted
Rename protoc-bin-rust to protoc-bin-rs
`protoc --rust_out=` no longer works because Google is working on official Rust plugin.
1 parent 6c49f4e commit 64139c0

File tree

26 files changed

+45
-45
lines changed

26 files changed

+45
-45
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ src/test/v*/pb_*.rs
1111
src/test/v*/*_pb.rs
1212
src/test/lib
1313
protobuf-bin-gen-rust
14-
protoc-gen-rust
14+
protoc-gen-rs
1515
target/
1616
Cargo.lock
1717
.idea

protobuf-codegen/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repository = "https://github.com/stepancheg/rust-protobuf/"
99
description = """
1010
Code generator for rust-protobuf.
1111
12-
Includes a library to invoke programmatically (e. g. from `build.rs`) and `protoc-gen-rust` binary.
12+
Includes a library to invoke programmatically (e. g. from `build.rs`) and `protoc-gen-rs` binary.
1313
"""
1414

1515
[lib]
@@ -27,8 +27,8 @@ protobuf-parse = { path = "../protobuf-parse", version = "=4.0.0-alpha.0" }
2727

2828
[[bin]]
2929

30-
name = "protoc-gen-rust"
31-
path = "src/bin/protoc-gen-rust.rs"
30+
name = "protoc-gen-rs"
31+
path = "src/bin/protoc-gen-rs.rs"
3232
test = false
3333

3434
[package.metadata.docs.rs]

protobuf-codegen/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ This crate is useful mostly from `build.rs` scripts to generate `.rs` files duri
77
# How to generate code
88

99
There are three main ways to generate `.rs` files from `.proto` files:
10-
* using `protoc` command line tool and `protoc-gen-rust` plugin
10+
* using `protoc` command line tool and `protoc-gen-rs` plugin
1111
* using this crate `Codegen` with pure rust parser
1212
* using this crate `Codegen` with `protoc` parser
1313

1414
Which one should you use depends on your needs.
1515

1616
If you are using non-cargo build system (like Bazel), you might prefer
17-
using `protoc-gen-rust` plugin for `protoc`.
17+
using `protoc-gen-rs` plugin for `protoc`.
1818

1919
If you build with `cargo`, you probably want to use `Codegen` from this crate.
2020

@@ -54,12 +54,12 @@ protobuf_codegen::Codegen::new()
5454
.run_from_script();
5555
```
5656

57-
## How to use `protoc-gen-rust`
57+
## How to use `protoc-gen-rs`
5858

5959
If you have to.
6060

6161
(Note `protoc` can be invoked programmatically with
62-
[protoc crate](https://docs.rs/protoc/%3E=3.0.0-alpha))
62+
[protoc crate](https://docs.rs/protoc/%3E=3.1.0-alpha))
6363

6464
0) Install protobuf for `protoc` binary.
6565

@@ -78,11 +78,11 @@ apt-get install protobuf-compiler
7878
Protobuf is needed only for code generation, `rust-protobuf` runtime
7979
does not use C++ protobuf library.
8080

81-
1) Install `protoc-gen-rust` program (which is `protoc` plugin)
81+
1) Install `protoc-gen-rs` program (which is `protoc` plugin)
8282

8383
It can be installed either from source or with `cargo install protobuf-codegen` command.
8484

85-
2) Add `protoc-gen-rust` to $PATH
85+
2) Add `protoc-gen-rs` to $PATH
8686

8787
If you installed it with cargo, it should be
8888

@@ -93,7 +93,7 @@ PATH="$HOME/.cargo/bin:$PATH"
9393
3) Generate .rs files:
9494

9595
```sh
96-
protoc --rust_out . foo.proto
96+
protoc --rs_out . foo.proto
9797
```
9898

9999
This will generate .rs files in current directory.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
protobuf_codegen::protoc_gen_rs::protoc_gen_rust_main();
3+
}

protobuf-codegen/src/bin/protoc-gen-rust.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

protobuf-codegen/src/codegen/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum CodegenError {
3434

3535
/// Entry point for `.proto` to `.rs` code generation.
3636
///
37-
/// This is similar to `protoc --rust_out...`.
37+
/// This is similar to `protoc --rs_out...`.
3838
#[derive(Debug, Default)]
3939
pub struct Codegen {
4040
/// What parser to use to parse `.proto` files.
@@ -208,8 +208,8 @@ impl Codegen {
208208

209209
/// Invoke the code generation.
210210
///
211-
/// This is roughly equivalent to `protoc --rust_out=...` but
212-
/// without requiring `protoc-gen-rust` command in `$PATH`.
211+
/// This is roughly equivalent to `protoc --rs_out=...` but
212+
/// without requiring `protoc-gen-rs` command in `$PATH`.
213213
///
214214
/// This function uses pure Rust parser or `protoc` parser depending on
215215
/// how this object was configured.

protobuf-codegen/src/customize/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl Customize {
161161
/// So the generated code (and more importantly, generated binary size) is smaller,
162162
/// but reflection, text format, JSON serialization won't work.
163163
///
164-
/// Note when using `protoc` plugin `protoc-gen-rust`, the option name is just `lite`.
164+
/// Note when using `protoc` plugin `protoc-gen-rs`, the option name is just `lite`.
165165
pub fn lite_runtime(mut self, lite_runtime: bool) -> Self {
166166
self.lite_runtime = Some(lite_runtime);
167167
self

protobuf-codegen/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
//! # How to generate code
66
//!
77
//! There are three main ways to generate `.rs` files from `.proto` files:
8-
//! * using `protoc` command line tool and `protoc-gen-rust` plugin
8+
//! * using `protoc` command line tool and `protoc-gen-rs` plugin
99
//! * using this crate `Codegen` with pure rust parser
1010
//! * using this crate `Codegen` with `protoc` parser
1111
//!
1212
//! Which one should you use depends on your needs.
1313
//!
1414
//! If you are using non-cargo build system (like Bazel), you might prefer
15-
//! using `protoc-gen-rust` plugin for `protoc`.
15+
//! using `protoc-gen-rs` plugin for `protoc`.
1616
//!
1717
//! If you build with `cargo`, you probably want to use `Codegen` from this crate.
1818
//!
@@ -57,7 +57,7 @@
5757
//! .run_from_script();
5858
//! ```
5959
//!
60-
//! ## How to use `protoc-gen-rust`
60+
//! ## How to use `protoc-gen-rs`
6161
//!
6262
//! If you have to.
6363
//!
@@ -81,11 +81,11 @@
8181
//! Protobuf is needed only for code generation, `rust-protobuf` runtime
8282
//! does not use C++ protobuf library.
8383
//!
84-
//! 1) Install `protoc-gen-rust` program (which is `protoc` plugin)
84+
//! 1) Install `protoc-gen-rs` program (which is `protoc` plugin)
8585
//!
8686
//! It can be installed either from source or with `cargo install protobuf-codegen` command.
8787
//!
88-
//! 2) Add `protoc-gen-rust` to $PATH
88+
//! 2) Add `protoc-gen-rs` to $PATH
8989
//!
9090
//! If you installed it with cargo, it should be
9191
//!
@@ -96,7 +96,7 @@
9696
//! 3) Generate .rs files:
9797
//!
9898
//! ```sh
99-
//! protoc --rust_out . foo.proto
99+
//! protoc --rs_out . foo.proto
100100
//! ```
101101
//!
102102
//! This will generate .rs files in current directory.
@@ -136,7 +136,7 @@ mod compiler_plugin;
136136
mod customize;
137137
mod gen;
138138
pub mod gen_and_write;
139-
pub mod protoc_gen_rust;
139+
pub mod protoc_gen_rs;
140140

141141
pub use codegen::Codegen;
142142
pub use customize::Customize;

protobuf-codegen/src/protoc_gen_rust.rs renamed to protobuf-codegen/src/protoc_gen_rs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn protoc_gen_rust_main() {
1111
let customize = Customize::parse_from_parameter(r.parameter).expect("parse options");
1212
gen_all(
1313
r.file_descriptors,
14-
"protoc --rust_out=...",
14+
"protoc --rs_out=...",
1515
r.files_to_generate,
1616
&customize,
1717
&CustomizeCallbackDefault,

protobuf-examples/pure-vs-protoc/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fn main() {
55
// and with codegen depending on `protoc` binary.
66
// This is for demonstration purposes; in practice you'd need either of them.
77
//
8-
// Note there's a third option: using `protoc` binary directly and `protoc-gen-rust`
8+
// Note there's a third option: using `protoc` binary directly and `protoc-gen-rs`
99
// plugin, this is a canonical way to generate protobuf sources.
1010
// This is not possible to do with Cargo (since Cargo cannot depend on binaries)
1111
// but can be used with some other build system.

protobuf-parse/src/protoc/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! `protoc` command must be in `$PATH`, along with `protoc-gen-LANG` command.
44
//!
55
//! Note that to generate `rust` code from `.proto` files, `protoc-rust` crate
6-
//! can be used, which does not require `protoc-gen-rust` present in `$PATH`.
6+
//! can be used, which does not require `protoc-gen-rs` present in `$PATH`.
77
88
#![deny(missing_docs)]
99
#![deny(rustdoc::broken_intra_doc_links)]

protobuf/regenerate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ MSYS_NT*)
3232
esac
3333

3434
"$PROTOC" \
35-
--plugin=protoc-gen-rust="$where_am_i/target/debug/protoc-gen-rust$exe_suffix" \
36-
--rust_out tmp-generated \
37-
--rust_opt 'inside_protobuf=true gen_mod_rs=false' \
35+
--plugin=protoc-gen-rs="$where_am_i/target/debug/protoc-gen-rs$exe_suffix" \
36+
--rs_out tmp-generated \
37+
--rs_opt 'inside_protobuf=true gen_mod_rs=false' \
3838
-I../proto \
3939
../proto/google/protobuf/*.proto \
4040
../proto/google/protobuf/compiler/*.proto \

protobuf/src/descriptor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/doctest_pb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/rustproto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/duration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/empty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/field_mask.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/source_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/struct_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/timestamp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/type_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

protobuf/src/well_known_types/wrappers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit
2-
// .proto file is parsed by protoc --rust_out=...
2+
// .proto file is parsed by protoc --rs_out=...
33
// @generated
44

55
// https://github.com/rust-lang/rust-clippy/issues/702

0 commit comments

Comments
 (0)