-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
56 lines (46 loc) · 1.34 KB
/
Copy pathTaskfile.yml
File metadata and controls
56 lines (46 loc) · 1.34 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
version: '3'
vars:
CXX: g++
CXXFLAGS: -std=c++17 -Wall -Wextra -O2
INCLUDES: -Icpp_ml/include
BUILD_DIR: build
SRC_DIR: cpp_ml/src
tasks:
clean:
desc: Clean build artifacts
cmds:
- rm -rf {{.BUILD_DIR}}
setup:
desc: Create build directory
cmds:
- mkdir -p {{.BUILD_DIR}}
build:knn:
desc: Build KNN demo
deps: [setup]
cmds:
- "{{.CXX}} {{.CXXFLAGS}} {{.INCLUDES}} {{.SRC_DIR}}/supervised/knn.cc {{.SRC_DIR}}/utils/math_utils.cc demos/knn.cc -o {{.BUILD_DIR}}/knn"
run:knn:
desc: Run KNN demo
deps: [build:knn]
cmds:
- ./{{.BUILD_DIR}}/knn
demo:knn:
desc: Build and run KNN demo
deps: [build:knn, run:knn]
all:
desc: Build all demos
deps: [build:knn]
format:
desc: Format all C++ code with clang-format
cmds:
- find {{.SRC_DIR}} -name "*.cc" -o -name "*.h" | xargs clang-format -i
- find cpp_ml/include -name "*.h" | xargs clang-format -i
- find demos -name "*.cc" | xargs clang-format -i
format:check:
desc: Check if code is properly formatted
cmds:
- find {{.SRC_DIR}} -name "*.cc" -o -name "*.h" | xargs clang-format --dry-run --Werror
- find cpp_ml/include -name "*.h" | xargs clang-format --dry-run --Werror
- find demos -name "*.cc" | xargs clang-format --dry-run --Werror
default:
deps: [demo:knn]