|
| 1 | +#!/usr/bin/env python3 |
| 2 | + |
| 3 | +""" |
| 4 | +This file centralizes all the operations needed to regenerate the CMakeLists.txt scattered along this repo. |
| 5 | +Hint: it would be a good practice to run it before committing... |
| 6 | +""" |
| 7 | + |
| 8 | +import subprocess |
| 9 | +import pathlib |
| 10 | + |
| 11 | +script_dir = pathlib.Path(__file__).parent # Arduino_Core_STM32/cmake/scripts |
| 12 | +base_dir = script_dir.parent.parent # Arduino_Core_STM32 |
| 13 | +script_dir = pathlib.Path(__file__).parent # Arduino_Core_STM32/cmake/scripts |
| 14 | +templates_dir = base_dir/"cmake"/"templates" |
| 15 | + |
| 16 | +print("Updating core/arduino...") |
| 17 | +subprocess.run( |
| 18 | + ("python3", script_dir/"cmake_core.py", base_dir/"cores"/"arduino"), |
| 19 | + check=True, |
| 20 | +) |
| 21 | + |
| 22 | +print("Updating libraries/...") |
| 23 | +subprocess.run( |
| 24 | + ("python3", script_dir/"cmake_libs.py", "-L", base_dir/"libraries"), |
| 25 | + check=True, |
| 26 | +) |
| 27 | + |
| 28 | +print("Updating variants/...") |
| 29 | +subprocess.run( |
| 30 | + ("python3", script_dir/"cmake_variant.py", base_dir/"variants"), |
| 31 | + check=True, |
| 32 | +) |
| 33 | +print("Updating board database...") |
| 34 | +subprocess.run( |
| 35 | + ("python3", script_dir/"parse_boards.py", |
| 36 | + "-b", base_dir/"boards.txt", |
| 37 | + "-p", base_dir/"platform.txt", |
| 38 | + "-t", templates_dir/"boards_db.cmake", |
| 39 | + "-o", base_dir/"cmake"/"boards_db.cmake", |
| 40 | + ), |
| 41 | + check=True, |
| 42 | +) |
| 43 | + |
| 44 | +print("All done !") |
0 commit comments