File tree Expand file tree Collapse file tree 12 files changed +84
-43
lines changed Expand file tree Collapse file tree 12 files changed +84
-43
lines changed Original file line number Diff line number Diff line change
1
+ # This Makefile.toml defines common tasks and settings used in the rustfmt project.
2
+
3
+ [env ]
4
+ CFG_RELEASE = { value = " nightly" , condition = { env_not_set = [" CFG_RELEASE" ] } }
5
+ CFG_RELEASE_CHANNEL = { value = " nightly" , condition = { env_not_set = [" CFG_RELEASE_CHANNEL" ] } }
6
+
7
+ [tasks .b ]
8
+ alias = " build"
9
+
10
+ [tasks .c ]
11
+ alias = " check"
12
+
13
+ [tasks .t ]
14
+ alias = " test"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -39,13 +39,15 @@ jobs:
39
39
override : true
40
40
profile : minimal
41
41
default : true
42
+
43
+ - name : cargo-make
44
+ run : cargo install --force cargo-make
45
+
42
46
- name : build
43
47
run : |
44
48
rustc -Vv
45
49
cargo -V
46
- cargo build --manifest-path rustfmt-core/Cargo.toml --workspace
50
+ cargo make build
47
51
48
52
- name : test
49
- run : cargo test-all
50
- - name : test ignored
51
- run : cargo test-all -- --ignored
53
+ run : cargo make test
Original file line number Diff line number Diff line change @@ -32,13 +32,15 @@ jobs:
32
32
override : true
33
33
profile : minimal
34
34
default : true
35
+
36
+ - name : cargo-make
37
+ run : cargo install --force cargo-make
38
+
35
39
- name : build
36
40
run : |
37
41
rustc -Vv
38
42
cargo -V
39
- cargo build --manifest-path rustfmt-core/Cargo.toml --workspace
43
+ cargo make build
40
44
41
45
- name : test
42
- run : cargo test-all
43
- - name : test ignored
44
- run : cargo test-all -- --ignored
46
+ run : cargo make test
Original file line number Diff line number Diff line change @@ -82,16 +82,17 @@ jobs:
82
82
override : true
83
83
profile : minimal
84
84
default : true
85
+
86
+ - name : cargo-make
87
+ run : cargo install --force cargo-make
88
+
85
89
- name : build
86
90
run : |
87
91
rustc -Vv
88
92
cargo -V
89
- cargo build --manifest-path rustfmt-core/Cargo.toml --workspace
93
+ cargo make build
90
94
shell : cmd
91
95
92
96
- name : test
93
- run : cargo test-all
94
- shell : cmd
95
- - name : test ignored
96
- run : cargo test-all -- --ignored
97
+ run : cargo make test
97
98
shell : cmd
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ matrix:
45
45
46
46
script :
47
47
- |
48
- export CFG_RELEASE_CHANNEL=nightly
49
- export CFG_RELEASE=nightly
48
+ export CFG_RELEASE_CHANNEL=nightly
49
+ export CFG_RELEASE=nightly
50
50
if [ -z ${INTEGRATION} ]; then
51
51
cargo build && cargo test && cargo test -- --ignored && cargo test --manifest-path rustfmt-core/Cargo.toml && cargo test --manifest-path rustfmt-core/Cargo.toml -- --ignored
52
52
else
Original file line number Diff line number Diff line change
1
+ extend = " .cargo/Makefile.toml"
2
+
3
+ [tasks .build ]
4
+ clear = true
5
+ command = " cargo"
6
+ args = [
7
+ " build" ,
8
+ " --manifest-path" ,
9
+ " rustfmt-core/Cargo.toml" ,
10
+ " --workspace" ,
11
+ ]
12
+
13
+ [tasks .install ]
14
+ command = " cargo"
15
+ args = [
16
+ " install" ,
17
+ " --path" ,
18
+ " ." ,
19
+ " --force" ,
20
+ " --locked" ,
21
+ ]
22
+
23
+ [tasks .test ]
24
+ clear = true
25
+ run_task = { name = [" test-bin" , " test-lib" ] }
26
+
27
+ [tasks .test-bin ]
28
+ env = { "RUSTFMT_MAKE_MANIFEST_PATH" = " rustfmt-core/rustfmt-bin/Cargo.toml" }
29
+ run_task = " test-subproject"
30
+
31
+ [tasks .test-lib ]
32
+ env = { "RUSTFMT_MAKE_MANIFEST_PATH" = " rustfmt-core/rustfmt-lib/Cargo.toml" }
33
+ run_task = " test-subproject"
34
+
35
+ [tasks .test-subproject ]
36
+ condition = { env_set = [" RUSTFMT_MAKE_MANIFEST_PATH" ] }
37
+ script_runner = " @shell"
38
+ script = [
39
+ " cargo test --manifest-path ${RUSTFMT_MAKE_MANIFEST_PATH}" ,
40
+ " cargo test --manifest-path ${RUSTFMT_MAKE_MANIFEST_PATH} -- --ignored" ,
41
+ ]
Original file line number Diff line number Diff line change 4
4
5
5
: ${INTEGRATION?" The INTEGRATION environment variable must be set." }
6
6
7
- # FIXME: this means we can get a stale cargo-fmt from a previous run.
8
- #
9
- # `which rustfmt` fails if rustfmt is not found. Since we don't install
10
- # `rustfmt` via `rustup`, this is the case unless we manually install it. Once
11
- # that happens, `cargo install --force` will be called, which installs
12
- # `rustfmt`, `cargo-fmt`, etc to `~/.cargo/bin`. This directory is cached by
13
- # travis (see `.travis.yml`'s "cache" key), such that build-bots that arrive
14
- # here after the first installation will find `rustfmt` and won't need to build
15
- # it again.
16
- #
17
- # which cargo-fmt || cargo install --force
18
-
19
- export CFG_RELEASE_CHANNEL=nightly
20
- export CFG_RELEASE=nightly
21
-
22
- cargo install --path . --force --locked
7
+ which cargo-make || cargo install --force cargo-make
8
+ cargo make install
23
9
24
10
echo " Integration tests for: ${INTEGRATION} "
25
11
cargo fmt -- --version
Original file line number Diff line number Diff line change
1
+ extend = { path = " ../.cargo/Makefile.toml" }
2
+
3
+ [env ]
4
+ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = " true"
Original file line number Diff line number Diff line change
1
+ extend = { path = " ../Makefile.toml" }
Original file line number Diff line number Diff line change
1
+ extend = { path = " ../Makefile.toml" }
Original file line number Diff line number Diff line change
1
+ extend = { path = " ../Makefile.toml" }
You can’t perform that action at this time.
0 commit comments