-
Notifications
You must be signed in to change notification settings - Fork 134
/
justfile
81 lines (68 loc) · 4.2 KB
/
justfile
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
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
# Build the release binaries for Linux and put the binaries+cfg in the output directory
build_release_linux output_dir:
cargo build --release
cp target/release/kanata "{{output_dir}}/kanata"
strip "{{output_dir}}/kanata"
cargo build --release --features cmd
cp target/release/kanata "{{output_dir}}/kanata_cmd_allowed"
strip "{{output_dir}}/kanata_cmd_allowed"
cp cfg_samples/kanata.kbd "{{output_dir}}"
# Build the release binaries for Windows and put the binaries+cfg in the output directory.
build_release_windows output_dir:
cargo build --release --no-default-features --features tcp_server,win_manifest; cp target/release/kanata.exe "{{output_dir}}\kanata_legacy_output.exe"
cargo build --release --features win_manifest,interception_driver; cp target/release/kanata.exe "{{output_dir}}\kanata_wintercept.exe"
cargo build --release --features win_manifest,win_sendinput_send_scancodes; cp target/release/kanata.exe "{{output_dir}}\kanata.exe"
cargo build --release --features win_manifest,win_sendinput_send_scancodes,win_llhook_read_scancodes; cp target/release/kanata.exe "{{output_dir}}\kanata_winIOv2.exe"
cargo build --release --features win_manifest,cmd,win_sendinput_send_scancodes; cp target/release/kanata.exe "{{output_dir}}\kanata_cmd_allowed.exe"
cargo build --release --features win_manifest,cmd,interception_driver; cp target/release/kanata.exe "{{output_dir}}\kanata_wintercept_cmd_allowed.exe"
cargo build --release --features passthru_ahk --package=simulated_passthru; cp target/release/kanata_passthru.dll "{{output_dir}}\kanata_passthru.dll"
cargo build --release --features win_manifest,gui ; cp target/release/kanata.exe "{{output_dir}}\kanata_gui.exe"
cargo build --release --features win_manifest,gui,cmd; cp target/release/kanata.exe "{{output_dir}}\kanata_gui_cmd_allowed.exe"
cargo build --release --features win_manifest,gui,interception_driver ; cp target/release/kanata.exe "{{output_dir}}\kanata_gui_wintercept.exe"
cargo build --release --features win_manifest,gui,cmd,interception_driver; cp target/release/kanata.exe "{{output_dir}}\kanata_gui_wintercept_cmd_allowed.exe"
cp cfg_samples/kanata.kbd "{{output_dir}}"
# Generate the sha256sums for all files in the output directory
sha256sums output_dir:
rm -f {{output_dir}}/sha256sums
cd {{output_dir}}; sha256sum * > sha256sums
test:
cargo test -p kanata -p kanata-parser -p kanata-keyberon -- --nocapture
cargo test --features=simulated_output sim_tests
cargo clippy --all
fmt:
cargo fmt --all
guic:
cargo check --features=gui
guif:
cargo fmt --all
cargo clippy --all --fix --features=gui -- -D warnings
ahkc:
cargo check --features=passthru_ahk
ahkf:
cargo fmt --all
cargo clippy --all --fix --features=passthru_ahk -- -D warnings
use_cratesio_deps:
sed -i 's/^# \(kanata-\(keyberon\|parser\|tcp-protocol\) = ".*\)$/\1/' Cargo.toml parser/Cargo.toml
sed -i 's/^\(kanata-\(keyberon\|parser\|tcp-protocol\) = .*path.*\)$/# \1/' Cargo.toml parser/Cargo.toml
use_local_deps:
sed -i 's/^\(kanata-\(keyberon\|parser\|tcp-protocol\) = ".*\)$/# \1/' Cargo.toml parser/Cargo.toml
sed -i 's/^# \(kanata-\(keyberon\|parser\|tcp-protocol\) = .*path.*\)$/\1/' Cargo.toml parser/Cargo.toml
change_subcrate_versions version:
sed -i 's/^version = ".*"$/version = "{{version}}"/' parser/Cargo.toml tcp_protocol/Cargo.toml keyberon/Cargo.toml
sed -i 's/^\(#\? \?kanata-\(keyberon\|parser\|tcp-protocol\)\) = ".*$/\1 = "{{version}}"/' Cargo.toml parser/Cargo.toml
cov:
cargo llvm-cov clean --workspace
cargo llvm-cov --no-report --workspace --no-default-features
cargo llvm-cov --no-report --workspace
cargo llvm-cov --no-report --workspace --features=cmd,win_llhook_read_scancodes,win_sendinput_send_scancodes
cargo llvm-cov --no-report --workspace --features=cmd,interception_driver,win_sendinput_send_scancodes
cargo llvm-cov --no-report --features=simulated_output -- sim_tests
cargo llvm-cov report --html
publish:
cd keyberon && cargo publish
cd tcp_protocol && cargo publish
cd parser && cargo publish
cfg_to_html output_dir:
cd docs ; asciidoctor config.adoc
cd docs ; mv config.html "{{output_dir}}config.html"