SophaxChat · Code Richard Metzner

10 · The iPhone and Mac app

project.yml

100 lines · YAML

name: SophaxChat
options:
  bundleIdPrefix: com.sophax
  deploymentTarget:
    iOS: "17.0"
  xcodeVersion: "15.0"
  generateEmptyDirectories: true

settings:
  base:
    SWIFT_VERSION: 5.9
    ENABLE_STRICT_CONCURRENCY_CHECKING: complete
    GCC_OPTIMIZATION_LEVEL: s
    SWIFT_OPTIMIZATION_LEVEL: -O
    # Security hardening
    ENABLE_HARDENED_RUNTIME: YES
    OTHER_SWIFT_FLAGS: "-D SOPHAX_RELEASE"

targets:
  SophaxChat:
    type: application
    platform: iOS
    deploymentTarget: "17.0"
    sources:
      - path: SophaxChat
    dependencies:
      - target: SophaxChatCore
      - framework: Frameworks/tor.xcframework
        embed: true
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.sophax.SophaxChat
        INFOPLIST_FILE: SophaxChat/Info.plist
        CODE_SIGN_ENTITLEMENTS: SophaxChat/SophaxChat.entitlements
        CODE_SIGN_STYLE: Automatic
        DEVELOPMENT_TEAM: ""
        UIApplicationSceneManifest: ""
        SUPPORTS_MAC_CATALYST: YES
        TARGETED_DEVICE_FAMILY: "1,2"
        MACOSX_DEPLOYMENT_TARGET: "14.0"
        DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER: NO
        SWIFT_OBJC_BRIDGING_HEADER: SophaxChat/SophaxChat-Bridging-Header.h
        CLANG_ENABLE_MODULES: YES
        CLANG_ENABLE_OBJC_ARC: YES
        # Exclude Tor ObjC sources from Mac Catalyst — tor.xcframework has no macOS slice
        "EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*]": "TOR*.m TORX25519KeyPair.m NSBundle+GeoIP.m NSCharacterSet+PredefinedSets.m"
    info:
      path: SophaxChat/Info.plist
      properties:
        CFBundleDisplayName: SophaxChat
        CFBundleLocalizations:
          - en
          - cs
        UILaunchScreen:
          UIColorName: "AccentColor"
        NSFaceIDUsageDescription: "SophaxChat uses Face ID to unlock the app when app lock is enabled."
        NSCameraUsageDescription: "SophaxChat uses the camera to take and send photos in encrypted messages."
        NSMicrophoneUsageDescription: "SophaxChat uses the microphone to record encrypted voice messages."
        NSPhotoLibraryUsageDescription: "SophaxChat accesses your photo library to send images in encrypted messages."
        NSLocalNetworkUsageDescription: "SophaxChat uses the local network to discover nearby users and send encrypted messages without internet."
        NSBonjourServices:
          - "_sophax-chat._tcp"
        UIBackgroundModes:
          - bluetooth-central
          - bluetooth-peripheral
          - fetch
          - processing
        BGTaskSchedulerPermittedIdentifiers:
          - com.sophax.mesh-refresh
        CFBundleURLTypes:
          - CFBundleURLName: com.sophax.sophaxchat
            CFBundleURLSchemes:
              - sophaxchat

  SophaxChatCore:
    type: framework
    platform: iOS
    deploymentTarget: "17.0"
    sources:
      - path: Sources/SophaxChatCore
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.sophax.SophaxChatCore
        DEFINES_MODULE: YES
        GENERATE_INFOPLIST_FILE: YES
        SUPPORTS_MAC_CATALYST: YES
        TARGETED_DEVICE_FAMILY: "1,2"
        MACOSX_DEPLOYMENT_TARGET: "14.0"

  SophaxChatCoreTests:
    type: bundle.unit-test
    platform: iOS
    deploymentTarget: "17.0"
    sources:
      - path: Tests/SophaxChatCoreTests
    dependencies:
      - target: SophaxChatCore
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.sophax.SophaxChatCoreTests