diff options
| author | benj <benj@rse8.com> | 2022-12-30 15:57:36 -0800 |
|---|---|---|
| committer | benj <benj@rse8.com> | 2022-12-30 15:57:36 -0800 |
| commit | 8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3 (patch) | |
| tree | 1ff85fd9fbd94a5559f9dbac755973fd58b31f28 /crates/secd/build.rs | |
| parent | f0ea9ecd17b03605d747044874a26e1bd52c0ee1 (diff) | |
| download | secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.gz secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.bz2 secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.lz secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.xz secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.zst secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.zip | |
impl authZ write and check (depends on spicedb for now)
Diffstat (limited to '')
| -rw-r--r-- | crates/secd/build.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/secd/build.rs b/crates/secd/build.rs index 3a8149e..8471105 100644 --- a/crates/secd/build.rs +++ b/crates/secd/build.rs @@ -1,3 +1,28 @@ +use std::env; +use std::path::PathBuf; + +use glob::glob; + fn main() { println!("cargo:rerun-if-changed=migrations"); + + let proto_files: Vec<PathBuf> = glob("proto/**/*.proto") + .unwrap() + .into_iter() + .filter_map(Result::ok) + .collect(); + + // Tell cargo to recompile if any of these proto files are changed + for proto_file in &proto_files { + println!("cargo:rerun-if-changed={}", proto_file.display()); + } + + let descriptor_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("proto_descriptor.bin"); + + tonic_build::configure() + .server_mod_attribute("attrs", "#[cfg(feature = \"server\")]") + .client_mod_attribute("attrs", "#[cfg(feature = \"client\")]") + .file_descriptor_set_path(&descriptor_path) + .compile(&proto_files, &["proto"]) + .unwrap(); } |
