MCPcopy Create free account
hub / github.com/FastLED/FastLED / _build_config

Method _build_config

ci/compiler/argument_parser.py:293–344  ·  view source on GitHub ↗

Build configuration from parsed arguments.

(self, args: argparse.Namespace)

Source from the content-addressed store, hash-verified

291 return parser
292
293 def _build_config(self, args: argparse.Namespace) -> CompilationConfig:
294 """Build configuration from parsed arguments."""
295 # Resolve boards
296 boards = self._resolve_boards(args.boards)
297
298 # Determine workflow type (NATIVE for everything except wasm board)
299 workflow = self._determine_workflow(boards)
300
301 # Resolve examples
302 examples, skip_filters = self._resolve_examples(args, args.no_filter)
303
304 # Parse other options
305 defines: list[str] = args.defines.split(",") if args.defines else []
306 extra_packages: list[str] = (
307 [pkg.strip() for pkg in args.extra_packages.split(",")]
308 if args.extra_packages
309 else []
310 )
311
312 # Resolve build backend. Precedence (last wins among explicit flags):
313 # --fbuild -> fbuild
314 # --platformio / --pio -> platformio
315 # --backend=<value> -> <value> (explicit takes precedence over shortcuts
316 # only if also passed; argparse has no easy "was flag passed" signal
317 # for choices with a default, so we honor the shortcut if set, else
318 # the --backend value).
319 backend = BuildBackend(args.backend)
320 if getattr(args, "platformio_backend", False):
321 backend = BuildBackend.PLATFORMIO
322 if getattr(args, "fbuild_backend", False):
323 backend = BuildBackend.FBUILD
324
325 return CompilationConfig(
326 boards=boards,
327 examples=examples,
328 workflow=workflow,
329 defines=defines,
330 extra_packages=extra_packages,
331 verbose=args.verbose,
332 output_path=Path(args.out) if args.out else None,
333 merged_bin=args.merged_bin,
334 log_failures=Path(args.log_failures) if args.log_failures else None,
335 max_failures=args.max_failures if hasattr(args, "max_failures") else None,
336 wasm_run=args.run,
337 global_cache_dir=Path(args.global_cache) if args.global_cache else None,
338 skip_filters=skip_filters,
339 no_parallel=args.no_parallel,
340 build_info=Path(args.build_info)
341 if hasattr(args, "build_info") and args.build_info
342 else None,
343 backend=backend,
344 )
345
346 def _resolve_boards(self, board_spec: Optional[str]) -> list[Board]:
347 """Resolve board specification to Board objects.

Callers 1

parseMethod · 0.95

Calls 5

_resolve_boardsMethod · 0.95
_determine_workflowMethod · 0.95
_resolve_examplesMethod · 0.95
BuildBackendClass · 0.85
CompilationConfigClass · 0.85

Tested by

no test coverage detected