diff options
author | Aleksey Kladov <[email protected]> | 2019-10-17 21:01:53 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-17 21:14:05 +0100 |
commit | 5376c769f0cb6076c4862e728af042bb563a5051 (patch) | |
tree | 890a88741ef83c5ca0a57006c1972d0870fd86a4 | |
parent | 7b15c4f7ae95e2e855cb783871906fa7bf364c4c (diff) |
rename tools -> xtask
-rw-r--r-- | .cargo/config | 2 | ||||
-rw-r--r-- | Cargo.lock | 7 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 2 | ||||
-rw-r--r-- | docs/dev/README.md | 10 | ||||
-rw-r--r-- | docs/dev/architecture.md | 2 | ||||
-rw-r--r-- | xtask/src/bin/pre-commit.rs | 2 | ||||
-rw-r--r-- | xtask/src/lib.rs | 2 | ||||
-rw-r--r-- | xtask/tests/tidy-tests/cli.rs (renamed from xtask/tests/cli.rs) | 6 | ||||
-rw-r--r-- | xtask/tests/tidy-tests/docs.rs (renamed from xtask/tests/docs.rs) | 2 | ||||
-rw-r--r-- | xtask/tests/tidy-tests/main.rs (renamed from xtask/tests/main.rs) | 0 |
11 files changed, 15 insertions, 22 deletions
diff --git a/.cargo/config b/.cargo/config index 67d0d1885..3812e1e2d 100644 --- a/.cargo/config +++ b/.cargo/config | |||
@@ -1,4 +1,4 @@ | |||
1 | [alias] | 1 | [alias] |
2 | xtask = "run --package xtask --bin xtask --" | 2 | xtask = "run --package xtask --bin xtask --" |
3 | 3 | ||
4 | install-ra = "run --package xtask -- install" # for backwards compat | 4 | install-ra = "run --package xtask --bin xtask -- install" # for backwards compat |
diff --git a/Cargo.lock b/Cargo.lock index d2fe8e216..ea6521333 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -1719,13 +1719,6 @@ version = "0.7.0" | |||
1719 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1719 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1720 | 1720 | ||
1721 | [[package]] | 1721 | [[package]] |
1722 | name = "website-gen" | ||
1723 | version = "0.0.0" | ||
1724 | dependencies = [ | ||
1725 | "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1726 | ] | ||
1727 | |||
1728 | [[package]] | ||
1729 | name = "winapi" | 1722 | name = "winapi" |
1730 | version = "0.2.8" | 1723 | version = "0.2.8" |
1731 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1724 | source = "registry+https://github.com/rust-lang/crates.io-index" |
diff --git a/Cargo.toml b/Cargo.toml index e8f6c4267..97c02b40f 100644 --- a/Cargo.toml +++ b/Cargo.toml | |||
@@ -1,5 +1,5 @@ | |||
1 | [workspace] | 1 | [workspace] |
2 | members = [ "crates/*", "xtask/", "website/website-gen" ] | 2 | members = [ "crates/*", "xtask/" ] |
3 | 3 | ||
4 | [profile.dev] | 4 | [profile.dev] |
5 | debug = 1 # only line info | 5 | debug = 1 # only line info |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 25e6f64ce..0a8fd0612 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -1,5 +1,5 @@ | |||
1 | // Stores definitions which must be used in multiple places | 1 | // Stores definitions which must be used in multiple places |
2 | // See `cargo gen-syntax` (defined in crates/ra_tools/src/main.rs) | 2 | // See `cargo xtask codegen` (defined in xtasks/src/main.rs) |
3 | Grammar( | 3 | Grammar( |
4 | punct: [ | 4 | punct: [ |
5 | (";", "SEMI"), | 5 | (";", "SEMI"), |
diff --git a/docs/dev/README.md b/docs/dev/README.md index 5e18e4ffe..e5a7ea5f6 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -65,8 +65,8 @@ integrating with editors. Currently, it contains plugins for VS Code (in | |||
65 | typescript) and Emacs (in elisp). The `docs` top-level directory contains both | 65 | typescript) and Emacs (in elisp). The `docs` top-level directory contains both |
66 | developer and user documentation. | 66 | developer and user documentation. |
67 | 67 | ||
68 | We have some automation infra in Rust in the `crates/tool` package. It contains | 68 | We have some automation infra in Rust in the `xtask` package. It contains |
69 | stuff like formatting checking, code generation and powers `cargo install-ra`. | 69 | stuff like formatting checking, code generation and powers `cargo xtask install`. |
70 | The latter syntax is achieved with the help of cargo aliases (see `.cargo` | 70 | The latter syntax is achieved with the help of cargo aliases (see `.cargo` |
71 | directory). | 71 | directory). |
72 | 72 | ||
@@ -84,7 +84,7 @@ However, launching a VS Code instance with locally build language server is | |||
84 | possible. There's even a VS Code task for this, so just <kbd>F5</kbd> should | 84 | possible. There's even a VS Code task for this, so just <kbd>F5</kbd> should |
85 | work (thanks, [@andrew-w-ross](https://github.com/andrew-w-ross)!). | 85 | work (thanks, [@andrew-w-ross](https://github.com/andrew-w-ross)!). |
86 | 86 | ||
87 | I often just install development version with `cargo install-ra --server --jemalloc` and | 87 | I often just install development version with `cargo xtask install --server --jemalloc` and |
88 | restart the host VS Code. | 88 | restart the host VS Code. |
89 | 89 | ||
90 | See [./debugging.md](./debugging.md) for how to attach to rust-analyzer with | 90 | See [./debugging.md](./debugging.md) for how to attach to rust-analyzer with |
@@ -116,7 +116,7 @@ Due to the requirements of running the tests inside VS Code they are **not run | |||
116 | on CI**. When making changes to the extension please ensure the tests are not | 116 | on CI**. When making changes to the extension please ensure the tests are not |
117 | broken locally before opening a Pull Request. | 117 | broken locally before opening a Pull Request. |
118 | 118 | ||
119 | To install **only** the VS Code extension, use `cargo install-ra --client-code`. | 119 | To install **only** the VS Code extension, use `cargo xtask install --client-code`. |
120 | 120 | ||
121 | # Logging | 121 | # Logging |
122 | 122 | ||
@@ -153,7 +153,7 @@ There's also two VS Code commands which might be of interest: | |||
153 | $ cargo install --path crates/ra_lsp_server --force --features jemalloc | 153 | $ cargo install --path crates/ra_lsp_server --force --features jemalloc |
154 | ``` | 154 | ``` |
155 | 155 | ||
156 | There's an alias for this: `cargo install-ra --server --jemalloc`. | 156 | There's an alias for this: `cargo xtask install --server --jemalloc`. |
157 | 157 | ||
158 | * `Rust Analyzer: Syntax Tree` shows syntax tree of the current file/selection. | 158 | * `Rust Analyzer: Syntax Tree` shows syntax tree of the current file/selection. |
159 | 159 | ||
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 28f2a37e5..5ec5352e7 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md | |||
@@ -71,7 +71,7 @@ Rust syntax tree structure and parser. See | |||
71 | This is the thing that turns a flat list of events into a tree (see `EventProcessor`) | 71 | This is the thing that turns a flat list of events into a tree (see `EventProcessor`) |
72 | - `ast` provides a type safe API on top of the raw `rowan` tree. | 72 | - `ast` provides a type safe API on top of the raw `rowan` tree. |
73 | - `grammar.ron` RON description of the grammar, which is used to | 73 | - `grammar.ron` RON description of the grammar, which is used to |
74 | generate `syntax_kinds` and `ast` modules, using `cargo gen-syntax` command. | 74 | generate `syntax_kinds` and `ast` modules, using `cargo xtask codegen` command. |
75 | - `algo`: generic tree algorithms, including `walk` for O(1) stack | 75 | - `algo`: generic tree algorithms, including `walk` for O(1) stack |
76 | space tree traversal (this is cool). | 76 | space tree traversal (this is cool). |
77 | 77 | ||
diff --git a/xtask/src/bin/pre-commit.rs b/xtask/src/bin/pre-commit.rs index 16bbf9cb2..4ee864756 100644 --- a/xtask/src/bin/pre-commit.rs +++ b/xtask/src/bin/pre-commit.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use std::process::Command; | 3 | use std::process::Command; |
4 | 4 | ||
5 | use ra_tools::{project_root, run, run_rustfmt, Overwrite, Result}; | 5 | use xtask::{project_root, run, run_rustfmt, Overwrite, Result}; |
6 | 6 | ||
7 | fn main() -> Result<()> { | 7 | fn main() -> Result<()> { |
8 | run_rustfmt(Overwrite)?; | 8 | run_rustfmt(Overwrite)?; |
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 761592e85..a8685f567 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs | |||
@@ -146,7 +146,7 @@ pub fn install_format_hook() -> Result<()> { | |||
146 | "./.git/hooks/pre-commit" | 146 | "./.git/hooks/pre-commit" |
147 | }); | 147 | }); |
148 | if !result_path.exists() { | 148 | if !result_path.exists() { |
149 | run("cargo build --package ra_tools --bin pre-commit", ".")?; | 149 | run("cargo build --package xtask --bin pre-commit", ".")?; |
150 | if cfg!(windows) { | 150 | if cfg!(windows) { |
151 | fs::copy("./target/debug/pre-commit.exe", result_path)?; | 151 | fs::copy("./target/debug/pre-commit.exe", result_path)?; |
152 | } else { | 152 | } else { |
diff --git a/xtask/tests/cli.rs b/xtask/tests/tidy-tests/cli.rs index 609fd4d8b..5d8ddea83 100644 --- a/xtask/tests/cli.rs +++ b/xtask/tests/tidy-tests/cli.rs | |||
@@ -1,17 +1,17 @@ | |||
1 | use ra_tools::{gen_tests, generate_boilerplate, project_root, run_rustfmt, Verify}; | ||
2 | use walkdir::WalkDir; | 1 | use walkdir::WalkDir; |
2 | use xtask::{gen_tests, generate_boilerplate, project_root, run_rustfmt, Verify}; | ||
3 | 3 | ||
4 | #[test] | 4 | #[test] |
5 | fn generated_grammar_is_fresh() { | 5 | fn generated_grammar_is_fresh() { |
6 | if let Err(error) = generate_boilerplate(Verify) { | 6 | if let Err(error) = generate_boilerplate(Verify) { |
7 | panic!("{}. Please update it by running `cargo gen-syntax`", error); | 7 | panic!("{}. Please update it by running `cargo xtask codegen`", error); |
8 | } | 8 | } |
9 | } | 9 | } |
10 | 10 | ||
11 | #[test] | 11 | #[test] |
12 | fn generated_tests_are_fresh() { | 12 | fn generated_tests_are_fresh() { |
13 | if let Err(error) = gen_tests(Verify) { | 13 | if let Err(error) = gen_tests(Verify) { |
14 | panic!("{}. Please update tests by running `cargo gen-tests`", error); | 14 | panic!("{}. Please update tests by running `cargo xtask gen-tests`", error); |
15 | } | 15 | } |
16 | } | 16 | } |
17 | 17 | ||
diff --git a/xtask/tests/docs.rs b/xtask/tests/tidy-tests/docs.rs index ea3330175..fe5852bc6 100644 --- a/xtask/tests/docs.rs +++ b/xtask/tests/tidy-tests/docs.rs | |||
@@ -5,7 +5,7 @@ use std::path::Path; | |||
5 | 5 | ||
6 | use walkdir::{DirEntry, WalkDir}; | 6 | use walkdir::{DirEntry, WalkDir}; |
7 | 7 | ||
8 | use ra_tools::project_root; | 8 | use xtask::project_root; |
9 | 9 | ||
10 | fn is_exclude_dir(p: &Path) -> bool { | 10 | fn is_exclude_dir(p: &Path) -> bool { |
11 | let exclude_dirs = ["tests", "test_data"]; | 11 | let exclude_dirs = ["tests", "test_data"]; |
diff --git a/xtask/tests/main.rs b/xtask/tests/tidy-tests/main.rs index 56d1318d6..56d1318d6 100644 --- a/xtask/tests/main.rs +++ b/xtask/tests/tidy-tests/main.rs | |||