Sort list (bettter for Clion)
Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -24,46 +24,57 @@ def main():
|
|||||||
{"name": "default",
|
{"name": "default",
|
||||||
"hidden": True,
|
"hidden": True,
|
||||||
"description": r"Configure preset for the ${presetName} board",
|
"description": r"Configure preset for the ${presetName} board",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja Multi-Config",
|
||||||
"binaryDir": r"${sourceDir}/build/${presetName}",
|
"binaryDir": r"${sourceDir}/build/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
"CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
|
||||||
"BOARD": r"${presetName}"
|
"BOARD": r"${presetName}"
|
||||||
}
|
}}]
|
||||||
}]
|
|
||||||
|
|
||||||
presets['configurePresets'].extend(
|
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
|
# Build presets
|
||||||
# no inheritance since 'name' doesn't support macro expansion
|
# no inheritance since 'name' doesn't support macro expansion
|
||||||
presets['buildPresets'] = [
|
presets['buildPresets'] = sorted(
|
||||||
{
|
[
|
||||||
'name': board,
|
{
|
||||||
'description': "Build preset for the " + board + " board",
|
'name': board,
|
||||||
'configurePreset': board
|
'description': "Build preset for the " + board + " board",
|
||||||
}
|
'configurePreset': board
|
||||||
for board in board_list
|
}
|
||||||
]
|
for board in board_list
|
||||||
|
], key=lambda x: x['name']
|
||||||
|
)
|
||||||
|
|
||||||
# Workflow presets
|
# Workflow presets
|
||||||
presets['workflowPresets'] = [
|
presets['workflowPresets'] = sorted(
|
||||||
{
|
[
|
||||||
"name": board,
|
{
|
||||||
"steps": [
|
"name": board,
|
||||||
{
|
"steps": [
|
||||||
"type": "configure",
|
{
|
||||||
"name": board
|
"type": "configure",
|
||||||
},
|
"name": board
|
||||||
{
|
},
|
||||||
"type": "build",
|
{
|
||||||
"name": board
|
"type": "build",
|
||||||
}
|
"name": board
|
||||||
]
|
}
|
||||||
}
|
]
|
||||||
for board in board_list
|
}
|
||||||
]
|
for board in board_list
|
||||||
|
], key=lambda x: x['name']
|
||||||
|
)
|
||||||
|
|
||||||
with open("hw/bsp/BoardPresets.json", "w") as f:
|
with open("hw/bsp/BoardPresets.json", "w") as f:
|
||||||
f.write('{}\n'.format(json.dumps(presets, indent=2)))
|
f.write('{}\n'.format(json.dumps(presets, indent=2)))
|
||||||
@@ -87,5 +98,6 @@ def main():
|
|||||||
print('Generating presets for the following examples:')
|
print('Generating presets for the following examples:')
|
||||||
print(example_list)
|
print(example_list)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Reference in New Issue
Block a user