Task Integration
The extension provides custom task providers for both Zephyr and CMake projects.
Zephyr Task Provider
Type: onsemi.zephyr
Available Commands:
build: Build the projectflash: Flash firmware to deviceclean: Clean build artifactsmenuconfig: Open Kconfig menuconfigguiconfig: Open Kconfig GUIram-report: Generate RAM usage reportrom-report: Generate ROM usage report
Task Definition Example (tasks.json):
{
"version": "2.0.0",
"tasks": [
{
"type": "onsemi.zephyr",
"label": "Build Zephyr Project",
"projectPath": "${workspaceFolder}",
"command": "build",
"configName": "debug",
"args": ["--pristine"],
"options": {
"cwd": "${workspaceFolder}",
"env": [
{
"name": "CONF_FILE",
"value": "prj_debug.conf"
}
]
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "onsemi.zephyr",
"label": "Flash to Device",
"projectPath": "${workspaceFolder}",
"command": "flash",
"configName": "debug",
"problemMatcher": []
}
]
}
Task Properties:
projectPath(required): Path to the project foldercommand(required): Command to execute (build, flash, clean, etc.)args: Additional command-line argumentsconfigName: Build configuration name to useoptions.cwd: Working directory for the taskoptions.env: Additional environment variables
CMake Task Provider
Type: onsemi.cmake
Available Commands:
configure: Configure CMake projectbuild: Build the projectclean: Clean build artifactscleanRebuild: Clean and rebuild
Task Definition Example (tasks.json):
{
"version": "2.0.0",
"tasks": [
{
"type": "onsemi.cmake",
"label": "Configure CMake",
"projectPath": "${workspaceFolder}",
"command": "configure",
"configName": "Debug-CM33",
"buildType": "",
"generator": "Ninja",
"toolchainFile": "cmake/arm-toolchain.cmake",
"cacheVars": [
{
"name": "CMAKE_EXPORT_COMPILE_COMMANDS",
"value": "ON"
}
],
"problemMatcher": ["$gcc"]
},
{
"type": "onsemi.cmake",
"label": "Build CMake Project",
"projectPath": "${workspaceFolder}",
"command": "build",
"configName": "Debug-CM33",
"buildType": "",
"targets": ["blinky"],
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Task Properties:
projectPath(required): Absolute path to the project foldercommand(required): Command to executeargs: Additional argumentsconfigName: Build configuration namebuildType: CMake build type (Debug, Release, etc.)generator: CMake generator (Ninja, Unix Makefiles, etc.)toolchainFile: Absolute path to CMake toolchain filecacheVars: CMake cache variablesconfigurationPreset: CMake configuration preset namebuildPreset: CMake build preset nametargets: Build targets to compileoptions.cwd: Working directoryoptions.env: Environment variables