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 | { |
Ben Clayton | 431ec3d | 2023-03-04 00:49:51 +0000 | [diff] [blame] | 76 | "label": "setup build", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 77 | "type": "shell", |
Ben Clayton | 431ec3d | 2023-03-04 00:49:51 +0000 | [diff] [blame] | 78 | "command": "./tools/setup-build", |
| 79 | "args": [ |
| 80 | "${input:buildSystem}", |
| 81 | "${input:buildType}", |
| 82 | "${input:buildArch}", |
| 83 | ], |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 84 | "options": { |
| 85 | "cwd": "${workspaceRoot}" |
| 86 | }, |
| 87 | "problemMatcher": [], |
| 88 | }, |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 89 | // Rebases the current branch on to origin/main and then calls |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 90 | // `gclient sync`. |
| 91 | { |
| 92 | "label": "sync", |
| 93 | "type": "shell", |
| 94 | "linux": { |
| 95 | "command": "sh", |
| 96 | "args": [ |
| 97 | "-c", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 98 | "git fetch origin && git rebase origin/main && gclient sync && echo Done" |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 99 | ], |
| 100 | }, |
| 101 | "osx": { |
| 102 | "command": "sh", |
| 103 | "args": [ |
| 104 | "-c", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 105 | "git fetch origin && git rebase origin/main && gclient sync && echo Done" |
| 106 | ], |
| 107 | }, |
| 108 | "windows": { |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 109 | "command": "/C", |
Ben Clayton | af55c04 | 2021-03-24 13:08:41 +0000 | [diff] [blame] | 110 | "args": [ |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 111 | "git fetch origin && git rebase origin/main && gclient sync && echo Done", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 112 | ], |
Ben Clayton | 9b2c17c | 2021-07-19 17:16:28 +0000 | [diff] [blame] | 113 | "options": { |
| 114 | "shell": { |
| 115 | "executable": "cmd" |
| 116 | }, |
| 117 | } |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 118 | }, |
| 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 Clayton | 1a8d078 | 2023-05-16 14:36:37 +0000 | [diff] [blame] | 128 | "command": "./tools/push-to-gerrit", |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 129 | "options": { |
| 130 | "cwd": "${workspaceRoot}" |
| 131 | }, |
| 132 | "problemMatcher": [], |
Ben Clayton | 1a8d078 | 2023-05-16 14:36:37 +0000 | [diff] [blame] | 133 | }, |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 134 | ], |
| 135 | "inputs": [ |
| 136 | { |
Ben Clayton | 431ec3d | 2023-03-04 00:49:51 +0000 | [diff] [blame] | 137 | "id": "buildSystem", |
| 138 | "type": "pickString", |
| 139 | "options": [ |
| 140 | "cmake", |
| 141 | "gn", |
| 142 | ], |
| 143 | "default": "gn", |
| 144 | "description": "The build system", |
| 145 | }, |
| 146 | { |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 147 | "id": "buildType", |
| 148 | "type": "pickString", |
| 149 | "options": [ |
| 150 | "Debug", |
| 151 | "Release", |
| 152 | ], |
| 153 | "default": "Debug", |
| 154 | "description": "The type of build", |
| 155 | }, |
Ben Clayton | 138ddcc | 2022-10-13 12:55:42 +0000 | [diff] [blame] | 156 | { |
| 157 | "id": "buildArch", |
| 158 | "type": "pickString", |
| 159 | "options": [ |
| 160 | "native", |
| 161 | "x86", |
| 162 | ], |
| 163 | "default": "native", |
| 164 | "description": "The build architecture", |
| 165 | }, |
Ben Clayton | be88f17 | 2021-03-24 10:20:01 +0000 | [diff] [blame] | 166 | ] |
Ben Clayton | feb42e5 | 2022-04-07 19:22:21 +0000 | [diff] [blame] | 167 | } |