bloombloombloom / Bloom

A debug interface for AVR-based embedded systems development on GNU/Linux.
https://bloom.oscillate.io/
Other
64 stars 3 forks source link

Change project configuration file format to YAML #50

Closed navnavnav closed 1 year ago

navnavnav commented 1 year ago

Currently, project configuration files are expected to be in JSON format, with the filename being bloom.json.

JSON is nice, but I've recently come to accept that YAML would be a better format for the purpose of user-maintained configuration files.

So I'm going to be changing bloom.json to bloom.yaml, which should look something like this:

Default project configuration in JSON (bloom.json):

{
  "environments": {
    "default": {
      "debugTool": {
        "name": "atmel-ice",
        "releasePostDebugSession": true
      },

      "target": {
        "name": "avr8",
        "physicalInterface": "debug-wire"
      },

      "debugServer": {
        "name": "avr-gdb-rsp",
        "ipAddress": "127.0.0.1",
        "port": "1442"
      }
    }
  },

  "insight": {
    "enabled": true
  }
}

Default project configuration in YAML (bloom.yaml):

environments:
  default:
    debugTool:
      name: "atmel-ice"
      releasePostDebugSession: true

    target:
      name: "avr8"
      physicalInterface: "debug-wire"

    debugServer:
      name: "avr-gdb-rsp"
      ipAddress: "127.0.0.1"
      port: 1442

insight:
  enabled: true

I don't want this to be a breaking change, and I'd like to make the transition for current Bloom users as easy and seamless as possible. This is why I plan to have Bloom continue to check if a bloom.json file is present, in the absence of a bloom.yaml file, and if it is, automatically create a bloom.yaml file from the contents of the bloom.json file.

I'm hoping to include this in v0.11.0, but can't be certain about that ATM.

navnavnav commented 1 year ago

Have made good progress on this. Looks like it will be included in 0.11.0.

navnavnav commented 1 year ago

Because JSON is a subset of YAML, there's no need to automatically create a YAML file from the contents of bloom.json - we can just use bloom.json in the absence of bloom.yaml, and ask the user to convert their old bloom.json whenever they can.

This means minimum disruption to current users when they upgrade to v0.11.0, and less work for me!

navnavnav commented 1 year ago

Development work for this is done. Have tested Bloom with the new YAML format, as well as the old JSON format - both work without issue.

Changes have been merged into develop and should be released as part of v0.11.0. Closing this now.