Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify the configurarion-name and overriden-properties into one configurations.json file. #52

Closed
denis-shienkov opened this issue Jul 26, 2021 · 2 comments

Comments

@denis-shienkov
Copy link
Owner

denis-shienkov commented Jul 26, 2021

Right now we use the separate overriden-properties.json file to store the overriden properties, and the separate build configurations button on the status bar.

In this case it is impossible to assign the overriden-properties for the specific build configuration.

The solution is to get rid of the overriden-properties.json file in vafor to the configurations.json file. In this case this configurations.json file may contains all build configurations and its overriden properties e.g. in a such format:

{
    "release": {
     // "key": "value" 
     },
    "debug": {
     },
    "profiling": {
     }
}

where the release, debug, profiling (or something custom) - are the build configurations maps, and the underlying dict is the map containing overriden-properties for each configuration (it is key -> value pairs).

Also we need to do the additional changes:

  • Introduce the "Edit build configurations" command, which should create the default configurations.json file if it not exists yet, and then to open this file in the editor.
  • Modify the "Select build cnfiguration" command to parse this configurations.json file to select the desired configuration.
  • Also we need to modify the build step to take the curent selected build configuration from the configuration.json file.
denis-shienkov added a commit that referenced this issue Jul 30, 2021
We need to use the `configurations.json` file which describes
the all build configurations with its overridden properties.

In this case we don't need in the `overridden-properties.json`
file, and in the `qbs.overriddenProperties` command.

Instead, we use the `qbs.editConfiguration` command, and
the `configurations.json` file which creates automatically
at the first extension startup. Also the user can modify this
file as needs to add an other custom build configurations with
its overridden properties.

Task-number: #52
@denis-shienkov
Copy link
Owner Author

denis-shienkov commented Jul 30, 2021

Right now it is implemented with the following configurations.json format:

[
    {
        "name": "release",
        "display-name": "Release",
        "description": "Enable optimizations.",
        "overridden-properties": {}
    },
    {
        "name": "debug",
        "display-name": "Debug",
        "description": "Disable optimizations.",
        "overridden-properties": {
            "projects.foo.hasSpecialFeature": false
        }
    },
    {
        "name": "profiling",
        "display-name": "Profiling",
        "description": "Enable profiling.",
        "overridden-properties": {}
    }
]

where the :

  • name - is the mandatory build configuration name (will be passed to qbs)
  • display-name - the text which will be displayed on the Select Configuration button and in the Select Configurations selector.
  • description - a short brief which will be displayed in the Select Configurations selector.
  • overridden-properties - it contains the set of properties which should be overridden (will be passed to qbs)

@denis-shienkov
Copy link
Owner Author

UPD: File configurations.json renamed with qbs-configurations.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant