mirror of
https://github.com/pepaskopec-blip/Graduately.git
synced 2026-10-27 15:14:35 +00:00
Add a SwiftUI iOS app that plays the same maturita content.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
3f88e55f33
commit
6c7336c7bb
33 changed files with 4498 additions and 10 deletions
38
scripts/bundle-ios.sh
Executable file
38
scripts/bundle-ios.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
# Build an unsigned iOS IPA for sideloading (Xcode / AltStore / Sideloadly).
|
||||
|
||||
set -eu
|
||||
|
||||
root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
|
||||
cd "$root"
|
||||
|
||||
python3 scripts/extract-android-content.py
|
||||
|
||||
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"
|
||||
|
||||
rm -rf "$root/ios/Payload"
|
||||
mkdir -p "$dd" "$root/dist-ios"
|
||||
|
||||
xcodebuild \
|
||||
-project ios/Maturita.xcodeproj \
|
||||
-scheme Maturita \
|
||||
-configuration Release \
|
||||
-sdk iphoneos \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-derivedDataPath "$dd" \
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
CODE_SIGNING_REQUIRED=NO \
|
||||
COMMIT="$COMMIT"
|
||||
|
||||
app=$(find "$dd" -name 'Maturita.app' -path '*/Release-iphoneos/*' | head -n 1)
|
||||
if [ -z "$app" ]; then
|
||||
echo "Maturita.app not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$root/ios/Payload"
|
||||
cp -R "$app" "$root/ios/Payload/Maturita.app"
|
||||
(cd "$root/ios" && zip -r -q "$root/dist-ios/maturita-ios.ipa" Payload)
|
||||
echo "wrote $root/dist-ios/maturita-ios.ipa"
|
||||
|
|
@ -10,7 +10,11 @@ from pathlib import Path
|
|||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SRC = ROOT / "src"
|
||||
OUT = ROOT / "android" / "app" / "src" / "main" / "assets" / "content.json"
|
||||
OUTS = [
|
||||
ROOT / "android" / "app" / "src" / "main" / "assets" / "content.json",
|
||||
ROOT / "ios" / "Maturita" / "content.json",
|
||||
]
|
||||
OUT = OUTS[0]
|
||||
|
||||
IDENT = re.compile(r"[A-Za-z_][A-Za-z0-9_]*")
|
||||
|
||||
|
|
@ -1223,8 +1227,10 @@ def main() -> int:
|
|||
else:
|
||||
german_units[2]["exercises"]["5"]["bank"] = raw[0]
|
||||
|
||||
OUT.parent.mkdir(parents=True, exist_ok=True)
|
||||
OUT.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||
text = json.dumps(payload, ensure_ascii=False, indent=2)
|
||||
for dest in OUTS:
|
||||
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||
dest.write_text(text, encoding="utf-8")
|
||||
|
||||
def count(path, pred):
|
||||
node = payload
|
||||
|
|
@ -1232,7 +1238,7 @@ def main() -> int:
|
|||
node = node[p]
|
||||
return sum(1 for x in node if pred(x))
|
||||
|
||||
print(f"wrote {OUT}")
|
||||
print("wrote " + ", ".join(str(dest) for dest in OUTS))
|
||||
print(f" i18n keys: {len(i18n)}")
|
||||
print(f" german unlocked exercises: "
|
||||
f"{sum(len(u.get('exercises', {})) for u in german_units if u['unlocked'])}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue