name: Monotasker
# Optional YAML overrides (e.g. machine-specific). Team ID: use MonotaskerSigning.local.xcconfig.
include:
  - project.local.yml
options:
  bundleIdPrefix: com.jonplummer
  deploymentTarget:
    iOS: '18.0'
  createIntermediateGroups: true
  # Ensures gitignored MonotaskerSigning.local.xcconfig exists so DEVELOPMENT_TEAM can be set (see README).
  postGenCommand: |
    if [ ! -f Monotasker/Config/MonotaskerSigning.local.xcconfig ]; then
      cp Monotasker/Config/MonotaskerSigning.local.xcconfig.example Monotasker/Config/MonotaskerSigning.local.xcconfig
      echo "Monotasker: created Monotasker/Config/MonotaskerSigning.local.xcconfig — replace XXXXXXXXXX with your Team ID (README → Signing)."
    fi
settings:
  base:
    IPHONEOS_DEPLOYMENT_TARGET: '18.0'
packages:
  TelemetryDeck:
    url: https://github.com/TelemetryDeck/SwiftSDK
    from: 2.0.0
  SnapshotTesting:
    url: https://github.com/pointfreeco/swift-snapshot-testing
    from: 1.17.0
targets:
  Monotasker:
    type: application
    platform: iOS
    # Asset catalogs must be included here (not as generic `resources`) so Xcode runs `actool` and
    # named colors are available in the built app.
    dependencies:
      - package: TelemetryDeck
    sources:
      - path: Monotasker
        excludes:
          - Config/MonotaskerSigning.local.xcconfig.example
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.jonplummer.monotasker
        GENERATE_INFOPLIST_FILE: NO
        INFOPLIST_FILE: Monotasker/App/Info.plist
        ASSETCATALOG_COMPILER_APPICON_NAME: 'Monotasker'
        TARGETED_DEVICE_FAMILY: '1'
        CURRENT_PROJECT_VERSION: '2'
        MARKETING_VERSION: '1.1.0'
        INFOPLIST_KEY_LSApplicationCategoryType: 'public.app-category.productivity'
    configFiles:
      Debug: Monotasker/Config/MonotaskerSigning.xcconfig
      Release: Monotasker/Config/MonotaskerSigning.xcconfig
    scheme:
      testTargets:
        - MonotaskerTests
        - MonotaskerUITests
  MonotaskerUITests:
    type: bundle.ui-testing
    platform: iOS
    sources:
      - path: MonotaskerUITests
    dependencies:
      - target: Monotasker
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.jonplummer.monotasker.uitests
        GENERATE_INFOPLIST_FILE: YES
    configFiles:
      Debug: Monotasker/Config/MonotaskerSigning.xcconfig
      Release: Monotasker/Config/MonotaskerSigning.xcconfig
  MonotaskerTests:
    type: bundle.unit-test
    platform: iOS
    sources:
      - path: MonotaskerTests
    dependencies:
      - target: Monotasker
      - package: SnapshotTesting
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.jonplummer.monotasker.tests
        GENERATE_INFOPLIST_FILE: YES
        TEST_HOST: '$(BUILT_PRODUCTS_DIR)/Monotasker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Monotasker'
    configFiles:
      Debug: Monotasker/Config/MonotaskerSigning.xcconfig
      Release: Monotasker/Config/MonotaskerSigning.xcconfig
