This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF Connect VSCode Extension - Saving Build Configuration

Hello,

I've started to develop with the nRF Connect VSCode extension and enjoying it a lot. However, I've noticed when I share a project the build configuration doesn't carry across.

Is there any way to get the extension to save the build configuration to a file or to .vscode/settings.json?

Our current workaround is to a shell script that runs the same command as the build configurator does but it's not ideal.

Many thanks,

Archie

  • Hi Marte,

    Thanks for the quick reply. That makes sense. I think my original point still stands, being able to store build configuration in their own file or in the vscode settings and have them detected by the nRF Connect extension would be very useful to quickly get developers up and running on a new codebase. 

    Is it possible to make an official feature request somewhere?

    Many thanks,

    Archie

  • Hi Archie,

    I have forwarded this to the VS Code team.

    Best regards,

    Marte

  • Hi Archie,

    I see that you marked the ticket as verified answer, but I just want to inform you what the developers said.

    They have thought a bit about this previously, and what they came up with then was to use cmake-presets: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html. Since we do not have any UI support for this you will need to use command line. Here is an example from the developers that works with CMake 3.22:

    CMakePresets.json (in the app folder, next to CMakeLists.txt):

    {
      "version": 3,
      "cmakeMinimumRequired": {
        "major": 3,
        "minor": 22,
        "patch": 0
      },
      "configurePresets": [
        {
          "name": "default",
          "displayName": "nRF52 DK",
          "description": "Default build for nRF52 DK",
          "generator": "Ninja",
          "cacheVariables": {
            "BOARD": "nrf52dk_nrf52832"
          }
        }
      ]
    }

    Call west build -d new_build_folder -- --preset default and west will generate and build a new configuration with this preset that the extension picks up automatically.

    This has also been discussed with the Zephyr build system maintainers, who agreed that this is the right solution to this problem in Zephyr. The developers will look into also adding support for this in the generate build UI.

    Best regards,

    Marte

Related