forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.json
199 lines (196 loc) · 6.31 KB
/
tasks.json
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
{
// Note!
// Set the "chromeOutputDir" input string below, then run
// "0-set_chrome_output_directory" to set the `current_link` symbolic link
// (see below).
"version": "2.0.0",
"runner": "terminal",
// The default problem matcher matches build output, which is useful for most tasks.
"problemMatcher": [
// Matches output from clang.
{
"owner": "cpp",
"fileLocation": ["relative", "${config:chrome.outputDir}"],
"pattern": {
"regexp": "^(gen/.*):(\\d+):(\\d+):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1, "line": 2, "column": 3, "severity": 4, "message": 5
}
},
{
"owner": "cpp",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^../../(.*):(\\d+):(\\d+):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1, "line": 2, "column": 3, "severity": 4, "message": 5
}
},
// Matches output from clang-cl / msvc.
{
"owner": "cpp",
"fileLocation": [
"relative",
"${config:chrome.outputDir}"
],
"pattern": {
"regexp": "^(gen/.*)\\((\\d+),(\\d+)\\):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
{
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^../../(.*)\\((\\d+),(\\d+)\\):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
{
"owner": "cpp",
"fileLocation": ["relative", "${config:chrome.outputDir}"],
"pattern": {
"regexp": "^(gen/.*?):(.*):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1, "severity": 3, "message": 4
}
},
{
"owner": "cpp",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^../../(.*?):(.*):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1, "severity": 3, "message": 4
}
}
],
"options": {
// It's important to set the CWD to the output directory so that file paths
// are linked correctly in the terminal output.
"cwd": "${config:chrome.outputDir}"
},
"inputs": [
{
// See 'Set Chrome Output Directory'.
"type": "pickString",
"id": "chromeOutputDir",
"description": "Chrome output directory:",
// Configure this to point to all the output directories you use (as a
// relative path from ${workspaceFolder}).
"options": [
"out/Debug",
"out/Release"
]
},
{
"type": "promptString",
"id": "gtestFilter",
"description": "Filter for 4-test_current_file_with_filter",
"default": "*"
}
],
"tasks": [
// Set the Chrome output directory to be used in future task runs.
// This uses a symbolic link to remember the current output directory.
// If you want to use this, make sure chrome.outputDir is configured to
// point to the link created at ${workspaceFolder}/out/current_link.
// Alternatively:
// * If you want to be prompted for the output directory each
// time you run a command, replace
// ${config:chrome.outputDir}
// with
// ${input:chromeOutputDir}
// everywhere in this file.
//
// * If you want to have different tasks for different output directories,
// just create duplicate tasks and hard-code the output directory used.
{
"label": "0-set_chrome_output_directory",
"command": "rm -f ${workspaceFolder}/out/current_link; ln -s ${workspaceFolder}/${input:chromeOutputDir} ${workspaceFolder}/out/current_link",
"type": "shell",
// The default problem matcher doesn't make sense here, so remove it.
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}"
}
},
// Some general-purpose build and test tasks. These all inherit the
// problemMatcher at the top of the file.
{
"label": "1-build_chrome",
"type": "shell",
"command": "autoninja",
"args": ["-C", "${config:chrome.outputDir}", "chrome"],
"group": "test"
},
{
"label": "2-build_all",
"type": "shell",
"command": "autoninja",
"args": ["-C", "${config:chrome.outputDir}"]
},
{
"label": "3-test_current_file",
"type": "shell",
"command": "${workspaceFolder}/tools/autotest.py",
"args": ["-C", "${config:chrome.outputDir}", "--run-all", "${file}"]
},
{
"label": "4-test_current_file_with_filter",
"type": "shell",
"command": "${workspaceFolder}/tools/autotest.py",
"args": ["-C", "${config:chrome.outputDir}", "--gtest_filter", "${input:gtestFilter}", "${file}"]
},
{
"label": "5-test_current_line",
"type": "shell",
"command": "${workspaceFolder}/tools/autotest.py",
"args": ["-C", "${config:chrome.outputDir}", "--line", "${lineNumber}", "${file}"]
},
{
"label": "6-test_current_directory",
"type": "shell",
"command": "${workspaceFolder}/tools/autotest.py",
"args": ["-C", "${config:chrome.outputDir}", "--run-all", "${fileDirname}"]
},
{
"label": "7-build_current_file",
"type": "shell",
"command": "compile_single_file",
"args": ["--build-dir=${config:chrome.outputDir}", "--file-path=${file}"]
},
// Some more specific build tasks, which hard-code the output directory.
{
"label": "8-build_chrome_debug",
"type": "shell",
"command": "autoninja",
"args": ["-C", "${workspaceFolder}/out/Debug", "chrome"]
},
{
"label": "9-build_chrome_release",
"type": "shell",
"command": "autoninja",
"args": ["-C", "${workspaceFolder}/out/Release", "chrome"]
},
{
"label": "10-build_test_debug",
"type": "shell",
"command": "autoninja",
"args": ["-C", "${workspaceFolder}/out/Debug", "unit_tests", "components_unittests", "browser_tests", "extensions_unittests", "ash_unittests"]
},
{
"label": "11-generate_compile_commands",
"type": "shell",
"command": "${workspaceFolder}/tools/clang/scripts/generate_compdb.py",
"args": ["-p", "${config:chrome.outputDir}", ">", "${workspaceFolder}/compile_commands.json"]
}
]
}