| 4 | import time |
| 5 | |
| 6 | def build(device: str) -> bool: |
| 7 | print(f"Building {device}...") |
| 8 | shutil.rmtree(os.path.join('Firmware', 'Generated'), ignore_errors=True) |
| 9 | result = subprocess.run(['python', 'device.py', device], capture_output=True, text=True) |
| 10 | if result.returncode != 0: |
| 11 | print(f"Failed to select device {device}") |
| 12 | return False |
| 13 | result = subprocess.run(['idf.py', f"-Bbuild-all-{device}", 'build'], capture_output=True, text=True) |
| 14 | if result.returncode != 0: |
| 15 | print(f"Build failed for {device}:") |
| 16 | print(result.stdout) |
| 17 | print(result.stderr) |
| 18 | return result.returncode == 0 |
| 19 | |
| 20 | def main(): |
| 21 | start_time = time.time() |