-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
72 lines (61 loc) · 1.88 KB
/
Copy pathTaskfile.yml
File metadata and controls
72 lines (61 loc) · 1.88 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
version: "3"
vars:
SRC_FILES:
sh: find src include -name '*.cpp' -o -name '*.hpp' | tr '\n' ' '
BUILD_DIR: build
INSTALL_PREFIX: '{{.HOME}}/.local'
tasks:
build:
desc: Build cpm
cmds:
- mkdir -p {{.BUILD_DIR}}
- cd {{.BUILD_DIR}} && cmake .. -DCMAKE_BUILD_TYPE=Release
- cd {{.BUILD_DIR}} && cmake --build . -j$(nproc)
fmt:
desc: Format all source files with clang-format
cmds:
- clang-format -i {{.SRC_FILES}}
- echo "[task] Formatted all files"
fmt:check:
desc: Check formatting without modifying files
cmds:
- clang-format --dry-run --Werror {{.SRC_FILES}}
lint:
desc: Run clang-tidy linting
cmds:
- task: build
- clang-tidy {{.SRC_FILES}} -p {{.BUILD_DIR}} --fix --fix-errors
- echo "[task] Lint complete"
lint:check:
desc: Run clang-tidy without fixing
cmds:
- task: build
- clang-tidy {{.SRC_FILES}} -p {{.BUILD_DIR}}
fix:
desc: Fix formatting + lint issues + remove unused variables/imports
cmds:
- task: fmt
- task: lint
- echo "[task] All fixes applied"
install:
desc: Build and install cpm for the current user
cmds:
- task: build
- cmake --install {{.BUILD_DIR}} --prefix {{.INSTALL_PREFIX}}
- echo "[task] Installed cpm $(cpm --version 2>/dev/null || echo 'v0.2.0')"
- echo "[task] Run 'cpm --version' to verify"
uninstall:
desc: Remove the user-local cpm binary
cmds:
- rm -f {{.INSTALL_PREFIX}}/bin/cpm
- echo "[task] Removed cpm from {{.INSTALL_PREFIX}}/bin/"
clean:
desc: Remove build directory
cmds:
- rm -rf {{.BUILD_DIR}}
- echo "[task] Cleaned"
test:
desc: Run tests in testdir
dir: testdir
cmds:
- ../build/cpm run