Generate tasks.json.
(self, vscode_dir: str, context)
| 156 | json.dump(config, f, indent=4) |
| 157 | |
| 158 | def _generate_tasks(self, vscode_dir: str, context) -> None: |
| 159 | """Generate tasks.json.""" |
| 160 | tasks = { |
| 161 | "version": "2.0.0", |
| 162 | "tasks": [ |
| 163 | { |
| 164 | "label": "build", |
| 165 | "type": "shell", |
| 166 | "command": "scons", |
| 167 | "problemMatcher": "$gcc", |
| 168 | "group": { |
| 169 | "kind": "build", |
| 170 | "isDefault": True |
| 171 | } |
| 172 | }, |
| 173 | { |
| 174 | "label": "clean", |
| 175 | "type": "shell", |
| 176 | "command": "scons -c", |
| 177 | "problemMatcher": "$gcc" |
| 178 | }, |
| 179 | { |
| 180 | "label": "rebuild", |
| 181 | "type": "shell", |
| 182 | "command": "scons -c && scons", |
| 183 | "problemMatcher": "$gcc" |
| 184 | } |
| 185 | ] |
| 186 | } |
| 187 | |
| 188 | output_path = os.path.join(vscode_dir, 'tasks.json') |
| 189 | with open(output_path, 'w') as f: |
| 190 | json.dump(tasks, f, indent=4) |
| 191 | |
| 192 | def _generate_launch(self, vscode_dir: str, context) -> None: |
| 193 | """Generate launch.json.""" |