Skip to content

Commit 8e316bb

Browse files
Add Cargo.toml and build script for grpc/rust (#212)
## Release notes: usage and product changes We add Cargo.toml to make typedb-protocol a valid cargo git dependency. ## Implementation
1 parent 3a993da commit 8e316bb

File tree

7 files changed

+49
-20
lines changed

7 files changed

+49
-20
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ target/
2727
*.class
2828

2929
# Cargo files #
30-
Cargo.toml
3130
Cargo.lock
3231

3332
# Mobile Tools for Java (J2ME) files #

dependencies/ide/BUILD

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

dependencies/ide/sync.sh

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

dependencies/typedb/repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ def typedb_dependencies():
88
git_repository(
99
name = "typedb_dependencies",
1010
remote = "https://github.com/typedb/typedb-dependencies",
11-
commit = "554bf8c574b6740dd9c4aae78191402fde413a90", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_dependencies
11+
commit = "70e8b662d2b3f10bba64befcc2c5183949eb9efa", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_dependencies
1212
)

grpc/rust/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
[package]
6+
name = "typedb-protocol"
7+
version = "0.0.0"
8+
edition = "2021"
9+
10+
[lib]
11+
path = "lib.rs"
12+
13+
[build-dependencies]
14+
tonic-build = "^0.12"
15+
16+
[dependencies]
17+
prost = "^0.13"
18+
tonic = { version = "^0.12", features = ["tls", "tls-roots"] }

grpc/rust/build.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
fn main() -> std::io::Result<()> {
6+
let protos = vec![
7+
"../../proto/answer.proto",
8+
"../../proto/concept.proto",
9+
"../../proto/connection.proto",
10+
"../../proto/database.proto",
11+
"../../proto/logic.proto",
12+
"../../proto/options.proto",
13+
"../../proto/query.proto",
14+
"../../proto/server.proto",
15+
"../../proto/transaction.proto",
16+
"../../proto/typedb-service.proto",
17+
"../../proto/user.proto",
18+
"../../proto/version.proto",
19+
];
20+
21+
tonic_build::configure()
22+
.server_mod_attribute(".", "#[allow(non_camel_case_types)]")
23+
.client_mod_attribute(".", "#[allow(non_camel_case_types)]")
24+
.compile_protos(&protos, &["../.."])
25+
}

grpc/rust/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
tonic::include_proto!("typedb.protocol");

0 commit comments

Comments
 (0)