Skip to content
File

Blob: .vscode/tasks.json

json286 lines
1{
2 "version": "2.0.0",
3 "tasks": [
4 {
5 "label": "Bazel build all (dbg)",
6 "type": "shell",
7 "command": "bazel",
8 "args": ["build", "-c", "dbg", "//..."],
9 "osx": {
10 // OS X needs to set the bazel `spawn_strategy` option to `local` for symbols to work
11 // correctly (https://github.com/bazelbuild/bazel/issues/6327). This `spawn_strategy`
12 // precludes the use of sandboxing during the build (see
13 // https://bazel.build/docs/user-manual#execution-strategy).
14 "args": ["build", "-c", "dbg", "--spawn_strategy=local", "//..."]
15 },
16 "group": {
17 "kind": "build",
18 "isDefault": true
19 },
20 "problemMatcher": "$gcc",
21 "presentation": {
22 "echo": true,
23 "reveal": "always",
24 "focus": false,
25 "panel": "shared",
26 "showReuseMessage": false,
27 "clear": false
28 }
29 },
30 {
31 "label": "Bazel build workerd (dbg)",
32 "type": "shell",
33 "command": "bazel",
34 "args": ["build", "-c", "dbg", "//src/workerd/server:workerd"],
35 "osx": {
36 // OS X needs to set the bazel `spawn_strategy` option to `local` for symbols to work
37 // correctly (https://github.com/bazelbuild/bazel/issues/6327). This `spawn_strategy`
38 // precludes the use of sandboxing during the build (see
39 // https://bazel.build/docs/user-manual#execution-strategy).
40 "args": [
41 "build",
42 "-c",
43 "dbg",
44 "--spawn_strategy=local",
45 "//src/workerd/server:workerd"
46 ]
47 },
48 "group": {
49 "kind": "build",
50 "isDefault": true
51 },
52 "problemMatcher": "$gcc",
53 "presentation": {
54 "echo": true,
55 "reveal": "always",
56 "focus": false,
57 "panel": "shared",
58 "showReuseMessage": false,
59 "clear": false
60 }
61 },
62 {
63 "label": "Bazel build workerd (fastbuild)",
64 "type": "shell",
65 "command": "bazel",
66 "args": ["build", "-c", "fastbuild", "//src/workerd/server:workerd"],
67 "group": {
68 "kind": "build",
69 "isDefault": true
70 },
71 "problemMatcher": "$gcc",
72 "presentation": {
73 "echo": true,
74 "reveal": "always",
75 "focus": false,
76 "panel": "shared",
77 "showReuseMessage": false,
78 "clear": false
79 }
80 },
81 {
82 "label": "Bazel build workerd (opt)",
83 "type": "shell",
84 "command": "bazel",
85 "args": ["build", "-c", "opt", "//src/workerd/server:workerd"],
86 // To enable debug symbols for an optimized build, add the following args for bazel:
87 // "--strategy=local", "--copt='-g'", "--host_copt='-g'", "--strip=never"
88 "group": {
89 "kind": "build",
90 "isDefault": false
91 },
92 "problemMatcher": "$gcc",
93 "presentation": {
94 "echo": true,
95 "reveal": "always",
96 "focus": false,
97 "panel": "shared",
98 "showReuseMessage": false,
99 "clear": false
100 }
101 },
102 {
103 "label": "Bazel clean",
104 "type": "shell",
105 "command": "bazel",
106 "args": ["clean"],
107 "group": {
108 "kind": "build",
109 "isDefault": true
110 },
111 "presentation": {
112 "echo": true,
113 "reveal": "always",
114 "focus": false,
115 "panel": "shared",
116 "showReuseMessage": false,
117 "clear": false
118 }
119 },
120 {
121 "label": "Bazel clean --expunge",
122 "type": "shell",
123 "command": "bazel",
124 "args": ["clean", "--expunge"],
125 "group": {
126 "kind": "build",
127 "isDefault": true
128 },
129 "presentation": {
130 "echo": true,
131 "reveal": "always",
132 "focus": false,
133 "panel": "shared",
134 "showReuseMessage": false,
135 "clear": false
136 }
137 },
138 {
139 "label": "Bazel run all tests (dbg)",
140 "type": "shell",
141 "command": "bazel",
142 "args": ["test", "-c", "dbg", "--nocache_test_results", "//..."],
143 "group": {
144 "kind": "test",
145 "isDefault": true
146 },
147 "problemMatcher": "$gcc",
148 "presentation": {
149 "echo": true,
150 "reveal": "always",
151 "focus": false,
152 "panel": "shared",
153 "showReuseMessage": false,
154 "clear": false
155 }
156 },
157 {
158 "label": "Bazel run all tests (fastbuild)",
159 "type": "shell",
160 "command": "bazel",
161 "args": ["test", "-c", "fastbuild", "--nocache_test_results", "//..."],
162 "group": {
163 "kind": "test",
164 "isDefault": true
165 },
166 "problemMatcher": "$gcc",
167 "presentation": {
168 "echo": true,
169 "reveal": "always",
170 "focus": false,
171 "panel": "shared",
172 "showReuseMessage": false,
173 "clear": false
174 }
175 },
176 {
177 "label": "Bazel run all tests (opt)",
178 "type": "shell",
179 "command": "bazel",
180 "args": ["test", "-c", "opt", "--nocache_test_results", "//..."],
181 "group": {
182 "kind": "test",
183 "isDefault": true
184 },
185 "problemMatcher": "$gcc",
186 "presentation": {
187 "echo": true,
188 "reveal": "always",
189 "focus": false,
190 "panel": "shared",
191 "showReuseMessage": false,
192 "clear": false
193 }
194 },
195 {
196 "label": "Generate rust-project.json",
197 "command": "bazel",
198 "args": ["run", "@rules_rust//tools/rust_analyzer:gen_rust_project"],
199 "options": {
200 "cwd": "${workspaceFolder}"
201 },
202 "group": "build",
203 "problemMatcher": [],
204 "presentation": {
205 "reveal": "never",
206 "panel": "dedicated"
207 },
208 "runOptions": {
209 "runOn": "default"
210 }
211 },
212 {
213 // Create ${workspaceFolder}/external for clangd on opening VSCode.
214 "label": "Symlink external directory",
215 "command": "${workspaceFolder}/tools/unix/create-external.sh",
216 "windows": {
217 "command": "${workspaceFolder}/tools/windows/create-external.bat"
218 },
219 "group": "build",
220 "problemMatcher": [],
221 "presentation": {
222 "reveal": "never",
223 "panel": "dedicated"
224 },
225 "runOptions": {
226 "reevaluateOnRerun": false,
227 "runOn": "folderOpen"
228 }
229 },
230 {
231 "label": "Prepare wd-test TEST_TMPDIR",
232 "detail": "Ensures a tmp directory for a wd-test exists and is empty.",
233 "command": "/bin/sh",
234 "args": [
235 "-c",
236 "'rm -rf ${workspaceFolder}/bazel-out/test_tmpdir; mkdir ${workspaceFolder}/bazel-out/test_tmpdir'"
237 ],
238 "windows": {
239 "args": [
240 "/c",
241 "'del /q/s ${workspaceFolder}/bazel-out/test_tmpdir & mkdir ${workspaceFolder}/bazel-out/test_tmpdir'"
242 ]
243 },
244 "hide": true,
245 "type": "shell",
246 "runOptions": {
247 "reevaluateOnRerun": true
248 }
249 },
250 {
251 "label": "Prepare workerd wd-test (dbg)",
252 "dependsOn": ["Bazel build workerd (dbg)", "Prepare wd-test TEST_TMPDIR"],
253 "dependsOrder": "sequence",
254 "group": "build",
255 "detail": "Builds a debug workerd and prepares a test directory for wd-test",
256 "hide": false,
257 "runOptions": {
258 "reevaluateOnRerun": true
259 }
260 },
261 {
262 "label": "Generate doxygen",
263 "command": "doxygen",
264 "args": ["doxyfile"],
265 "hide": false,
266 "type": "shell",
267 "problemMatcher": []
268 },
269 {
270 "label": "Format all",
271 "command": "python3",
272 "args": ["${workspaceFolder}/tools/cross/format.py"],
273 "group": "build",
274 "problemMatcher": [],
275 "presentation": {
276 "reveal": "never",
277 "focus": false,
278 "panel": "shared"
279 },
280 "runOptions": {
281 "reevaluateOnRerun": true
282 }
283 }
284 ]
285}