3.1.41. waf_tools.vscode
VS Code workspace generation tool for the Waf build system.
This waf tool automates the generation and configuration of Visual Studio Code
workspace files (https://code.visualstudio.com/) for the foxBMS project.
It produces IDE configuration files (c_cpp_properties.json,
settings.json, tasks.json, launch.json) tailored to the active
build variant so that IntelliSense, build tasks, and debugging
work out of the box.
The tool supports multiple workspace variants, each targeting a different build configuration:
generic - General-purpose workspace for the foxBMS repository.
cli - Command-line-focused workspace.
app_ti_arm_cgt - Embedded application compiled with TI ARM CGT.
bootloader_ti_arm_cgt - Bootloader compiled with TI ARM CGT.
app_unit_test_gcc - Application unit tests compiled with GCC.
bootloader_unit_test_gcc - Bootloader unit tests compiled with GCC.
For each variant the tool resolves compiler built-in defines, include
paths (including dynamic paths derived from the project configuration),
and use dependency chains, then merges this information into the
corresponding VS Code JSON configuration files. Template JSON files are
read from tools/ide/vscode/<target>/ and patched in place.
3.1.41.1. Usage
Load the tool during
configure:def configure(ctx): ctx.load("vscode", tooldir=TOOLDIR)
The
configurestep locates thecodeexecutable, determines the platform-specific shell wrapper (pwshon Windows,bashon Linux), and findsgcc/gdbfor IntelliSense and debugging.Run the
vscodecommand to generate all workspaces at once:waf vscode
Or generate individual workspaces:
waf vscode_app_ti_arm_cgt waf vscode_app_unit_test_gcc
Declare a task generator with the
vscodefeature in a build script:def build(bld): bld( features="vscode", target=<VS Code workspace variant>, vscode_dir=<Path to VS Code entry point as Node>, environment=<Waf build environment>, use_compiler_defines=<True/False>, use_dynamic_includes=<True/False>, include_dirs=<include paths>, # e.g. ["src/app", "src/os"] glob_patterns=<include glob patterns>, # e.g. ["src/app/**/"] glob_patterns_excl=<exclude glob patterns>, use_compiler_includes=<True/False>, pylint=<True/False>, python_extra_paths=<True/False>, files_exclude={<glob_pattern>: <True/False>} # e.g. {".vscode/**": True} build_tasks=<True/False>, defines=<extra defines>, )
3.1.41.2. Dependencies
VS Code (
codeexecutable, optional)GCC (used as dummy
compilerPathfor IntelliSense)GDB (used for debug configurations in
launch.json)Platform shell:
pwsh(Windows) orbash(Linux)TI ARM CGT or GCC compiler configured in the respective build environment (for compiler built-in defines extraction)
Functions
|
Patch |
|
Patch |
|
Patch |
|
Patch |
|
Entry point that chains all VS Code workspace generation commands. |
Generate the embedded app VS Code workspace configuration. |
|
Generate the app unit test VS Code workspace configuration. |
|
Generate the embedded bootloader VS Code workspace configuration. |
|
Generate the bootloader unit test VS Code workspace configuration. |
|
|
Generate the CLI VS Code workspace configuration. |
|
Generate the generic VS Code workspace configuration. |
|
Configure the waf build system for VS Code workspace generation. |
|
Serialize a dictionary as pretty-printed JSON and write it to a node. |
|
Locate the VS Code |
Extract compiler built-in defines for the active toolchain. |
|
|
Assemble dynamic include paths based on the project configuration. |
Locate the platform-specific |
|
|
Derive the TI F021 Flash API include path from the HALCoGen installation. |
|
Recursively resolve include paths from |
Convert raw |
|
|
Process the |
|
Validate that all VS Code configuration files are valid JSON. |
Classes
|
Build context for the |
|
Build context for |
|
Build context for |
|
Build context for |
Build context for |
|
|
Build context for |
|
Build context for |