-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathjustfile
More file actions
138 lines (102 loc) · 3.55 KB
/
Copy pathjustfile
File metadata and controls
138 lines (102 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
set shell := ["nu", "-c"]
default:
@just --list --unsorted;
build_no_default *args:
cargo build --no-default-features {{args}}
# E.g. just build_default --test modules breaking_release_migration::from_0_5_x_to_0_6_x
build_default *args:
cargo build {{args}}
build_with_optional *args:
cargo build -F tokio {{args}}
build_examples *args:
cd {{justfile_directory()}}/examples/major_upgrade; cargo build {{args}}
build_all *args:
just build_no_default {{args}};
just build_default {{args}};
just build_with_optional {{args}};
just build_examples {{args}};
test_no_default *args:
cargo test --no-default-features {{args}} -- --nocapture
test_default *args:
cargo test {{args}} -- --nocapture
test_with_optional *args:
cargo test -F tokio {{args}} -- --nocapture
test_examples *args:
cd {{justfile_directory()}}/examples/major_upgrade; cargo test {{args}} -- --nocapture
test_all *args:
just test_no_default {{args}};
just test_default {{args}};
just test_with_optional {{args}};
just test_examples {{args}};
# List all available devices
test_mobile_all_devices:
cargo dinghy all-devices
# List all available platforms
test_mobile_all_platforms:
echo $env.ANDROID_NDK_HOME; \
cargo dinghy all-platforms
[macos]
test_ios_launch_simulator device="iPhone 14":
xcrun simctl boot "{{device}}"
[macos]
test_ios_list_simulators:
xcrun simctl list
# args: E.g. "--test modules watch::watch_multithreading"
[macos]
test_ios *args:
cargo dinghy -d iphone test {{args}}
# Run iOS tests excluding doctests (for CI - avoids cargo-dinghy doctest packaging issues)
[macos]
test_ios_lib *args:
cargo dinghy -d iphone test --lib {{args}}
# List all available android emulators
test_android_list_emulators:
emulator -list-avds
# Launch android emulator
test_android_launch_emulator emulator="Pixel_3a_API_34_extension_level_7_arm64-v8a":
emulator -avd "{{emulator}}"
# List all adb devices
test_android_list_devices:
adb devices
test_android *args:
cargo dinghy -d android test {{args}}
# Run Android tests excluding doctests (for CI - avoids permission and "text file busy" issues)
test_android_lib *args:
cargo dinghy -d android test --lib {{args}}
bench_build:
cargo bench --no-run
bench bench_name:
CRITERION_DEBUG=1 cargo bench --profile release --bench {{bench_name}}; \
start ./target/criterion/report/index.html
bench_md bench_name:
cargo criterion --message-format=json --bench {{bench_name}} | save -f --raw ./benches/result.json; \
cat ./benches/result.json | criterion-table | save -f --raw ./benches/README.md
bench_r_md:
cat ./benches/result.json | criterion-table | save -f --raw ./benches/README.md
expand test_file_name="util":
rm -f {{test_file_name}}.expanded.rs; \
RUSTFLAGS="-Zmacro-backtrace" cargo expand --test {{test_file_name}} | save -f --raw src/{{test_file_name}}_expanded.rs
expand_clean:
rm -f src/*_expanded.rs
format_examples:
cd {{justfile_directory()}}/examples/major_upgrade; cargo fmt
format:
cargo clippy; \
cargo fmt --all; \
just format_examples
fmt_check_examples:
cd {{justfile_directory()}}/examples/major_upgrade; cargo fmt -- --check
fmt_check:
cargo fmt --all -- --check; \
just fmt_check_examples
clippy_check_examples:
cd {{justfile_directory()}}/examples/major_upgrade; cargo clippy -- -D warnings
clippy_check:
rustc --version; \
cargo clippy --version; \
cargo clippy -- -D warnings; \
just clippy_check_examples
# Format check
fc:
just fmt_check; \
just clippy_check