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: publish
This task will publish the created SimpleSwitch™ package to GHCR based container registry
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)
SimpleSwitch: Edit workspace configuration
Opens the configuration dialog to edit all project/workspace related configuration
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.
Values in this file should only be edited using the Edit workspace configuration command.
SDK specific settings
These settings depend on the SimpleSwitch™ SDK you're using and shouldn't be changed
Upload
If you want to upload the generated SimpleSwitch™ package to a package registry,
you might want to adjust the metadata - Simply run Edit workspace configuration command,
in before calling Publish
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
configuration.sdk_ext_location
Override the default location of the SDK extension path 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.autostart
Autostart argument for simpleswitch-generate-package
workspace.application_name
Name of the application to start
workspace.application_name_stripped
Name of the application to start (without any preamble)
workspace.bind_mounts
Bind mount configuration string for simpleswitch-generate-package
workspace.startup_command
Startup command of the package
workspace.install_command
Install command of the package
workspace.uninstall_command
Install command of the package
workspace.reboot_req
Reboot required on install/uninstall
workspace.opt_args
Optional arguments of the package (for startup_command)
workspace.work_dir
Full path of current working directory
metadata.ghcr_orgname
Name of the Github organization to publish to
metadata.ghcr_packagenamespace
Package namespace
metadata.version
Version of the package
metadata.categories
Categories of the package
metadata.conflicts
Conflicts with other SimpleSwitch packages
metadata.dependencies
Dependencies of the package
metadata.picture
Path to thumbnail picture (relative to workspace)
metadata.summary
Summary of the package
metadata.video
Video link for the package
metadata.additional_terms
Additional license terms
metadata.recommends
Recommended packages
metadata.capabilities
Base image capabilities required
metadata.license
License of the package
metadata.sections
Sections of the package
metadata.description
Description of the package
metadata.maxsize
Size of persistent storage of the package