Sort list (bettter for Clion)

Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
HiFiPhile 2025-02-09 18:40:30 +01:00
parent 09bce3532c
commit 1208f88b6e
2 changed files with 1738 additions and 1726 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,46 +24,57 @@ def main():
{"name": "default",
"hidden": True,
"description": r"Configure preset for the ${presetName} board",
"generator": "Ninja",
"generator": "Ninja Multi-Config",
"binaryDir": r"${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
"BOARD": r"${presetName}"
}
}]
}}]
presets['configurePresets'].extend(
[{'name': board, 'inherits': 'default'} for board in board_list]
sorted(
[
{
'name': board,
'inherits': 'default'
}
for board in board_list
], key=lambda x: x['name']
)
)
# Build presets
# no inheritance since 'name' doesn't support macro expansion
presets['buildPresets'] = [
{
'name': board,
'description': "Build preset for the " + board + " board",
'configurePreset': board
}
for board in board_list
]
presets['buildPresets'] = sorted(
[
{
'name': board,
'description': "Build preset for the " + board + " board",
'configurePreset': board
}
for board in board_list
], key=lambda x: x['name']
)
# Workflow presets
presets['workflowPresets'] = [
{
"name": board,
"steps": [
{
"type": "configure",
"name": board
},
{
"type": "build",
"name": board
}
]
}
for board in board_list
]
presets['workflowPresets'] = sorted(
[
{
"name": board,
"steps": [
{
"type": "configure",
"name": board
},
{
"type": "build",
"name": board
}
]
}
for board in board_list
], key=lambda x: x['name']
)
with open("hw/bsp/BoardPresets.json", "w") as f:
f.write('{}\n'.format(json.dumps(presets, indent=2)))
@ -87,5 +98,6 @@ def main():
print('Generating presets for the following examples:')
print(example_list)
if __name__ == "__main__":
main()