DEVELOPMENT ENVIRONMENT

~liljamo/emerwen-proto

ref: 787470c66a23d1bb9c18b6ce7e410267dcb27d5d emerwen-proto/rust/emerwen-proto/build.rs -rw-r--r-- 986 bytes
787470c6Jonni Liljamo feat: rust crate 3 days ago
                                                                                
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
28
fn main() -> Result<(), Box<dyn std::error::Error>> {
    tonic_build::configure()
        .include_file("mod.rs")
        .type_attribute("Target", "#[derive(serde::Deserialize, serde::Serialize)]")
        .type_attribute(
            "Target.method",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute(
            "Target.MethodPing",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute(
            "Target.MethodGET",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute("Worker", "#[derive(serde::Deserialize, serde::Serialize)]")
        .compile_protos(
            &[
                "../../proto/workertomaster.proto",
                "../../proto/webtomaster.proto",
                "../../proto/shared/target.proto",
                "../../proto/shared/worker.proto",
            ],
            &["../../proto"],
        )?;
    Ok(())
}