name: TimeTracker
options:
  bundleIdPrefix: com.timetracker
  deploymentTarget:
    iOS: "17.0"
  xcodeVersion: "15.0"
  generateEmptyDirectories: true

packages:
  SQLite:
    url: https://github.com/stephencelis/SQLite.swift
    version: 0.15.3
  KeychainAccess:
    url: https://github.com/kishikawakatsumi/KeychainAccess
    version: 4.2.2

settings:
  base:
    SWIFT_VERSION: "5.9"
    DEVELOPMENT_TEAM: ""
    CODE_SIGN_IDENTITY: ""
    CODE_SIGNING_REQUIRED: "NO"
    CODE_SIGNING_ALLOWED: "NO"

targets:
  TimeTracker:
    type: application
    platform: iOS
    sources:
      - path: TimeTracker
        excludes:
          - "**/.DS_Store"
    settings:
      base:
        INFOPLIST_FILE: TimeTracker/Info.plist
        PRODUCT_BUNDLE_IDENTIFIER: com.timetracker.app
        MARKETING_VERSION: "1.0.0"
        CURRENT_PROJECT_VERSION: "1"
        ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
        TARGETED_DEVICE_FAMILY: "1,2"
        SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD: "YES"
    dependencies:
      - target: TimeTrackerWidget
        embed: true
      - package: SQLite
        product: SQLite
      - package: KeychainAccess
    entitlements:
      path: TimeTracker/TimeTracker.entitlements
      properties:
        com.apple.security.application-groups:
          - group.com.timetracker.app

  TimeTrackerWidget:
    type: app-extension
    platform: iOS
    sources:
      - path: TimeTrackerWidget
        excludes:
          - "**/.DS_Store"
    settings:
      base:
        INFOPLIST_FILE: TimeTrackerWidget/Info.plist
        PRODUCT_BUNDLE_IDENTIFIER: com.timetracker.app.widget
        MARKETING_VERSION: "1.0.0"
        CURRENT_PROJECT_VERSION: "1"
        SKIP_INSTALL: "YES"
        ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME: WidgetBackground
        CODE_SIGN_ENTITLEMENTS: TimeTrackerWidget/TimeTrackerWidget.entitlements
    dependencies:
      - package: SQLite
        product: SQLite
    entitlements:
      path: TimeTrackerWidget/TimeTrackerWidget.entitlements
      properties:
        com.apple.security.application-groups:
          - group.com.timetracker.app

schemes:
  TimeTracker:
    build:
      targets:
        TimeTracker: all
        TimeTrackerWidget: all
    run:
      config: Debug
    test:
      config: Debug
    profile:
      config: Release
    analyze:
      config: Debug
    archive:
      config: Release
