-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanual_build.rs
More file actions
27 lines (23 loc) · 925 Bytes
/
manual_build.rs
File metadata and controls
27 lines (23 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// README:
//
// This script uses Prost crate to generate Rust sources from proto files.
// The script should be run as a build script - this will be done automatically after renaming to `build.rs` (a little hack).
//
// After generating sources, the sources should be copied into `src/generated` and the errors ought to be resolved manually.
use prost_build;
use std::io;
use std::path::PathBuf;
use std::{collections::HashMap, fs};
// Proto files corresponding to the Phenopacket Schema hierarchy leaves.
// The dependencies are imported and compiled automatically.
const PROTOS: &[&str] = &[
/* v1 elements */
"phenopackets/schema/v1/interpretation.proto",
/* v2 elements */
"phenopackets/schema/v2/phenopackets.proto",
];
// The top-level packages (just one here).
const INCLUDES: &[&str] = &["org"];
fn main() {
prost_build::compile_protos(PROTOS, INCLUDES).expect("Failed to compile protos");
}