MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / find_assembly_definitions

Function find_assembly_definitions

unity_cli/hub/project.py:421–440  ·  view source on GitHub ↗

Find all .asmdef files in Assets/ directory.

(project_path: Path)

Source from the content-addressed store, hash-verified

419
420
421def find_assembly_definitions(project_path: Path) -> list[AssemblyDefinition]:
422 """Find all .asmdef files in Assets/ directory."""
423 project_path = project_path.resolve()
424 assets_dir = project_path / "Assets"
425
426 if not assets_dir.exists():
427 return []
428
429 assemblies: list[AssemblyDefinition] = []
430
431 for asmdef_path in assets_dir.rglob("*.asmdef"):
432 try:
433 asm = AssemblyDefinition.from_file(asmdef_path)
434 assemblies.append(asm)
435 except (json.JSONDecodeError, KeyError):
436 continue
437
438 # Sort by name
439 assemblies.sort(key=lambda a: a.name)
440 return assemblies

Callers 1

project_assembliesFunction · 0.90

Calls 1

from_fileMethod · 0.45

Tested by

no test coverage detected