You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Example customization using devinit for the opencv/opencv repo.
3
+
description: Example customization using devinit to target both Linux and Windows for the OpenCV repository.
4
4
ms.date: 08/28/2020
5
5
ms.topic: reference
6
6
author: andysterland
@@ -14,31 +14,55 @@ ms.technology: devinit
14
14
---
15
15
# OpenCV
16
16
17
-
This example illustrates the customizations needed to by [OpenCV](https://github.com/opencv/opencv) to be automatically provisioned with [GitHub Codespaces]https://github.com/features/codespaces).
17
+
This example illustrates how to customize [GitHub Codespaces](https://github.com/features/codespaces) in order to develop with a multiplatform projects such as [opencv/OpenCV](https://github.com/opencv/opencv).
18
18
19
-
## .devinit.json
19
+
The following customizations are already applied on the fork [microsoft/OpenCV](https://github.com/microsoft/opencv) and allow to build targeting either Windows and Ubuntu.
20
20
21
-
Contents of the [_.devinit.json_](devinit-json.md) file. This file needs to be in the same folder as _.devcontainer.json_.
21
+
## Customization with devcontainer.json and devinit.json
22
+
23
+
The `.devcontainer` directory needs to contain the following files:
24
+
25
+
* devcontainer.json
26
+
* devinit.json
27
+
28
+
### devcontainer.json
29
+
30
+
The following is the content of the _devcontainer.json_ file.
31
+
32
+
```json
33
+
{
34
+
"postCreateCommand": "devinit init"
35
+
}
36
+
```
37
+
38
+
The `postCreateCommand` launches the [devinit](devinit-and-codespaces.md) tool, which consumes _devinit.json_.
39
+
40
+
41
+
### devinit.json
42
+
43
+
The following is the content of the [_devinit.json_](devinit-json.md) file.
22
44
23
45
```json
24
46
{
25
47
"run": [
26
48
{
27
-
"comments": "Example that will install Ubuntu 20.04 using WSL2, and configure it with various packages.",
49
+
"comments": "Example that will install Ubuntu 20.04 using WSL2, and configure it with various packages useful for C++ development.",
The _devinit.json_ is the file consumed by the [devinit](devinit-and-codespaces.md) tool and it must be in the same directory of _devcontainer.json_.
35
58
36
-
## .devcontainer.json
59
+
In this sample, the [wsl-install](tool-wsl-install.md) tool is used to create a WSL instance running Ubuntu 20.04, and provisioning it with essential C++ development tools.
60
+
## Targeting Windows or Linux
37
61
38
-
Contents of the _.devcontainer.json_ file in the repo root.
62
+
A default build configuration targeting Windows is always created named `x64-Debug`.
39
63
40
-
```json
41
-
{
42
-
"postCreateCommand": "devinit init"
43
-
}
44
-
```
64
+
By adding the above mentioned files, upon Codespace instance creation, Visual Studio provisions a new SSH connection in the [Connection Manager](/cpp/linux/connect-to-your-remote-linux-computer), and creates a new configuration in the Configuration picker that targets the Ubuntu instance via the SSH connection.
0 commit comments