move codegen to xtask

This commit is contained in:
nora 2022-02-19 20:07:17 +01:00
parent c5d83fe776
commit 077b6fd633
12 changed files with 1456 additions and 1727 deletions

22
xtask/src/main.rs Normal file
View file

@ -0,0 +1,22 @@
mod codegen;
fn main() {
let command = std::env::args().nth(1).unwrap_or_else(|| {
eprintln!("No task provided");
help();
std::process::exit(1);
});
match command.as_str() {
"generate" | "gen" => codegen::main(),
_ => eprintln!("Unknown command {command}."),
}
}
fn help() {
println!(
"Available tasks:
generate - Generate amqp method code in `amqp_transport/src/classes/generated.rs.
Dumps code to stdout and should be redirected manually."
);
}