name: LChat options: bundleIdPrefix: com.elevenmessenger deploymentTarget: iOS: "17.0" createIntermediateGroups: true settings: base: SWIFT_VERSION: "5.0" MARKETING_VERSION: "1.0" CURRENT_PROJECT_VERSION: "2" TARGETED_DEVICE_FAMILY: "1,2" # The Eleven Messenger Apple Developer team. Overridable on the xcodebuild # line for building with a personal team instead. DEVELOPMENT_TEAM: J5NDF5PCD8 # One knob for the app id; the extension derives from it so a per-machine # override (e.g. LCHAT_APP_BUNDLE_ID=com.example.mine on the xcodebuild # line for device signing) can never collide the two bundle ids. LCHAT_APP_BUNDLE_ID: com.elevenmessenger.messenger packages: # Mac-only auto-update framework (LChatMac). Pin a specific release rather # than floating on `from:` so `xcodegen generate` is reproducible; bump # deliberately and re-check ios/release-mac.sh still matches the CLI tool # flags for that version. Sparkle: url: https://github.com/sparkle-project/Sparkle exactVersion: 2.9.4 # The platform-neutral core (crypto, models, API, thread store) shared by the # iOS app, the native Mac app and the notification extension. A local package # so `swift test` runs its cross-implementation crypto vectors on the Mac # directly — see LChatCore/Package.swift and docs/native-chat.md. LChatCore: path: LChatCore targets: LChat: type: application platform: iOS sources: - path: LChat dependencies: - target: LChatNSE - target: LChatShare - package: LChatCore settings: base: PRODUCT_BUNDLE_IDENTIFIER: $(LCHAT_APP_BUNDLE_ID) CODE_SIGN_STYLE: Automatic CODE_SIGN_ENTITLEMENTS: LChat/LChat.entitlements ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor configs: # Debug builds use ?mode=developer on the webcredentials association so # dev installs bind to home immediately (no Apple-CDN wait; needs the # device's Developer Mode, which dev installs require anyway). Release # keeps the clean association — the Debug file must never ship. Debug: CODE_SIGN_ENTITLEMENTS: LChat/LChat-Debug.entitlements info: path: LChat/Info.plist properties: # Drive the bundle version from the build settings (single source of # truth) — xcodegen otherwise bakes a literal "1", so bumping # CURRENT_PROJECT_VERSION for a new TestFlight build had no effect. CFBundleVersion: "$(CURRENT_PROJECT_VERSION)" CFBundleShortVersionString: "$(MARKETING_VERSION)" # Only OS-standard crypto (TLS + CryptoKit/WebCrypto) — exempt, so TestFlight # builds don't stall on the per-build "Missing Compliance" prompt. ITSAppUsesNonExemptEncryption: false CFBundleDisplayName: Eleven NSCameraUsageDescription: Camera access lets you take photos to share in chats and scan QR codes for joining UILaunchScreen: {} # Communication notifications (sender's photo on message banners): the # system requires the intent to be declared here, alongside the # com.apple.developer.usernotifications.communication entitlement. NSUserActivityTypes: - INSendMessageIntent # The welcome page's "Open the app" button fires # elevenmessenger://add?url= (see web/pages/join.html). CFBundleURLTypes: - CFBundleURLName: com.elevenmessenger.messenger CFBundleURLSchemes: - elevenmessenger UISupportedInterfaceOrientations: - UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad: - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight # E2E instances are served over HTTPS in production. This single # exception only loosens ATS for loopback/.local addresses so you can # test against a `go run .` instance during development. NSAppTransportSecurity: NSAllowsLocalNetworking: true # Background App Refresh: periodic wakes sync + decrypt new messages # into the local store (BackgroundRefresh.swift / BackgroundSync). UIBackgroundModes: - fetch BGTaskSchedulerPermittedIdentifiers: - $(PRODUCT_BUNDLE_IDENTIFIER).refresh # A genuinely native macOS app (NOT Catalyst). Shares the platform-neutral core # (LChatCore) with the iOS target; its own identity model + all crypto live # elsewhere (LChatMac/MacInstance.swift + the WKWebView). See LChatMac/. LChatMac: type: application platform: macOS deploymentTarget: "14.0" sources: - path: LChatMac dependencies: - package: Sparkle - package: LChatCore settings: base: # Dev alts (./tools/dev alt ): one knob-set turns this target # into a side-by-side dev flavour — distinct bundle id (its own # sandbox container + Launch Services identity, so it runs alongside # the Sparkle-updated app), "Eleven Dev" naming, the orange icon, and # Sparkle's auto-check off. The keychain access group is unchanged, # so an alt sees the same signed-in spaces (identities + home session # ride the team-shared group, not the bundle id). LCHAT_MAC_ALT_SUFFIX: "" LCHAT_MAC_DISPLAY_NAME: Eleven LCHAT_MAC_APPICON: AppIcon LCHAT_MAC_SPARKLE_AUTOCHECK: "YES" PRODUCT_NAME: $(LCHAT_MAC_DISPLAY_NAME) PRODUCT_BUNDLE_IDENTIFIER: com.elevenmessenger.messenger.mac$(LCHAT_MAC_ALT_SUFFIX) CODE_SIGN_STYLE: Automatic CODE_SIGN_ENTITLEMENTS: LChatMac/LChatMac.entitlements ASSETCATALOG_COMPILER_APPICON_NAME: $(LCHAT_MAC_APPICON) # Required for notarization (Developer ID distribution, see # ios/release-mac.sh). Sparkle's bundled XPC helpers need no entitlement # exceptions on top of this for a non-sandboxed app. ENABLE_HARDENED_RUNTIME: YES # The "Embed eleven CLI" phase runs `go build` (GOCACHE lives outside # the build dir), which Xcode's script sandbox would refuse. ENABLE_USER_SCRIPT_SANDBOXING: NO configs: # Debug carries the webcredentials association for Mac "Sign in with # Eleven" (?mode=developer — never ships; Release keeps the plain # entitlements). Needs a real Development profile: this Mac is # registered in the team (device 8VWU966HQ3, 2026-07-08). Debug: CODE_SIGN_ENTITLEMENTS: LChatMac/LChatMac-Dev.entitlements # Bundle the eleven CLI (../eleven, docs/eleven-cli.md) at # Contents/Helpers/eleven so Settings can offer "install the command-line # tool" — the app and the CLI ship as one artifact. Built universal # (arm64+x86_64, CGO off) and signed here because Xcode only auto-signs # nested code in Frameworks/PlugIns; hardened runtime + (release) a secure # timestamp keep notarization happy. Runs before the product's own CodeSign # step, so the app seal covers it. postBuildScripts: # Stamp the commit the app was built from into the bundle, so the About # panel can show it (BuildInfo.swift) — the answer to "which build is # this?" for a locally-built app. A custom Info.plist key on purpose: # CFBundleVersion is how Sparkle orders updates, so the SHA must never # go there. Runs before the product's CodeSign step, like the phase # below, so the seal covers the edited plist. No outputs (and dependency # analysis off) so it re-stamps on EVERY build — otherwise switching # branches would leave the previous SHA in the bundle. Silently skipped # when there's no git to ask (a source tarball), rather than failing. - name: Stamp git SHA shell: /bin/bash basedOnDependencyAnalysis: false script: | set -euo pipefail SHA="$(git -C "$SRCROOT/.." rev-parse --short HEAD 2>/dev/null || true)" [ -n "$SHA" ] || exit 0 # A local build usually has edits in flight; say so, or the SHA # implies the running app matches that commit when it doesn't. if [ -n "$(git -C "$SRCROOT/.." status --porcelain 2>/dev/null)" ]; then SHA="$SHA-dirty" fi # $INFOPLIST_PATH, not a hardcoded name: PRODUCT_NAME varies (a dev # alt's bundle is "Eleven Dev.app"). plutil -replace GitSHA -string "$SHA" "$TARGET_BUILD_DIR/$INFOPLIST_PATH" - name: Embed eleven CLI shell: /bin/bash outputFiles: - $(TARGET_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)/Helpers/eleven script: | set -euo pipefail GO="$(command -v go || true)" # Xcode's PATH is minimal — look where Go installs actually live. for g in /usr/local/go/bin/go /opt/homebrew/bin/go /usr/local/bin/go; do [ -n "$GO" ] && break [ -x "$g" ] && GO="$g" done [ -n "$GO" ] || { echo "error: embedding the eleven CLI needs Go on this machine (brew install go)" >&2; exit 1; } HELPERS="$TARGET_BUILD_DIR/$CONTENTS_FOLDER_PATH/Helpers" mkdir -p "$HELPERS" TMPD="$(mktemp -d)"; trap 'rm -rf "$TMPD"' EXIT cd "$SRCROOT/.." # go.mod may require a newer Go than the machine's (1.25 since the # litestream bump); auto lets Go fetch the right toolchain instead # of failing under a machine-pinned GOTOOLCHAIN=local. export GOTOOLCHAIN=auto CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 "$GO" build -trimpath -o "$TMPD/eleven-arm64" ./eleven CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 "$GO" build -trimpath -o "$TMPD/eleven-amd64" ./eleven lipo -create -output "$HELPERS/eleven" "$TMPD/eleven-arm64" "$TMPD/eleven-amd64" TS=() [ "$CONFIGURATION" = "Release" ] && TS=(--timestamp) codesign --force --options runtime ${TS[@]+"${TS[@]}"} \ --sign "${EXPANDED_CODE_SIGN_IDENTITY:--}" "$HELPERS/eleven" info: path: LChatMac/Info.plist properties: CFBundleVersion: "$(CURRENT_PROJECT_VERSION)" CFBundleShortVersionString: "$(MARKETING_VERSION)" CFBundleDisplayName: $(LCHAT_MAC_DISPLAY_NAME) CFBundleName: $(LCHAT_MAC_DISPLAY_NAME) LSApplicationCategoryType: public.app-category.social-networking # Same custom scheme as the iOS app, so the welcome page's "Open the app" # button works on the Mac too. (No associated domains here — the Mac app # is ad-hoc signed, so universal links can't validate.) # The scheme carries the alt suffix so a dev alt never captures the # browser sign-in handoff (elevenmessenger://) from the real app — # alts don't need it anyway; they read the shared keychain session. CFBundleURLTypes: - CFBundleURLName: com.elevenmessenger.messenger CFBundleURLSchemes: - elevenmessenger$(LCHAT_MAC_ALT_SUFFIX) NSAppTransportSecurity: NSAllowsLocalNetworking: true # Sparkle auto-update feed, published by ios/release-mac.sh to the # separate public elevenmessenger/releases repo (this repo is private, # so GitHub Releases here aren't publicly fetchable). The "latest" # alias always resolves to whatever release-mac.sh most recently # published. SUPublicEDKey is generated once via Sparkle's # generate_keys tool — see ios/release-mac.sh for the matching private # key usage. SUFeedURL: https://github.com/elevenmessenger/releases/releases/latest/download/appcast.xml SUPublicEDKey: "TkXBJrY0JvTeeCaHbEZlT5v5apJaOsG1op8uq7n1TsM=" # Skips Sparkle's own first-run "should Eleven check for updates # automatically?" prompt — background checking is the default we want. # A string on purpose (Sparkle reads it with -boolValue): dev alts # pass NO so they never offer to "update" themselves to stable. SUEnableAutomaticChecks: $(LCHAT_MAC_SPARKLE_AUTOCHECK) # The app is sandboxed (LChatMac.entitlements), so Sparkle installs # updates through its bundled InstallerLauncher XPC service instead of # spawning the installer directly. Its Downloader service stays off — # the app has com.apple.security.network.client, which Sparkle prefers. SUEnableInstallerLauncherService: true # Communication notifications (sender's photo/monogram on banners): # declared alongside the entitlement, matching the iOS target. NSUserActivityTypes: - INSendMessageIntent # Notification service extension: decrypts pushed ciphertext on-device (the # E2EE half of APNs). Shares the crypto/keychain code with the app via LChatCore. LChatNSE: type: app-extension platform: iOS sources: - path: LChatNSE dependencies: - package: LChatCore settings: base: PRODUCT_BUNDLE_IDENTIFIER: $(LCHAT_APP_BUNDLE_ID).nse CODE_SIGN_ENTITLEMENTS: LChatNSE/LChatNSE.entitlements info: path: LChatNSE/Info.plist properties: # Must match the host app's version, or App Store validation rejects the # bundle (extension/app version mismatch). CFBundleVersion: "$(CURRENT_PROJECT_VERSION)" CFBundleShortVersionString: "$(MARKETING_VERSION)" CFBundleDisplayName: Eleven Notifications # Communication notifications: declared alongside the entitlement in # LChatNSE.entitlements (the restyle runs in this process), matching # the app target's declaration. NSUserActivityTypes: - INSendMessageIntent NSExtension: NSExtensionPointIdentifier: com.apple.usernotifications.service NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).NotificationService # Share extension: receives images/videos from the system share sheet into # an app-group inbox; the app picks them up on next activation and asks # which chat to send them to. No keys, no network — just a byte ferry. LChatShare: type: app-extension platform: iOS sources: - path: LChatShare dependencies: - package: LChatCore settings: base: PRODUCT_BUNDLE_IDENTIFIER: $(LCHAT_APP_BUNDLE_ID).share CODE_SIGN_ENTITLEMENTS: LChatShare/LChatShare.entitlements info: path: LChatShare/Info.plist properties: CFBundleVersion: "$(CURRENT_PROJECT_VERSION)" CFBundleShortVersionString: "$(MARKETING_VERSION)" CFBundleDisplayName: Eleven NSExtension: NSExtensionPointIdentifier: com.apple.share-services NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).ShareViewController NSExtensionAttributes: NSExtensionActivationRule: NSExtensionActivationSupportsImageWithMaxCount: 6 NSExtensionActivationSupportsMovieWithMaxCount: 1 # End-to-end UI tests (Simulator only). They need a live server and an invite # link, passed as TEST_RUNNER_INVITE_LINK on the xcodebuild invocation; without # it the test skips itself. See LChatUITests/JoinAndChatTests.swift. LChatUITests: type: bundle.ui-testing platform: iOS sources: - path: LChatUITests dependencies: - target: LChat settings: GENERATE_INFOPLIST_FILE: YES # In-process feed tests (Simulator): mount the REAL feed container in a # window against a fake ChatFeedModel — measurement/layout geometry is # testable without a server or a device (born from the short-chat bunching # triage, 2026-07-21). LChatFeedTests: type: bundle.unit-test platform: iOS sources: - path: LChatFeedTests dependencies: - target: LChat settings: GENERATE_INFOPLIST_FILE: YES TEST_HOST: $(BUILT_PRODUCTS_DIR)/LChat.app/LChat BUNDLE_LOADER: $(TEST_HOST) schemes: LChat: build: targets: LChat: all run: config: Debug test: config: Debug targets: - LChatUITests - LChatFeedTests # Needed to archive/export the Mac app at all (see ios/release-mac.sh). LChatMac: build: targets: LChatMac: all run: config: Debug archive: config: Release