This page contains information relating to an older version of ACAP. See here for the latest version.
Develop using Visual Studio Code
Visual Studio Code provides access to containerized development tools, without the need for you to install them natively on your development computer.
To start developing ACAP applications using Visual Studio Code:
- Install the Remote - Containers extension available in the Extensions Marketplace in Visual Studio Code.
- Create a subfolder called
.devcontainer
in the top directory of the source code project you are working on. - In
.devcontainer
, create aDockerfile
anddevcontainer.json
containing the code below. - Save the
Dockerfile
anddevcontainer.json
. - Press Ctrl+Shift+P and type in
Remote-Containers: Reopen in Container
.
Dockerfile
FROM axisecp/acap-sdk:3.2-armv7hf-ubuntu20.04
CMD /bin/bash
devcontainer.json
{
"name": "ACAP SDK ",
"build": {
"dockerfile": "Dockerfile"
}
}
The application restarts and is now attached to a container with the SDK and your code. This way, you can interactively edit your source code just as if the tools had been installed natively, including using all the debugging and support features in Visual Studio Code.
You can install different versions of the SDK in separate containers. When you open your source code folder, Visual Studio Code identifies the SDK version defined in the Dockerfile.
The ACAP SDK-container includes all the SDK tools, Git and some other useful things. But you can add more tools to the Dockerfile and the devcontainer.json configuration. See Microsofts tutorials on how to use Development Containers for more information on what this way of working can offer.