SimpleSwitch™
Build Tools for SimpleSwitch™
Introduction
This VS Code extension adds support for
effectively building, deploying and running Simpleswitch™. It depends on the
SimpleSwitch™ SDK.
Installation
Install from the Visual Studio Code Marketplace or by searching within VS Code. The SimpleSwitch™ extension will be installed automatically, if not already installed.
Features
With the help of this extension you can compile
, package
, deploy
and debug
any SimpleSwitch™ package, using the
SimpleSwitch™ SDK.
You will find the following commands when pressing F1
SimpleSwitch: initialize project
This task will create a new project with recommended settings in your current workspace.
Use it to easily get started with a new project.
SimpleSwitch: compile
This task will compile your code in the current workspace and makes it ready to be packaged as a SimpleSwitch™ package
SimpleSwitch: package
This task will create a SimpleSwitch™ package
SimpleSwitch: deploy
This task will copy the created SimpleSwitch™ package to your device
SimpleSwitch: install extra packages
Depending on the SimpleSwitch™ SDK and the language framework you're using, you can use this task to install
new 3rd party packages, like python code using pip, or npm packages using npm.
Note not all language frameworks support this at the moment.
SimpleSwitch: show logfile
Will show the log output of the running SimpleSwitch™ package
SimpleSwitch: clean
Cleans up your current workspace off intermediate compilation files, temporary files and outdated SimpleSwitch™ packages
SimpleSwitch: switch or initialize used SDK
This task lets you change the used SimpleSwitch™ SDK
SimpleSwitch: turn debug off
Turns off debugging capabilities in your generated SimpleSwitch™ package
SimpleSwitch: turn debug on
Turns on debugging capabilities in your generated SimpleSwitch™ package
SimpleSwitch: install a SDK extension
Installs a SDK extension, if the base SDK supports that
SimpleSwitch: install a SDK extension from a local installer
Install a SDK extension from a local installer, if the base SDK supports that
SimpleSwitch: uninstall a SDK extension
Uninstall a locally installed SDK extension
SimpleSwitch: update a SDK extension
Updates a locally installed SDK extension, if the base SDK supports that
SimpleSwitch: Reset Github credentials
Resets the Github secrets used for SimpleSwitch™
SimpleSwitch: Setup Github access for private networks
Setups a SSH reverse tunnel for a device on a private network, if the base SDK supports that
SimpleSwitch: Show open license agreements
Show yet to be agreed to license agreements (if any)
Debugging
If the debugging capabilities of your SimpleSwitch™ package are enabled and the package was successfully deployed to the device, you can
simply start your debugging session by pressing F5
.
Configuration
The extension uses 3 types of configuration to enable the full potential of SimpleSwitch™.
VSCode configuration
The following settings can be configured through VSCode settings
Board IP
the IP address of your SimpleSwitch™ device.
If you leave it empty, you'll be asked for an IP address when needed
Package size factor
Additional space that will be reserved in the generated SimpleSwitch™ package.
1.2 means the resulting package will be 120% of the actually needed size.
Create updatable package
Enables the generated SimpleSwitch™ package to be updated
Show live logging
When showing the log of a running SimpleSwitch™ package it will keep displaying new log entries, till terminated
Note: these settings affect all workspaces
Workspace configuration
Your project specific (or workspace specific) settings are stored in a file .vscode/simpleswitch.json
.
It's highly recommended to put this file under version control with the help of git
.
Following settings are stored in this file
application_name
The name of the application created as the result of the compile
step.
E.g. the name of the application that you will use to start from command line
container_name
Name of the SimpleSwitch™ package
flavor
Name of the used language framework in this project.
The values are obtained from the used SDK
source_location
Workspace subfolder where your source code is stored. E.g. src/
opt_args
Optional arguments that should be passed to the application on startup
debug_build
Yes
to enable debugging features in the SimpleSwitch™ package, No
to disable
_startup_command_custom (optional)
Overrides the default startup command from the SDK - use with caution
_startup_command_debug_custom (optional)
Overrides the default startup command in debug mode from the SDK - use with caution
if not set, you will be asked interactively for these settings, when needed.
SDK specific settings
These settings depend on the SimpleSwitch™ SDK you're using and shouldn't be changed
Developer's guide
Internally all the above mentioned settings can be used in the task templates provided by the used SimpleSwitch™ SDK.
The extension will replace the template value ${var}
by the actual configured value of var
.
The following variables are supported
sdk.path
Absolute path to the currently used SDK
workspaceFolder
Absolute path to the current workspace
workspaceFolderBasename
Name of the current workspace
file
Path to the currently opened and focused file
fileBasename
Filename of the currently opened and focused file
fileBasenameNoExtension
Filename of the currently opened and focused file without any extension
fileExtname
File extension of the currently opened and focused file
fileDirname
Directory path of the currently opened and focused file
fileDirnameBasename
Name of the parent directory of the currently opened and focused file
configuration.board_ip
Board IP address of the device, as set by VSCode settings
configuration.package_size_factor
Package size factor, as set by VSCode settings
configuration.allow_update
Enable update mechanism in SimpleSwitch™ packages, as set by Create updatable package in VSCode settings
configuration.follow_log
Use Show live logging as set by VSCode settings
workspace.flavor
Selected flavor of the current workspace
workspace.source_location
Path to source files in the current workspace
workspace.container_name
Name of the SimpleSwitch™ package
workspace.application_name
Name of the application to start