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

Function build_settings

unity_cli/cli/commands/build.py:34–76  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

32
33@build_app.command("settings")
34def 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")

Callers

nothing calls this directly

Calls 8

_should_jsonFunction · 0.90
print_jsonFunction · 0.90
is_no_colorFunction · 0.90
get_consoleFunction · 0.90
print_lineFunction · 0.90
_handle_errorFunction · 0.90
settingsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected