---
name: Snikket

options:
  postGenCommand: swiftgen

packages:
  RealmSwift:
    url: https://github.com/realm/realm-swift.git
    majorVersion: 10.42.2
  KeychainAccess:
    url: https://github.com/kishikawakatsumi/KeychainAccess.git
    majorVersion: 4.2.2
  SkeletonUI:
    url: https://github.com/CSolanaM/SkeletonUI.git
    majorVersion: 2.0.0

settings:
  DEVELOPMENT_TEAM: U6CKGHL5VR

targets:
  # XMPP client lib
  XMPPSwift:
    type: framework
    platform: iOS
    deploymentTarget: 15.0
    scheme: {}
    sources:
      - path: XMPPSwift
    info:
      path: ./XMPPSwift/Info.plist
      properties:
        CFBundlePackageType: $(PRODUCT_BUNDLE_PACKAGE_TYPE)
    settings:
      DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
      PRODUCT_BUNDLE_IDENTIFIER: imt.narayana.snikket.xmppswift
      DEAD_CODE_STRIPPING: true
    dependencies:
      - sdk: libxml2.tbd
      - framework: Lib/WebRTC.xcframework

  # Shared framework called Engine
  # Engine:
  #   type: framework
  #   platform: iOS
  #   deploymentTarget: 15.0
  #   # platform: [iOS, macOS]
  #   # deploymentTarget:
  #   #   iOS: 15.0
  #   #   macOS: 13.0
  #   scheme: {}
  #   sources:
  #     - path: Engine
  #   info:
  #     path: ./Engine/Info.plist
  #     properties:
  #       CFBundlePackageType: $(PRODUCT_BUNDLE_PACKAGE_TYPE)
  #   settings:
  #     DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
  #     PRODUCT_BUNDLE_IDENTIFIER: imt.narayana.snikket.engine
  #     DEAD_CODE_STRIPPING: true
  #   dependencies:
  #     - package: RealmSwift
  #       link: true
  #     - package: KeychainAccess
  #       link: true
  #     - target: XMPPSwift

  # Notification service here...
  #

  # Sharing service here...
  #

  # iOS App
  Snikket:
    type: application
    platform: iOS
    deploymentTarget: 15.0
    scheme: {}
    info:
      path: Info.plist
      properties:
        UISupportedInterfaceOrientations: [UIInterfaceOrientationPortrait]
        UILaunchStoryboardName: launchscreen.storyboard
        NSAppTransportSecurity:
          NSAllowsArbitraryLoads: true
        # UIViewControllerBasedStatusBarAppearance: NO
        # UIStatusBarStyle: UIStatusBarStyleLightContent
        # NSCameraUsageDescription: Required for document and facial capture
        # NSFaceIDUsageDescription: Required for accessing to account info
        # UIUserInterfaceStyle: Light
    sources:
      - path: Snikket
        excludes:
          - old
          - .idea
    settings:
      TARGETED_DEVICE_FAMILY: 1
      DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
      PRODUCT_BUNDLE_IDENTIFIER: imt.narayana.snikket.ios
      DEAD_CODE_STRIPPING: true
    #  CODE_SIGN_ENTITLEMENTS: Snikket/Snikket.entitlements
    # entitlements:
    #   path: Snikket/Snikket.entitlements
    #   properties:
    #     com.apple.security.application-groups: group.snikket.engine
    #     keychain-access-groups: imt.narayana.snikket.ios
    dependencies:
      - sdk: Security.framework
      # - framework: Lib/WebRTC.xcframework
      - target: XMPPSwift
      # - target: Engine
      - package: RealmSwift
        link: true
      - package: KeychainAccess
        limk: true
      - package: SkeletonUI
        link: true
    preBuildScripts:
      - script: swiftlint
        name: Swiftlint
        basedOnDependencyAnalysis: false
      - script: ./.swiftgen/bin/swiftgen
        name: SwiftGen
        basedOnDependencyAnalysis: false

parallelizeBuild: true
