Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 1 | { |
| 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 Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 36 | "windows": { |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 37 | "command": "/C", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 38 | "args": [ |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 39 | "ninja && echo Done", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 40 | ], |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 41 | "options": { |
| 42 | "shell": { |
| 43 | "executable": "cmd" |
| 44 | }, |
| 45 | } |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 46 | }, |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 47 | "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 | { |
| 76 | "label": "gn gen", |
| 77 | "type": "shell", |
| 78 | "linux": { |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 79 | "command": "./tools/setup-build", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 80 | "args": [ |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 81 | "gn", |
| 82 | "${input:buildType}", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 83 | ], |
| 84 | }, |
| 85 | "osx": { |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 86 | "command": "./tools/setup-build", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 87 | "args": [ |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 88 | "gn", |
| 89 | "${input:buildType}", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 90 | ], |
| 91 | }, |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 92 | "windows": { |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 93 | "command": "/C", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 94 | "args": [ |
Ben Clayton | f50c22b | 2021-07-21 14:07:49 +0000 | [diff] [blame] | 95 | "(IF \"${input:buildType}\" == \"Debug\" ( gn gen \"out\\${input:buildType}\" --args=is_debug=true ) ELSE ( gn gen \"out\\${input:buildType}\" --args=is_debug=false )) && (IF EXIST \"out\\active\" rmdir \"out\\active\" /q /s) && (mklink /j \"out\\active\" \"out\\${input:buildType}\")", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 96 | ], |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 97 | "options": { |
| 98 | "shell": { |
| 99 | "executable": "cmd" |
| 100 | }, |
| 101 | } |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 102 | }, |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 103 | "options": { |
| 104 | "cwd": "${workspaceRoot}" |
| 105 | }, |
| 106 | "problemMatcher": [], |
| 107 | }, |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 108 | { |
| 109 | "label": "cmake gen", |
| 110 | "type": "shell", |
| 111 | "linux": { |
| 112 | "command": "./tools/setup-build", |
| 113 | "args": [ |
| 114 | "cmake", |
| 115 | "${input:buildType}", |
| 116 | ], |
| 117 | }, |
| 118 | "osx": { |
| 119 | "command": "./tools/setup-build", |
| 120 | "args": [ |
| 121 | "cmake", |
| 122 | "${input:buildType}", |
| 123 | ], |
| 124 | }, |
| 125 | "windows": { |
| 126 | "command": "/C", |
| 127 | "args": [ |
| 128 | "echo TODO", |
| 129 | ], |
| 130 | "options": { |
| 131 | "shell": { |
| 132 | "executable": "cmd" |
| 133 | }, |
| 134 | } |
| 135 | }, |
| 136 | "options": { |
| 137 | "cwd": "${workspaceRoot}" |
| 138 | }, |
| 139 | "problemMatcher": [], |
| 140 | }, |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 141 | // Rebases the current branch on to origin/main and then calls |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 142 | // `gclient sync`. |
| 143 | { |
| 144 | "label": "sync", |
| 145 | "type": "shell", |
| 146 | "linux": { |
| 147 | "command": "sh", |
| 148 | "args": [ |
| 149 | "-c", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 150 | "git fetch origin && git rebase origin/main && gclient sync && echo Done" |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 151 | ], |
| 152 | }, |
| 153 | "osx": { |
| 154 | "command": "sh", |
| 155 | "args": [ |
| 156 | "-c", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 157 | "git fetch origin && git rebase origin/main && gclient sync && echo Done" |
| 158 | ], |
| 159 | }, |
| 160 | "windows": { |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 161 | "command": "/C", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 162 | "args": [ |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 163 | "git fetch origin && git rebase origin/main && gclient sync && echo Done", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 164 | ], |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 165 | "options": { |
| 166 | "shell": { |
| 167 | "executable": "cmd" |
| 168 | }, |
| 169 | } |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 170 | }, |
| 171 | "options": { |
| 172 | "cwd": "${workspaceRoot}" |
| 173 | }, |
| 174 | "problemMatcher": [], |
| 175 | }, |
| 176 | // Pushes the changes at HEAD to gerrit for review |
| 177 | { |
| 178 | "label": "push", |
| 179 | "type": "shell", |
| 180 | "command": "git", |
| 181 | "args": [ |
| 182 | "push", |
| 183 | "origin", |
| 184 | "HEAD:refs/for/main" |
| 185 | ], |
| 186 | "options": { |
| 187 | "cwd": "${workspaceRoot}" |
| 188 | }, |
| 189 | "problemMatcher": [], |
| 190 | } |
| 191 | ], |
| 192 | "inputs": [ |
| 193 | { |
| 194 | "id": "buildType", |
| 195 | "type": "pickString", |
| 196 | "options": [ |
| 197 | "Debug", |
| 198 | "Release", |
| 199 | ], |
| 200 | "default": "Debug", |
| 201 | "description": "The type of build", |
| 202 | }, |
| 203 | ] |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 204 | } |