b37063e20a
- Dropped the protobuf extensions in favor of explicitly listing out methods in both services if we want to implement both, as it's clearer. - Move Service/Method wrappers into a separate crate that the various clients can import, to easily get at the list of backend services and their correct indices and comments.
24 lines
580 B
Rust
24 lines
580 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 std::env;
|
|
use std::path::PathBuf;
|
|
|
|
use anki_proto_gen::get_services;
|
|
use anyhow::Result;
|
|
|
|
fn main() -> Result<()> {
|
|
let descriptors_path = env::var("DESCRIPTORS_BIN").ok().map(PathBuf::from);
|
|
|
|
let pool = rust::write_rust_protos(descriptors_path)?;
|
|
let (_, services) = get_services(&pool);
|
|
python::write_python_interface(&services)?;
|
|
ts::write_ts_interface(&services)?;
|
|
|
|
Ok(())
|
|
}
|