Skip to content

Commit

Permalink
Revert "twiq: Fix to use OUT_DIR"
Browse files Browse the repository at this point in the history
This reverts commit 0721dca.
  • Loading branch information
bouzuya committed Nov 11, 2022
1 parent 0721dca commit f8fd3c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions twiq/.gitignore
@@ -1,2 +1,3 @@
/crates/db/src/firestore_rpc/
/target/
/.env*
8 changes: 8 additions & 0 deletions twiq/crates/db/build.rs
@@ -1,7 +1,14 @@
use std::{fs, path::Path};

use prost_build::Config;

fn main() {
// brew install protobuf
let out_dir = Path::new("src/firestore_rpc");
if out_dir.exists() {
fs::remove_dir_all(&out_dir).unwrap();
}
fs::create_dir_all(&out_dir).unwrap();
// コメントに非 Rust の fenced code block があることで doctest が壊れるので
// 一部のコメントの出力を避ける
let mut config = Config::new();
Expand All @@ -15,6 +22,7 @@ fn main() {
tonic_build::configure()
.build_client(true)
.build_server(false)
.out_dir(out_dir)
// service および rpc のコメント出力の無効化
.disable_comments("google.firestore.v1.Firestore")
.disable_comments("google.firestore.v1.Firestore.RunAggregationQuery")
Expand Down
10 changes: 5 additions & 5 deletions twiq/crates/db/src/firestore_rpc.rs
@@ -1,20 +1,20 @@
pub mod google {
pub mod api {
tonic::include_proto!("google.api");
include!("firestore_rpc/google.api.rs");
}
pub mod firestore {
pub mod v1 {
tonic::include_proto!("google.firestore.v1");
include!("firestore_rpc/google.firestore.v1.rs");
}
}
pub mod protobuf {
tonic::include_proto!("google.protobuf");
include!("firestore_rpc/google.protobuf.rs");
}
pub mod r#type {
tonic::include_proto!("google.r#type");
include!("firestore_rpc/google.r#type.rs");
}
pub mod rpc {
tonic::include_proto!("google.rpc");
include!("firestore_rpc/google.rpc.rs");
}
}

Expand Down

0 comments on commit f8fd3c7

Please sign in to comment.