Skip to content

Latest commit

 

History

History
202 lines (163 loc) · 7.35 KB

configure.adoc

File metadata and controls

202 lines (163 loc) · 7.35 KB

Configure

This page describes how to configure the disroop conan plugin. You can create a template of the configuration which is explained in howto guide.

Keywords for configuration

Use the following keywords in the configuration of settings.json and conan-settings.json

Parameter Description

${workspaceFolder}

Defines the path to the current workspace.

settings.json

To configure the path of the disroop conan plugin setting file set the following parameters in the settings.json file.

Parameter Description Default

disroopConan.settingsFile

This parameter defines the path of the conan-settings.json file, which is the central element of configuring the plugin.

${workspaceFolder}/.vscode/conan-settings.json

conan-settings.json

The conan-settings.json is the central element of configuring the plugin. With the profile settings, how a conan package should be installed, built and created and with the workspace settings how a conan workspace should be installed can be configured. Multiple profiles and workspaces can be configured.

Profiles Array

This part describes how the profiles to install, build, conan packages can be configured.

Parameter Description Default

name

This is the name that will be displayed at the profile picker and maps at the settings with the UI.

This parameter is mandatory.

conanFile

The path to the conanfile which should be built. Absolute paths can be used, or you can use the keyword ${workspaceFolder} to create relative paths to your workspace.

"."

profile

The profile which should be used to build the conanfile. The disroop conan plugin will set --profile:host and --profile:build of the conan cli with the corresponding parameter.

"default"

profileBuild

The build profile should be used to build the conanfile. An error will occur if this parameter and the profile parameter is set.

"default"

profileHost

The host profile should be used to build the conanfile. An error will occur if this parameter and the profile parameter is set.

"default"

installArg

Install arguments can be passed as a string as you would use the conan cli. If the parameter "install-folder" (-if/--install-folder), then the default install-folder will be overwritten. The profile to install a conan package also can be set via argument and will overwrite the profileHost, profileBuild and profile parameter. Examples how the arguments interact with the json parameters can be found in the chapter "Example: Profile Arguments vs Parameters"

"" (Empty)

buildArg

Install arguments can be passed as a string as you would use the conan cli. If the parameter "build-folder" (-bf/--build-folder) then the default build-folder will be overwritten.

"" (Empty)

createArg

Install arguments can be passed as a string as you would use the conan cli. The profile to create a conan package also can be set via argument; this will overwrite the profileHost, profileBuild and profile parameter. Examples of how the arguments interact with the json parameters can be found in the chapter "Example: Profile Arguments vs Parameters"

"" (Empty)

createUser

This parameter defines the user, which will be used to create a conan package

"" (Empty)

createChannel

This parameter defines the channel which will be used to create a conan package

"" (Empty)

Workspace Array

This part describes how the workspaces to install conan workspaces can be configured.

Parameter

Description

Default

name

This is the name that will be displayed at the profile picker and maps at the settings with the UI.

This parameter is mandatory.

conanWs

The path to the conan workspace which should be installed. Absolute paths can be used, or you can use the keyword ${workspaceFolder} to create relative paths to your workspace.

"."

profile

The profile which should be used to build the conan workspace. The disroop conan plugin will set --profile:host and --profile:build of the conan cli with the corresponding parameter.

"default"

profileBuild

The build profile should be used to build the conan workspace. An error will occur if this parameter and the profile parameter is set.

"default"

profileHost

The host profile should be used to build the conanfile. An error will occur if this parameter and the profile parameter is set.

"default"

arg

Install arguments can be passed as a string as you would use the conan cli. If the parameter "install-folder" (-if/--install-folder), then the default install-folder will be overwritten. The profile to install a conan workspace also can be set via argument and will overwrite the profileHost, profileBuild and profile parameter. Examples of how the arguments interact with the json parameters can be found in the chapter "Example: Profile Arguments vs Parameters"

"" (Empty)

For example:

{
    "profiles": [
        {
            "name":"linux",
            "conanFile": "${workspaceFolder}/conanfile.py",
            "profile":"clang-linux-debug",
            "installArg": "--build missing -if install",
            "buildArg":"-bf install",
            "createUser": "disroop",
            "createChannel": "development",
            "createArg":"--build=missing"
        },
        {
            "name":"linux-2",
            "conanFile": "${workspaceFolder}/conanfile.py",
            "profileBuild":"clang-linux-release",
            "profileHost":"clang-linux-debug",
            "installArg": "--build missing",
            "buildArg":"",
            "createUser": "disroop",
            "createChannel": "development",
            "createArg":"--build=missing"
        },
        {
            "name":"arm-debug",
            "conanFile": "${workspaceFolder}/conanfile.py",
            "profile":"arm-cortex-m4-debug",
            "installArg": "--build missing",
            "buildArg":"",
            "createUser": "disroop",
            "createChannel": "development",
            "createArg":"--build=missing"
        },
        {
            "name":"arm-release",
            "conanFile": "${workspaceFolder}/conanfile.py",
            "profile":"${workspaceFolder}/arm-cortex-m4-release",
            "installArg": "--build missing",
            "buildArg":"",
            "createUser": "disroop",
            "createChannel": "development",
            "createArg":"--build=missing"
        }
    ],
    "workspace":[
        {
            "name":"ws-arm",
            "conanWs": "${workspaceFolder}/conan-ws",
            "profile":"arm-cortex-m4-release",
            "arg": "--build missing"
        },
        {
            "name":"ws-arm-2",
            "conanWs": "${workspaceFolder}/conan-ws",
            "profileBuild":"clang-linux-debug",
            "profileHost":"arm-cortex-m4-release",
            "arg": "--build missing"
        }
    ]
}

Example: Profile Arguments vs Parameters

The following table shows how the installArg, createArg or arg (workspaces) parameter can modify profile settings of installing or creating conan packages. Furthermore, it shows that those arguments always have priority of the json-parameter (profileHost, profileBuild, profile).

argument

json-paramenter

Result

-pr:h x -pr:b y

profile: "z"

-pr:h x -pr:b y

-pr:h x

profile: "z"

-pr:h x -pr:b default

-pr:h x -pr:b y

profileHost: "v"

-pr:h x -pr:b y

-pr:h x

profileBuild: "w"

-pr:h x -pr:b default