Let the iOS project open and run in Xcode straight from a clone.

The build script now extracts content.json into derived data and copies
it into the app bundle, so no generated file is referenced from the
project or written into the repository. Signing is explicit: ad hoc for
the simulator, automatic with your own team for a device.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-09-18 15:46:58 +02:00
commit 2eec46329a
5 changed files with 25 additions and 15 deletions

View file

@ -6,8 +6,7 @@ set -eu
root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
cd "$root"
python3 scripts/extract-android-content.py
# The Xcode target extracts content.json itself during the build.
export DEVELOPER_DIR="${DEVELOPER_DIR:-/Applications/Xcode.app/Contents/Developer}"
COMMIT="${COMMIT:-$(git -C "$root" rev-parse HEAD 2>/dev/null || echo dev)}"
dd="$root/ios/DerivedData"

View file

@ -10,10 +10,15 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SRC = ROOT / "src"
# Default target is the Android asset; Xcode passes `--out` and copies the
# file into the app bundle itself, so nothing generated lives under ios/.
OUTS = [
ROOT / "android" / "app" / "src" / "main" / "assets" / "content.json",
ROOT / "ios" / "Maturita" / "content.json",
]
if "--out" in sys.argv:
OUTS = [Path(a) for a in sys.argv[sys.argv.index("--out") + 1:] if a]
if not OUTS:
sys.exit("usage: extract-android-content.py [--out PATH ...]")
OUT = OUTS[0]
IDENT = re.compile(r"[A-Za-z_][A-Za-z0-9_]*")