MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _generate_tasks

Method _generate_tasks

tools/ng/generator.py:158–190  ·  view source on GitHub ↗

Generate tasks.json.

(self, vscode_dir: str, context)

Source from the content-addressed store, hash-verified

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."""

Callers 1

generateMethod · 0.95

Calls 3

openFunction · 0.50
joinMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected