-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
163 lines (143 loc) · 5.03 KB
/
Taskfile.yml
File metadata and controls
163 lines (143 loc) · 5.03 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
version: "3"
vars:
BUILD_DIR: build/debug
PROFILE: profiles/clang-21-debug
tasks:
deps:
desc: Install Conan dependencies
cmds:
- >-
conan install .
-pr {{.PROFILE}}
-pr:b {{.PROFILE}}
--build=missing
-of {{.BUILD_DIR}}
sources:
- conanfile.py
- "{{.PROFILE}}"
generates:
- "{{.BUILD_DIR}}/conan_toolchain.cmake"
configure:
desc: Configure CMake
deps: [deps]
cmds:
- cmake --preset debug
sources:
- CMakeLists.txt
- compiler/**/CMakeLists.txt
- tools/**/CMakeLists.txt
generates:
- "{{.BUILD_DIR}}/Makefile"
build:
desc: Build all targets
deps: [configure]
cmds:
- cmake --build {{.BUILD_DIR}} -- -j${DAO_BUILD_JOBS:-4}
test:
desc: Run all tests
deps: [build]
cmds:
- ctest --test-dir {{.BUILD_DIR}} --output-on-failure
playground-build:
desc: Build playground frontend assets
dir: tools/playground/frontend
cmds:
- npm ci --ignore-scripts
- npm run build
sources:
- tools/playground/frontend/src/**/*
- tools/playground/frontend/index.html
- tools/playground/frontend/package-lock.json
generates:
- tools/playground/frontend/dist/index.html
playground:
desc: Build and start the playground server (http://localhost:8090)
deps: [build, playground-build]
cmds:
- "{{.BUILD_DIR}}/tools/playground/compiler_service/dao_playground {{.CLI_ARGS}}"
playground-dev:
desc: Start playground in dev mode (Vite HMR on :5173, backend on :8090)
deps: [build]
cmds:
- cd tools/playground/frontend && npm ci --ignore-scripts
- defer: pkill -xf '{{.BUILD_DIR}}/tools/playground/compiler_service/dao_playground' 2>/dev/null || true
- |
{{.BUILD_DIR}}/tools/playground/compiler_service/dao_playground &
cd tools/playground/frontend && npx vite
bootstrap-assemble:
desc: Assemble bootstrap .gen.dao files from shared base + subsystem sources
cmds:
- bash bootstrap/assemble.sh
sources:
- bootstrap/shared/base.dao
- bootstrap/lexer/tests.dao
- bootstrap/parser/tests.dao
- bootstrap/graph/tests.dao
- bootstrap/resolver/impl.dao
- bootstrap/typecheck/impl.dao
- bootstrap/hir/impl.dao
generates:
- bootstrap/lexer/lexer.gen.dao
- bootstrap/parser/parser.gen.dao
- bootstrap/graph/graph.gen.dao
- bootstrap/resolver/resolver.gen.dao
- bootstrap/typecheck/typecheck.gen.dao
- bootstrap/hir/hir.gen.dao
bootstrap-test:
desc: Assemble, build, and test all bootstrap subsystems
deps: [build, bootstrap-assemble]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc build bootstrap/lexer/lexer.gen.dao && ./bootstrap/lexer/lexer.gen"
- "{{.BUILD_DIR}}/compiler/driver/daoc build bootstrap/parser/parser.gen.dao && ./bootstrap/parser/parser.gen"
- "{{.BUILD_DIR}}/compiler/driver/daoc build bootstrap/graph/graph.gen.dao && ./bootstrap/graph/graph.gen"
- "{{.BUILD_DIR}}/compiler/driver/daoc build bootstrap/resolver/resolver.gen.dao && ./bootstrap/resolver/resolver.gen"
- "{{.BUILD_DIR}}/compiler/driver/daoc build bootstrap/typecheck/typecheck.gen.dao && ./bootstrap/typecheck/typecheck.gen"
- "{{.BUILD_DIR}}/compiler/driver/daoc build bootstrap/hir/hir.gen.dao && ./bootstrap/hir/hir.gen"
format:
desc: Run clang-format on all source files
cmds:
- find compiler tools -name '*.cpp' -o -name '*.h' | xargs clang-format -i
format-check:
desc: Check clang-format without modifying files
cmds:
- find compiler tools -name '*.cpp' -o -name '*.h' | xargs clang-format --dry-run --Werror
lint:
desc: Run clang-tidy on all source files
deps: [configure]
cmds:
- find compiler tools -name '*.cpp' | xargs clang-tidy -p {{.BUILD_DIR}}
lex:
desc: "Run daoc lex on a file (usage: task lex -- file.dao)"
deps: [build]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc lex {{.CLI_ARGS}}"
parse:
desc: "Run daoc parse on a file (usage: task parse -- file.dao)"
deps: [build]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc parse {{.CLI_ARGS}}"
ast:
desc: "Run daoc ast on a file (usage: task ast -- file.dao)"
deps: [build]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc ast {{.CLI_ARGS}}"
tokens:
desc: "Run daoc tokens on a file (usage: task tokens -- file.dao)"
deps: [build]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc tokens {{.CLI_ARGS}}"
resolve:
desc: "Run daoc resolve on a file (usage: task resolve -- file.dao)"
deps: [build]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc resolve {{.CLI_ARGS}}"
llvm-ir:
desc: "Run daoc llvm-ir on a file (usage: task llvm-ir -- file.dao)"
deps: [build]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc llvm-ir {{.CLI_ARGS}}"
compile:
desc: "Compile a .dao file to a native executable (usage: task compile -- file.dao)"
deps: [build]
cmds:
- "{{.BUILD_DIR}}/compiler/driver/daoc build {{.CLI_ARGS}}"