Main function.
()
| 13 | |
| 14 | |
| 15 | def main() -> int: |
| 16 | """Main function.""" |
| 17 | parser = argparse.ArgumentParser( |
| 18 | description="Build FastLED Blink example across multiple platforms" |
| 19 | ) |
| 20 | parser.add_argument( |
| 21 | "--platforms", |
| 22 | type=str, |
| 23 | help="Comma-separated list of platforms to build (default: all supported)", |
| 24 | ) |
| 25 | parser.add_argument( |
| 26 | "--docker", |
| 27 | action="store_true", |
| 28 | help="Use Docker for compilation (slower but more reliable)", |
| 29 | ) |
| 30 | parser.add_argument( |
| 31 | "--build", |
| 32 | action="store_true", |
| 33 | help="Build Docker images if they don't exist (use with --docker)", |
| 34 | ) |
| 35 | parser.add_argument( |
| 36 | "--example", |
| 37 | type=str, |
| 38 | default="Blink", |
| 39 | help="Example to compile (default: Blink)", |
| 40 | ) |
| 41 | parser.add_argument( |
| 42 | "-v", "--verbose", action="store_true", help="Enable verbose output" |
| 43 | ) |
| 44 | |
| 45 | args = parser.parse_args() |
| 46 | |
| 47 | # Default platforms to test |
| 48 | default_platforms = ["uno", "esp32dev", "esp32s3", "esp32c3", "esp32p4", "teensy41"] |
| 49 | |
| 50 | if args.platforms: |
| 51 | platforms = [p.strip() for p in args.platforms.split(",")] |
| 52 | else: |
| 53 | platforms = default_platforms |
| 54 | |
| 55 | # Build the base command |
| 56 | docker_flags = "" |
| 57 | if args.docker: |
| 58 | docker_flags = " --docker" |
| 59 | if args.build: |
| 60 | docker_flags += " --build" |
| 61 | else: |
| 62 | docker_flags = " --local" |
| 63 | |
| 64 | verbose_flag = " --verbose" if args.verbose else "" |
| 65 | |
| 66 | failed_platforms: List[str] = [] |
| 67 | succeeded_platforms: List[str] = [] |
| 68 | |
| 69 | print(f"Building {args.example} for {len(platforms)} platform(s)") |
| 70 | print(f"Compilation mode: {'Docker' if args.docker else 'Local'}") |
| 71 | print() |
| 72 |
no test coverage detected