Parse ProjectSettings/EditorBuildSettings.asset (YAML).
(cls, project_path: Path)
| 153 | |
| 154 | @classmethod |
| 155 | def from_file(cls, project_path: Path) -> BuildSettings: |
| 156 | """Parse ProjectSettings/EditorBuildSettings.asset (YAML).""" |
| 157 | build_file = project_path / "ProjectSettings/EditorBuildSettings.asset" |
| 158 | |
| 159 | if not build_file.exists(): |
| 160 | return cls(scenes=[]) |
| 161 | |
| 162 | content = build_file.read_text(encoding="utf-8") |
| 163 | scenes: list[BuildScene] = [] |
| 164 | |
| 165 | # Parse scenes using regex (simple YAML parsing) |
| 166 | scene_blocks = re.findall(r"-\s+enabled:\s*(\d+)\s+path:\s*([^\s]+)", content) |
| 167 | for enabled_str, path in scene_blocks: |
| 168 | scenes.append(BuildScene(path=path, enabled=enabled_str == "1")) |
| 169 | |
| 170 | return cls(scenes=scenes) |
| 171 | |
| 172 | |
| 173 | @dataclass(frozen=True) |
no test coverage detected