Files
arcade/scripts/build-entity.py
T
waozi ccc36bfc63 Find each game package's apps from its declaration and build Arcade as ZX
games.json now names game packages; each package lists its apps in its own
apps.json, with the cover art, caption and action the library shows. Arcade
packs every declared app generically, opens it directly from its cover, and
builds a package's standalone collection from the same declaration.
Standalone Shovey now starts on its covers like Arcade. Apps opened from a
cover fill the screen with their own navigation; Profile stays on the
covers. Bundles, the collection and the Apps controller are .zx on Ziran
0.3.1, with the reviewed controller from Apps 12e52c0.

Parallel builds of Arcade and standalone Shovey now take turns building
their shared liboqs instead of configuring it at the same time.
2026-10-23 21:57:43 -03:00

31 lines
1.5 KiB
Python

#!/usr/bin/env python3
"""Build Entity once for the outer native host; never pack it into a game."""
from pathlib import Path
import argparse
import shutil
import subprocess
ROOT = Path(__file__).resolve().parents[1]
ZIRAN = str(ROOT / 'scripts/ziran.sh')
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--locked', action='store_true')
args = parser.parse_args()
flags = ['--locked'] if args.locked or not (ROOT / 'ziran.local.toml').exists() else []
def package(name):
return Path(subprocess.check_output([ZIRAN, 'pkg', 'path', name, *flags], cwd=ROOT, text=True).strip())
entity, kryon, toolchain, qrcode = map(package, ('entity', 'kryon', 'ziran', 'qrcode'))
subprocess.run([ZIRAN, 'bundle', '--root', str(entity),
'--module-path', str(entity / 'src'),
'--module-path', str(kryon / 'src/ui'),
'--module-path', 'kryon=' + str(kryon / 'src/ui'),
'--module-path', 'kryon=' + str(kryon / 'src/backend'),
'--module-path', 'qrcode=' + str(qrcode / 'src'),
'--module-path', str(toolchain / 'std'),
'--define', 'KRYON_HOSTED_UI', '--asset-dir', 'assets=' + str(entity / 'assets'),
'--entry', 'entity:Main', '-o', str(ROOT / 'build/entity.zx'), str(entity / 'src/entity.zi')],
cwd=entity, check=True)
assets = ROOT / 'build/entity-assets'
assets.mkdir(parents=True, exist_ok=True)
shutil.copyfile(ROOT / 'build/entity.zx', assets / 'entity.zx')