summaryrefslogtreecommitdiff
path: root/makima/ios/project.yml
diff options
context:
space:
mode:
authorsoryu-co <bot@soryu.co>2026-04-24 18:13:01 +0000
committersoryu-co <bot@soryu.co>2026-04-24 18:13:01 +0000
commit3ea85b0d8d3cb6dca522578cb29a676bbac6809f (patch)
treea2625312d505b3d9d8717d887896eede7cbb00ab /makima/ios/project.yml
parent105730ceaa292b1e3589c23d5aad8f35ccf04b8e (diff)
downloadsoryu-3ea85b0d8d3cb6dca522578cb29a676bbac6809f.tar.gz
soryu-3ea85b0d8d3cb6dca522578cb29a676bbac6809f.zip
Makima iOS — Screenshots scheme + demo modemakima-ios-m2-auth
Adds an opt-in `Makima-Screenshots` scheme + `Screenshots` build config that short-circuits auth with an in-process URLProtocol and seeds the app with canned demo data. Lets us run the app past onboarding in UI tests or on a fresh simulator without touching a real Makima server. What lands - ScreenshotMode: compile-time flag via -DSCREENSHOT_MODE (set in the new Screenshots configuration in project.yml). - AppState: when the flag is on, calls auth.seedScreenshotData() in init. - AuthStore: adds seedSetClient/seedSetState helpers (internal, only useful for screenshot + future preview builds) and a seedScreenshotData that wires up a fake APIClient backed by DemoSession. - DemoSession: URLSession wired to DemoURLProtocol, which answers /api/v1/mesh/daemons, /contracts, /mesh/tasks, /directives, /listen/sessions, /mesh/tasks/{id}, /mesh/tasks/{id}/output with deterministic demo JSON. Host-scoped to makima.jp so production URL remains an operational realm. - Tests/MakimaUITests/ScreenshotTests.swift: five XCTest cases that drive the app through Home, Contracts, Task detail, Directives, and Settings. Each attaches an XCTAttachment screenshot with a stable name. - project.yml: adds MakimaUITests target + Screenshots configuration + Makima-Screenshots scheme. Usage (on a Mac) make xcgen xcodebuild \\ -project Makima.xcodeproj \\ -scheme Makima-Screenshots \\ -configuration Screenshots \\ -destination 'platform=iOS Simulator,name=iPhone 16 Pro' \\ test Screenshots appear as attachments inside the resulting .xcresult bundle; open the bundle in Xcode > Report Navigator to browse them, or use `xcrun xcresulttool get test-results attachments` to export to PNG. Scope - Normal Debug/Release builds are unaffected — SCREENSHOT_MODE is only defined under the Screenshots configuration. - DemoURLProtocol only matches host=makima.jp, so any real request made during screenshot tests (to non-makima.jp hosts) still fails normally. - No production code path gates on ScreenshotMode beyond the init-time seed call; ensureWebSocket is stubbed to a fake online status so the masthead pill shows LIVE during screenshots. Not included in this commit: the matching GitHub Actions workflow (.github/workflows/ios-ci.yml) — requires a workflow-scoped token to push and will land as a follow-up. The Swift helper that extracts screenshots from xcresult is also queued for that follow-up.
Diffstat (limited to 'makima/ios/project.yml')
-rw-r--r--makima/ios/project.yml35
1 files changed, 33 insertions, 2 deletions
diff --git a/makima/ios/project.yml b/makima/ios/project.yml
index 5ec3eee..2b099b4 100644
--- a/makima/ios/project.yml
+++ b/makima/ios/project.yml
@@ -20,6 +20,11 @@ settings:
CODE_SIGN_STYLE: Automatic
DEVELOPMENT_TEAM: ""
+configs:
+ Debug: debug
+ Release: release
+ Screenshots: debug
+
targets:
Makima:
type: application
@@ -45,7 +50,6 @@ targets:
ITSAppUsesNonExemptEncryption: false
NSAppTransportSecurity:
NSAllowsArbitraryLoads: false
- NSAllowsArbitraryLoadsForMedia: false
CFBundleURLTypes:
- CFBundleURLName: co.soryu.makima
CFBundleURLSchemes:
@@ -56,7 +60,10 @@ targets:
TARGETED_DEVICE_FAMILY: "1"
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: BrandAccent
- INFOPLIST_KEY_UIApplicationSceneManifest_Generation: YES
+ configs:
+ Screenshots:
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS: "DEBUG SCREENSHOT_MODE"
+ OTHER_SWIFT_FLAGS: "-DSCREENSHOT_MODE"
MakimaTests:
type: bundle.unit-test
@@ -69,6 +76,18 @@ targets:
base:
PRODUCT_BUNDLE_IDENTIFIER: co.soryu.makima.tests
+ MakimaUITests:
+ type: bundle.ui-testing
+ platform: iOS
+ sources:
+ - path: Tests/MakimaUITests
+ dependencies:
+ - target: Makima
+ settings:
+ base:
+ PRODUCT_BUNDLE_IDENTIFIER: co.soryu.makima.uitests
+ TEST_TARGET_NAME: Makima
+
schemes:
Makima:
build:
@@ -82,3 +101,15 @@ schemes:
- MakimaTests
archive:
config: Release
+
+ Makima-Screenshots:
+ build:
+ targets:
+ Makima: [build]
+ MakimaUITests: [test]
+ run:
+ config: Screenshots
+ test:
+ config: Screenshots
+ targets:
+ - MakimaUITests