Skip to content

Commit 62d5203

Browse files
committed
Add a cargo workspace
Add a cargo workspace that links all the crates in the project together. This should make publishing easier when "package-workspace" stabilises. Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent 4929e90 commit 62d5203

File tree

3 files changed

+49
-20
lines changed

3 files changed

+49
-20
lines changed

Cargo.toml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
1-
[package]
2-
name = "ttrpc"
3-
version = "0.8.4"
4-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
1+
[workspace]
2+
members = [
3+
"./compiler",
4+
"./ttrpc-codegen",
5+
"./example",
6+
"./"
7+
]
8+
resolver = "2"
9+
10+
[workspace.package]
511
edition = "2018"
612
license = "Apache-2.0"
7-
keywords = ["ttrpc", "protobuf", "rpc"]
813
readme = "README.md"
914
repository = "https://github.com/containerd/ttrpc-rust"
1015
homepage = "https://github.com/containerd/ttrpc-rust"
16+
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
17+
18+
[workspace.dependencies]
19+
# The dependencies in this section can be used by the crates in this
20+
# workspace by specifying `workspace = true` instead of the crate
21+
# version. For example, for protobuf:
22+
# protobuf = { workspace = true }
23+
ttrpc = { version = "0.8.4", path = "./" }
24+
ttrpc-codegen = { version = "0.5.0", path = "./ttrpc-codegen" }
25+
ttrpc-compiler = { version = "0.7.0", path = "./compiler" }
26+
protobuf = "3.7.2"
27+
protobuf-codegen = "3.7.2"
28+
protobuf-support = "3.7.2"
29+
30+
[package]
31+
name = "ttrpc"
32+
version = "0.8.4"
33+
authors = { workspace = true }
34+
edition = { workspace = true }
35+
license = { workspace = true }
36+
repository = { workspace = true }
37+
homepage = { workspace = true }
38+
keywords = ["ttrpc", "protobuf", "rpc"]
39+
readme = "README.md"
1140
description = "A Rust version of ttrpc."
1241
rust-version = "1.70"
1342

1443
[dependencies]
15-
protobuf = { version = "3.7.2" }
44+
protobuf = { workspace = true }
1645
libc = { version = "0.2.59", features = [ "extra_traits" ] }
1746
nix = "0.26.2"
1847
log = "0.4"
@@ -33,7 +62,7 @@ tokio-vsock = { version = "0.7.0", optional = true }
3362
[build-dependencies]
3463
# lock home to avoid conflict with latest version
3564
home = "=0.5.9"
36-
protobuf-codegen = "3.7.2"
65+
protobuf-codegen = { workspace = true }
3766

3867
[features]
3968
default = ["sync"]

compiler/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[package]
22
name = "ttrpc-compiler"
33
version = "0.7.0"
4-
edition = "2018"
5-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
6-
license = "Apache-2.0"
4+
edition = { workspace = true }
5+
license = { workspace = true }
6+
authors = { workspace = true }
7+
readme = "README.md"
78
keywords = ["compiler", "ttrpc", "protobuf"]
89
description = "ttRPC compiler for ttrpc"
910
categories = ["network-programming"]
1011
repository = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
1112
homepage = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
12-
readme = "README.md"
1313

1414
[dependencies]
1515
# lock home to avoid conflict with latest version
1616
home = "=0.5.9"
17-
protobuf = "3.7.2"
18-
protobuf-codegen = "3.7.2"
17+
protobuf = { workspace = true }
18+
protobuf-codegen = { workspace = true }
1919
prost = "0.8"
2020
prost-build = "0.8"
2121
prost-types = "0.8"

ttrpc-codegen/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "ttrpc-codegen"
33
version = "0.5.0"
4-
edition = "2018"
5-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
6-
license = "Apache-2.0"
4+
edition = { workspace = true }
5+
authors = { workspace = true }
6+
license = { workspace = true }
77
keywords = ["codegen", "ttrpc", "protobuf"]
88
description = "Rust codegen for ttrpc using ttrpc-compiler crate"
99
categories = ["network-programming", "development-tools::build-utils"]
@@ -15,7 +15,7 @@ readme = "README.md"
1515
[dependencies]
1616
# lock home to avoid conflict with latest version
1717
home = "=0.5.9"
18-
protobuf-support = "3.7.2"
19-
protobuf = "3.7.2"
20-
protobuf-codegen = "3.7.2"
21-
ttrpc-compiler = { version = "0.7.0", path = "../compiler" }
18+
protobuf-support = { workspace = true }
19+
protobuf = { workspace = true }
20+
protobuf-codegen = { workspace = true }
21+
ttrpc-compiler = { workspace = true }

0 commit comments

Comments
 (0)