anki/rslib/proto/build.rs
Damien Elmes 0f77de896d Fix building outside workspace
rslib/build.rs needs descriptors, even if env var not set
2023-07-02 18:22:44 +10:00

22 lines
546 B
Rust

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
pub mod python;
pub mod rust;
pub mod ts;
use anki_proto_gen::descriptors_path;
use anki_proto_gen::get_services;
use anyhow::Result;
fn main() -> Result<()> {
let descriptors_path = descriptors_path();
let pool = rust::write_rust_protos(descriptors_path)?;
let (_, services) = get_services(&pool);
python::write_python_interface(&services)?;
ts::write_ts_interface(&services)?;
Ok(())
}