antftp 0.1.10

AntFTP is a FTP server companion app for AntTP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() -> Result<(), Box<dyn std::error::Error>> {
    use std::process::Command;
    let protoc_exists = Command::new("protoc").arg("--version").output().is_ok();

    if protoc_exists {
        tonic_build::compile_protos("proto/pointer.proto")?;
        tonic_build::compile_protos("proto/pnr.proto")?;
        tonic_build::compile_protos("proto/archive.proto")?;
        tonic_build::compile_protos("proto/public_archive.proto")?;
        tonic_build::compile_protos("proto/tarchive.proto")?;
    } else {
        println!("cargo:warning=protoc not found, disabling gRPC support");
        println!("cargo:rustc-cfg=grpc_disabled");
    }
    Ok(())
}