Skip to content

Commit e14aa82

Browse files
authored
Merge pull request #80 from Tim-Zhang/big-release
release: ttrpc 0.5.0, ttrpc-codegen 0.2.0, ttrpc-compiler 0.4.0
2 parents 6c8c84d + 8f05153 commit e14aa82

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ttrpc"
3-
version = "0.4.14"
3+
version = "0.5.0"
44
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
55
edition = "2018"
66
license = "Apache-2.0"

compiler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ttrpc-compiler"
3-
version = "0.3.2"
3+
version = "0.4.0"
44
edition = "2018"
55
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
66
license = "Apache-2.0"

compiler/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ generate rust version ttrpc code from proto files.
66

77
- [Manual Generation](https://github.com/containerd/ttrpc-rust#1-generate-with-protoc-command) uses ttrpc-compiler as a protoc plugin
88
- [Programmatic Generation](https://github.com/containerd/ttrpc-rust#2-generate-programmatically) uses ttrpc-compiler as a rust crate
9+
10+
## Versions
11+
| ttrpc-compiler version | ttrpc version |
12+
| ------------- | ------------- |
13+
| 0.3.x | <= 0.4.x |
14+
| 0.4.x | >= 0.5.x

ttrpc-codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ttrpc-codegen"
3-
version = "0.1.2"
3+
version = "0.2.0"
44
edition = "2018"
55
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
66
license = "Apache-2.0"

ttrpc-codegen/README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22

33
API to generate `.rs` files to be used e. g. [from build.rs](../example/build.rs).
44

5-
Example code:
5+
## Example
6+
7+
build.rs:
68

79
```rust
810
use ttrpc_codegen::Codegen;
9-
use ttrpc_codegen::Customize;
11+
use ttrpc_codegen::{Customize, ProtobufCustomize};
1012

1113
fn main() {
14+
let protos = vec![
15+
"protos/a.proto",
16+
"protos/b.proto",
17+
];
18+
1219
Codegen::new()
1320
.out_dir("protocols/sync")
1421
.inputs(&protos)
@@ -17,19 +24,29 @@ fn main() {
1724
.customize(Customize {
1825
..Default::default()
1926
})
27+
.rust_protobuf_customize(ProtobufCustomize {
28+
..Default::default()
29+
}
2030
.run()
2131
.expect("Gen code failed.");
2232
}
2333

2434
```
2535

26-
And in `Cargo.toml`:
36+
Cargo.toml:
2737

2838
```
2939
[build-dependencies]
30-
ttrpc-codegen = "0.3"
40+
ttrpc-codegen = "0.2"
3141
```
3242

43+
## Versions
44+
| ttrpc-codegen version | ttrpc version |
45+
| ------------- | ------------- |
46+
| 0.1.x | <= 0.4.x |
47+
| 0.2.x | >= 0.5.x |
48+
49+
## Alternative
3350
The alternative is to use
3451
[protoc-rust crate](https://github.com/stepancheg/rust-protobuf/tree/master/protoc-rust),
3552
which relies on `protoc` command to parse descriptors. Both crates should produce the same result,

0 commit comments

Comments
 (0)