Task Variables
Visual Studio Code supports variable substitution in Task configuration files. Beside these, DVT provides the following additional variables:
Variable |
Arguments |
Description |
|
Returns the full path to the currently used build configuration file |
|
|
Returns the name of the currently used build configuration file, including its extension. Example: |
|
|
|
Returns the hierarchical full path of the signal under the cursor or of all the signals selected inside a diagram. The Note You must place the cursor on a signal in your codebase or select at least one signal in a diagram before calling the task associated with this command. |
|
|
List of files compiled by DVT, in compilation dependency order, including library and compile syntax information. Each line in the variable expansion has the format: |
Usage
If the task variable does to not take any arguments, or you do not want to pass any optional arguments, the variable value can be accessed directly using the VS Code Command Variable syntax: ${command:<variable_name>}
{
"version": "2.0.0",
"tasks": [
{
"label": "Print Active Build Config Name",
"type": "shell",
"command": "echo ${command:dvt.getActiveBuildConfigName}"
}
]
}
To access and pass arguments to variables, you need to use the Input Variables syntax:
{
"version": "2.0.0",
"tasks": [
{
"label": "Print Path to Signals",
"type": "shell",
"command": "echo ${input:callCommand}"
}
],
"inputs": [
{
"id": "callCommand",
"type": "command",
"command": "dvt.getPathToSignal",
"args": [
"/"
]
}
]
}