blob: acd0666dcc32e72563994f19085d9bc0417e665b [file] [log] [blame]
Ben Claytonbe88f172021-03-24 10:20:01 +00001{
2 // See https://go.microsoft.com/fwlink/?LinkId=733558
3 // for the documentation about the tasks.json format
4 // Available variables which can be used inside of strings.
5 // ${workspaceRoot}: the root folder of the team
6 // ${file}: the current opened file
7 // ${fileBasename}: the current opened file's basename
8 // ${fileDirname}: the current opened file's dirname
9 // ${fileExtname}: the current opened file's extension
10 // ${cwd}: the current working directory of the spawned process
11 "version": "2.0.0",
12 "tasks": [
13 // Invokes ninja in the 'out/active' directory, which is created with
14 // the 'gn gen' task (see below).
15 {
16 "label": "build",
17 "group": {
18 "kind": "build",
19 "isDefault": true
20 },
21 "type": "shell",
22 "linux": {
23 "command": "sh",
24 "args": [
25 "-c",
26 "ninja && echo Done"
27 ],
28 },
29 "osx": {
30 "command": "sh",
31 "args": [
32 "-c",
33 "ninja && echo Done"
34 ],
35 },
Ben Claytonaf55c042021-03-24 13:08:41 +000036 "windows": {
Ben Clayton9b2c17c2021-07-19 17:16:28 +000037 "command": "/C",
Ben Claytonaf55c042021-03-24 13:08:41 +000038 "args": [
Ben Clayton9b2c17c2021-07-19 17:16:28 +000039 "ninja && echo Done",
Ben Claytonaf55c042021-03-24 13:08:41 +000040 ],
Ben Clayton9b2c17c2021-07-19 17:16:28 +000041 "options": {
42 "shell": {
43 "executable": "cmd"
44 },
45 }
Ben Claytonaf55c042021-03-24 13:08:41 +000046 },
Ben Claytonbe88f172021-03-24 10:20:01 +000047 "options": {
48 "cwd": "${workspaceRoot}/out/active",
49 },
50 "presentation": {
51 "echo": false,
52 "reveal": "always",
53 "focus": false,
54 "panel": "shared",
55 "showReuseMessage": false,
56 "clear": true,
57 },
58 "problemMatcher": {
59 "owner": "cpp",
60 "fileLocation": "absolute",
61 "pattern": {
62 "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
63 "file": 1,
64 "line": 2,
65 "column": 3,
66 "severity": 4,
67 "message": 5
68 }
69 }
70 },
71 // Generates a GN build directory at 'out/<build-type>' with the
72 // is_debug argument set to to true iff the build-type is Debug.
73 // A symbolic link to this build directory is created at 'out/active'
74 // which is used to track the active build directory.
75 {
Ben Clayton431ec3d2023-03-04 00:49:51 +000076 "label": "setup build",
Ben Claytonbe88f172021-03-24 10:20:01 +000077 "type": "shell",
Ben Clayton431ec3d2023-03-04 00:49:51 +000078 "command": "./tools/setup-build",
79 "args": [
80 "${input:buildSystem}",
81 "${input:buildType}",
82 "${input:buildArch}",
83 ],
Ben Claytonfeb42e52022-04-07 19:22:21 +000084 "options": {
85 "cwd": "${workspaceRoot}"
86 },
87 "problemMatcher": [],
88 },
Ben Claytonaf55c042021-03-24 13:08:41 +000089 // Rebases the current branch on to origin/main and then calls
Ben Claytonbe88f172021-03-24 10:20:01 +000090 // `gclient sync`.
91 {
92 "label": "sync",
93 "type": "shell",
94 "linux": {
95 "command": "sh",
96 "args": [
97 "-c",
Ben Claytonaf55c042021-03-24 13:08:41 +000098 "git fetch origin && git rebase origin/main && gclient sync && echo Done"
Ben Claytonbe88f172021-03-24 10:20:01 +000099 ],
100 },
101 "osx": {
102 "command": "sh",
103 "args": [
104 "-c",
Ben Claytonaf55c042021-03-24 13:08:41 +0000105 "git fetch origin && git rebase origin/main && gclient sync && echo Done"
106 ],
107 },
108 "windows": {
Ben Clayton9b2c17c2021-07-19 17:16:28 +0000109 "command": "/C",
Ben Claytonaf55c042021-03-24 13:08:41 +0000110 "args": [
Ben Clayton9b2c17c2021-07-19 17:16:28 +0000111 "git fetch origin && git rebase origin/main && gclient sync && echo Done",
Ben Claytonbe88f172021-03-24 10:20:01 +0000112 ],
Ben Clayton9b2c17c2021-07-19 17:16:28 +0000113 "options": {
114 "shell": {
115 "executable": "cmd"
116 },
117 }
Ben Claytonbe88f172021-03-24 10:20:01 +0000118 },
119 "options": {
120 "cwd": "${workspaceRoot}"
121 },
122 "problemMatcher": [],
123 },
124 // Pushes the changes at HEAD to gerrit for review
125 {
126 "label": "push",
127 "type": "shell",
Ben Clayton1a8d0782023-05-16 14:36:37 +0000128 "command": "./tools/push-to-gerrit",
Ben Claytonbe88f172021-03-24 10:20:01 +0000129 "options": {
130 "cwd": "${workspaceRoot}"
131 },
132 "problemMatcher": [],
Ben Clayton1a8d0782023-05-16 14:36:37 +0000133 },
Ben Claytonbe88f172021-03-24 10:20:01 +0000134 ],
135 "inputs": [
136 {
Ben Clayton431ec3d2023-03-04 00:49:51 +0000137 "id": "buildSystem",
138 "type": "pickString",
139 "options": [
140 "cmake",
141 "gn",
142 ],
143 "default": "gn",
144 "description": "The build system",
145 },
146 {
Ben Claytonbe88f172021-03-24 10:20:01 +0000147 "id": "buildType",
148 "type": "pickString",
149 "options": [
150 "Debug",
151 "Release",
152 ],
153 "default": "Debug",
154 "description": "The type of build",
155 },
Ben Clayton138ddcc2022-10-13 12:55:42 +0000156 {
157 "id": "buildArch",
158 "type": "pickString",
159 "options": [
160 "native",
161 "x86",
162 ],
163 "default": "native",
164 "description": "The build architecture",
165 },
Ben Claytonbe88f172021-03-24 10:20:01 +0000166 ]
Ben Claytonfeb42e52022-04-07 19:22:21 +0000167}