Add build benchmark xtask command

This commit is contained in:
Aleksey Kladov 2021-01-11 21:39:16 +03:00
parent 3aa153b46c
commit c62f1c762f

View file

@ -12,7 +12,7 @@ use std::env;
use codegen::CodegenCmd; use codegen::CodegenCmd;
use pico_args::Arguments; use pico_args::Arguments;
use xshell::pushd; use xshell::{cmd, cp, pushd};
use xtask::{ use xtask::{
codegen::{self, Mode}, codegen::{self, Mode},
dist::DistCmd, dist::DistCmd,
@ -124,6 +124,13 @@ FLAGS:
args.finish()?; args.finish()?;
MetricsCmd { dry_run }.run() MetricsCmd { dry_run }.run()
} }
"bb" => {
let suffix: String = args.free_from_str()?.unwrap();
args.finish()?;
cmd!("cargo build --release").run()?;
cp("./target/release/rust-analyzer", format!("./target/rust-analyzer-{}", suffix))?;
Ok(())
}
_ => { _ => {
eprintln!( eprintln!(
"\ "\
@ -141,7 +148,8 @@ SUBCOMMANDS:
install install
lint lint
dist dist
promote" promote
bb"
); );
Ok(()) Ok(())
} }