mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
Refactor board defaults - Use a common system to handle user configurable defines (#474)
* Tests * more changes * Remove the need for nodejs * Better preprocessor and ci * Fix ci maybe * Fix ci maybe * Fix ci maybe * Fix ci maybe + Add way to overide defaults from env vars * Temp fix for api tests * Small override fix * Fix override * More descriptions * More descriptions * Fix led + better typings * Better format * Bring back deleted files * Add all boards in platformio.ini * Always define Battery Pin and R1, R2 and Resistance * Checking Boards Default Config: BOARD_WEMOSD1MINI BOARD_NODEMCU BOARD_ESP01 BOARD_TTGO_TBASE * Format * Correcting Board Defaults: - BOARD_WROOM32 - BOARD_LOLIN_C3_MINI - BOARD_BEETLE32C3 - BOARD_ESP32C3DEVKITM1 - BOARD_ESP32C6DEVKITC1 - BOARD_WEMOSWROOM02 - BOARD_XIAO_ESP32C3 - BOARD_ESP32S3_SUPERMINI * Change IMU_AUTO to something else on boards that might crash with it. * remove IMU_UNKNOWN from selection * Preprocessor fixes * preprocessor defaults fixes + Make glove not use preprocessor --------- Co-authored-by: unlogisch04 <98281608+unlogisch04@users.noreply.github.com>
This commit is contained in:
29
ci/build.py
29
ci/build.py
@@ -32,12 +32,13 @@ def get_matrix() -> List[DeviceConfiguration]:
|
||||
matrix: List[DeviceConfiguration] = []
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read("./platformio-tools.ini")
|
||||
config.read("./platformio.ini")
|
||||
for section in config.sections():
|
||||
if section == "env":
|
||||
split = section.split(":")
|
||||
if len(split) != 2 or split[0] != 'env':
|
||||
continue
|
||||
|
||||
board = section.split(":")[1]
|
||||
board = split[1]
|
||||
platform = config[section]["platform"]
|
||||
platformio_board = config[section]["board"]
|
||||
|
||||
@@ -51,36 +52,15 @@ def get_matrix() -> List[DeviceConfiguration]:
|
||||
|
||||
def prepare() -> None:
|
||||
print(f"🡢 {COLOR_CYAN}Preparation{COLOR_RESET}")
|
||||
|
||||
print(f" 🡢 {COLOR_GRAY}Backing up platformio.ini{COLOR_RESET}")
|
||||
shutil.copy("./platformio.ini", "platformio.ini.bak")
|
||||
|
||||
print(
|
||||
f" 🡢 {COLOR_GRAY}Switching platformio.ini to platformio-tools.ini{COLOR_RESET}")
|
||||
shutil.copy("./platformio-tools.ini", "platformio.ini")
|
||||
|
||||
if os.path.exists("./build"):
|
||||
print(f" 🡢 {COLOR_GRAY}Removing existing build folder...{COLOR_RESET}")
|
||||
shutil.rmtree("./build")
|
||||
|
||||
print(f" 🡢 {COLOR_GRAY}Creating build folder...{COLOR_RESET}")
|
||||
os.mkdir("./build")
|
||||
|
||||
print(f" 🡢 {COLOR_GREEN}Success!{COLOR_RESET}")
|
||||
|
||||
|
||||
def cleanup() -> None:
|
||||
print(f"🡢 {COLOR_CYAN}Cleanup{COLOR_RESET}")
|
||||
|
||||
print(f" 🡢 {COLOR_GRAY}Restoring platformio.ini...{COLOR_RESET}")
|
||||
shutil.copy("platformio.ini.bak", "platformio.ini")
|
||||
|
||||
print(f" 🡢 {COLOR_GRAY}Removing platformio.ini.bak...{COLOR_RESET}")
|
||||
os.remove("platformio.ini.bak")
|
||||
|
||||
print(f" 🡢 {COLOR_GREEN}Success!{COLOR_RESET}")
|
||||
|
||||
|
||||
def build() -> int:
|
||||
print(f"🡢 {COLOR_CYAN}Build{COLOR_RESET}")
|
||||
|
||||
@@ -135,7 +115,6 @@ def build_for_device(device: DeviceConfiguration) -> bool:
|
||||
def main() -> None:
|
||||
prepare()
|
||||
code = build()
|
||||
cleanup()
|
||||
|
||||
sys.exit(code)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user