Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r--xtask/src/main.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index df4d9810e6..9418675a34 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -13,6 +13,7 @@
mod flags;
+mod codegen;
mod dist;
mod install;
mod metrics;
@@ -20,10 +21,7 @@ mod publish;
mod release;
use anyhow::bail;
-use std::{
- env,
- path::{Path, PathBuf},
-};
+use std::{env, path::PathBuf};
use xshell::{cmd, Shell};
fn main() -> anyhow::Result<()> {
@@ -40,6 +38,7 @@ fn main() -> anyhow::Result<()> {
flags::XtaskCmd::Dist(cmd) => cmd.run(sh),
flags::XtaskCmd::PublishReleaseNotes(cmd) => cmd.run(sh),
flags::XtaskCmd::Metrics(cmd) => cmd.run(sh),
+ flags::XtaskCmd::Codegen(cmd) => cmd.run(sh),
flags::XtaskCmd::Bb(cmd) => {
{
let _d = sh.push_dir("./crates/rust-analyzer");
@@ -54,14 +53,11 @@ fn main() -> anyhow::Result<()> {
}
}
+/// Returns the path to the root directory of `rust-analyzer` project.
fn project_root() -> PathBuf {
- Path::new(
- &env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| env!("CARGO_MANIFEST_DIR").to_owned()),
- )
- .ancestors()
- .nth(1)
- .unwrap()
- .to_path_buf()
+ let dir =
+ env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| env!("CARGO_MANIFEST_DIR").to_owned());
+ PathBuf::from(dir).parent().unwrap().to_owned()
}
fn run_fuzzer(sh: &Shell) -> anyhow::Result<()> {