-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
67 lines (59 loc) · 1.49 KB
/
Taskfile.yml
File metadata and controls
67 lines (59 loc) · 1.49 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
version: '3'
vars:
PLUGIN_LIB:
sh: |
case "$(uname -s)" in
Darwin) echo "libarbiter.dylib" ;;
*) echo "libarbiter.so" ;;
esac
PLUGIN_EXT: .so
tasks:
build:
desc: Build the plugin in release mode
cmds:
- cargo build --release
- echo "Built target/release/{{.PLUGIN_LIB}}"
install:
desc: Build and install the plugin into Neovim's runtime path
deps: [build]
cmds:
- |
install_dir=""
for p in ~/.local/share/nvim ~/.config/nvim; do
if [ -d "$p" ]; then
install_dir="$p/lua"
break
fi
done
if [ -z "$install_dir" ]; then
install_dir="$HOME/.local/share/nvim/lua"
fi
mkdir -p "$install_dir"
cp target/release/{{.PLUGIN_LIB}} "$install_dir/arbiter{{.PLUGIN_EXT}}" 2>/dev/null || \
ln -sf "$PWD/target/release/{{.PLUGIN_LIB}}" "$install_dir/arbiter{{.PLUGIN_EXT}}"
echo "Installed to $install_dir/arbiter{{.PLUGIN_EXT}}"
test:
desc: Run all tests (single-threaded)
cmds:
- cargo test
env:
RUST_TEST_THREADS: "1"
lint:
desc: Run clippy with warnings as errors
cmds:
- cargo clippy -- -D warnings
fmt:
desc: Format all Rust code
cmds:
- cargo fmt
check:
desc: Format, lint, and test
cmds:
- task: fmt
- task: lint
- task: test
docs:
desc: Start the documentation site locally
dir: docs/site
cmds:
- npm start