diff options
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/Cargo.toml | 3 | ||||
-rw-r--r-- | xtask/src/main.rs | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 77b9ae2b4..65cabf005 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml | |||
@@ -5,6 +5,9 @@ version = "0.1.0" | |||
5 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
6 | publish = false | 6 | publish = false |
7 | 7 | ||
8 | [lib] | ||
9 | doctest = false | ||
10 | |||
8 | [dependencies] | 11 | [dependencies] |
9 | walkdir = "2.1.3" | 12 | walkdir = "2.1.3" |
10 | pico-args = "0.3.0" | 13 | pico-args = "0.3.0" |
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 663e28103..c97bfec97 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -9,11 +9,10 @@ | |||
9 | //! `.cargo/config`. | 9 | //! `.cargo/config`. |
10 | mod help; | 10 | mod help; |
11 | 11 | ||
12 | use std::{env, fmt::Write, path::PathBuf, str}; | ||
13 | |||
12 | use anyhow::Context; | 14 | use anyhow::Context; |
13 | use core::fmt::Write; | ||
14 | use core::str; | ||
15 | use pico_args::Arguments; | 15 | use pico_args::Arguments; |
16 | use std::{env, path::PathBuf}; | ||
17 | use xtask::{ | 16 | use xtask::{ |
18 | codegen::{self, Mode}, | 17 | codegen::{self, Mode}, |
19 | install_pre_commit_hook, reformat_staged_files, run, run_clippy, run_fuzzer, run_rustfmt, | 18 | install_pre_commit_hook, reformat_staged_files, run, run_clippy, run_fuzzer, run_rustfmt, |
@@ -37,7 +36,7 @@ struct ServerOpt { | |||
37 | } | 36 | } |
38 | 37 | ||
39 | fn main() -> Result<()> { | 38 | fn main() -> Result<()> { |
40 | if std::env::args().next().map(|it| it.contains("pre-commit")) == Some(true) { | 39 | if env::args().next().map(|it| it.contains("pre-commit")) == Some(true) { |
41 | return reformat_staged_files(); | 40 | return reformat_staged_files(); |
42 | } | 41 | } |
43 | 42 | ||
@@ -174,7 +173,7 @@ fn fix_path_for_mac() -> Result<()> { | |||
174 | fn install_client(ClientOpt::VsCode: ClientOpt) -> Result<()> { | 173 | fn install_client(ClientOpt::VsCode: ClientOpt) -> Result<()> { |
175 | let npm_version = Cmd { | 174 | let npm_version = Cmd { |
176 | unix: r"npm --version", | 175 | unix: r"npm --version", |
177 | windows: r"cmd.exe /c npm.cmd --version", | 176 | windows: r"cmd.exe /c npm --version", |
178 | work_dir: "./editors/code", | 177 | work_dir: "./editors/code", |
179 | } | 178 | } |
180 | .run(); | 179 | .run(); |
@@ -183,10 +182,10 @@ fn install_client(ClientOpt::VsCode: ClientOpt) -> Result<()> { | |||
183 | eprintln!("\nERROR: `npm --version` failed, `npm` is required to build the VS Code plugin") | 182 | eprintln!("\nERROR: `npm --version` failed, `npm` is required to build the VS Code plugin") |
184 | } | 183 | } |
185 | 184 | ||
186 | Cmd { unix: r"npm ci", windows: r"cmd.exe /c npm.cmd ci", work_dir: "./editors/code" }.run()?; | 185 | Cmd { unix: r"npm ci", windows: r"cmd.exe /c npm ci", work_dir: "./editors/code" }.run()?; |
187 | Cmd { | 186 | Cmd { |
188 | unix: r"npm run package --scripts-prepend-node-path", | 187 | unix: r"npm run package --scripts-prepend-node-path", |
189 | windows: r"cmd.exe /c npm.cmd run package", | 188 | windows: r"cmd.exe /c npm run package", |
190 | work_dir: "./editors/code", | 189 | work_dir: "./editors/code", |
191 | } | 190 | } |
192 | .run()?; | 191 | .run()?; |