86469d6b35
2.设计项目代码结构 3.实现草稿数据和发布数据数据库访问 4.实现草稿数据graphQL接口
33 lines
979 B
Rust
33 lines
979 B
Rust
use std::process::Command;
|
|
|
|
use prost_build::Config;
|
|
fn main() {
|
|
// println!("cargo:rerun-if-changed=build.rs");
|
|
#[cfg(target_os = "windows")]
|
|
{
|
|
std::env::set_var(
|
|
"PROTOC",
|
|
"../../rtss-proto-msg/protoc/protoc-27.4-win64/bin/protoc.exe",
|
|
);
|
|
}
|
|
Config::new()
|
|
.out_dir("src/pb")
|
|
.type_attribute("common.DataType", "#[derive(sqlx::Type)]")
|
|
.type_attribute("common.DataType", "#[derive(async_graphql::Enum)]")
|
|
.type_attribute("common.FeatureType", "#[derive(sqlx::Type)]")
|
|
.compile_protos(
|
|
&[
|
|
"../../rtss-proto-msg/src/em_data.proto",
|
|
"../../rtss-proto-msg/src/common.proto",
|
|
],
|
|
&["../../rtss-proto-msg/src/"],
|
|
)
|
|
.unwrap();
|
|
|
|
// Run cargo fmt to format the generated code
|
|
Command::new("cargo")
|
|
.args(["fmt"])
|
|
.status()
|
|
.expect("Failed to run cargo fmt on rtss-dto");
|
|
}
|