Print the current Build Settings (target, product info, scripting backend, scenes).
(
ctx: typer.Context,
json_flag: Annotated[
bool,
typer.Option("--json", help="Output as JSON"),
] = False,
)
| 32 | |
| 33 | @build_app.command("settings") |
| 34 | def build_settings( |
| 35 | ctx: typer.Context, |
| 36 | json_flag: Annotated[ |
| 37 | bool, |
| 38 | typer.Option("--json", help="Output as JSON"), |
| 39 | ] = False, |
| 40 | ) -> None: |
| 41 | """Print the current Build Settings (target, product info, scripting backend, scenes).""" |
| 42 | context: CLIContext = ctx.obj |
| 43 | try: |
| 44 | result = context.client.build.settings() |
| 45 | if _should_json(context, json_flag): |
| 46 | print_json(result) |
| 47 | else: |
| 48 | rows_data = [ |
| 49 | ("Target", str(result.get("target", ""))), |
| 50 | ("Target Group", str(result.get("targetGroup", ""))), |
| 51 | ("Product Name", str(result.get("productName", ""))), |
| 52 | ("Company Name", str(result.get("companyName", ""))), |
| 53 | ("Bundle Version", str(result.get("bundleVersion", ""))), |
| 54 | ("Scripting Backend", str(result.get("scriptingBackend", ""))), |
| 55 | ] |
| 56 | scenes = result.get("scenes", []) |
| 57 | rows_data.append(("Scenes", str(len(scenes)))) |
| 58 | |
| 59 | if is_no_color(): |
| 60 | _print_plain_table(["Key", "Value"], [list(r) for r in rows_data], "Build Settings") |
| 61 | else: |
| 62 | from rich.table import Table |
| 63 | |
| 64 | table = Table(title="Build Settings") |
| 65 | table.add_column("Key", style="cyan") |
| 66 | table.add_column("Value") |
| 67 | for k, v in rows_data: |
| 68 | table.add_row(k, v) |
| 69 | get_console().print(table) |
| 70 | |
| 71 | if scenes: |
| 72 | print_line("") |
| 73 | for i, s in enumerate(scenes): |
| 74 | print_line(f" {i}: {s}") |
| 75 | except UnityCLIError as e: |
| 76 | _handle_error(e) |
| 77 | |
| 78 | |
| 79 | @build_app.command("run") |
nothing calls this directly
no test coverage detected