From b96dc52bef73465655eeb23abeccd6dfbe380b89 Mon Sep 17 00:00:00 2001 From: bouzuya Date: Thu, 27 Oct 2022 07:05:30 +0900 Subject: [PATCH] twiq: Fix crates/db/build.rs --- twiq/Cargo.lock | 1 + twiq/crates/db/Cargo.toml | 1 + twiq/crates/db/build.rs | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/twiq/Cargo.lock b/twiq/Cargo.lock index 956dff52..c07ee82d 100644 --- a/twiq/Cargo.lock +++ b/twiq/Cargo.lock @@ -226,6 +226,7 @@ dependencies = [ "google-cloud-auth", "ordered-float", "prost", + "prost-build", "prost-types", "reqwest", "serde", diff --git a/twiq/crates/db/Cargo.toml b/twiq/crates/db/Cargo.toml index f933d071..74d6097c 100644 --- a/twiq/crates/db/Cargo.toml +++ b/twiq/crates/db/Cargo.toml @@ -28,4 +28,5 @@ uuid = { version = "1.1.2", features = ["v4"] } tokio = { version = "1.20.1", features = ["full"] } [build-dependencies] +prost-build = "0.11.1" tonic-build = "0.8.2" diff --git a/twiq/crates/db/build.rs b/twiq/crates/db/build.rs index 8e4c8477..b97b547e 100644 --- a/twiq/crates/db/build.rs +++ b/twiq/crates/db/build.rs @@ -1,5 +1,7 @@ use std::{fs, path::Path}; +use prost_build::Config; + fn main() { // brew install protobuf let out_dir = Path::new("src/firestore_rpc"); @@ -7,11 +9,17 @@ fn main() { fs::remove_dir_all(&out_dir).unwrap(); } fs::create_dir_all(&out_dir).unwrap(); + let mut config = Config::new(); + config.disable_comments(&[ + "google.api.HttpRule", + "google.firestore.v1.StructuredQuery.start_at", + ]); tonic_build::configure() .build_client(true) .build_server(false) .out_dir(out_dir) - .compile( + .compile_with_config( + config, &["proto/googleapis/google/firestore/v1/firestore.proto"], &["proto/googleapis"], )