name: IceGlass
options:
  bundleIdPrefix: dev.rzen.indie
  deploymentTarget:
    macOS: "13.0"
    iOS: "17.0"
  xcodeVersion: "16.0"
  generateEmptyDirectories: true

packages:
  IndieAbout:
    url: https://git.rzen.dev/rzen/indie-about.git
    from: 0.1.0

targets:
  IceGlass:
    type: application
    platform: macOS
    sources:
      - path: Shared
        excludes:
          - Resources/TeamLogos
      - path: Shared/Resources/TeamLogos
        type: folder
        buildPhase: resources
      - path: IceGlass
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: dev.rzen.indie.IceGlass
        MARKETING_VERSION: "1.0.0"
        CURRENT_PROJECT_VERSION: "1"
        INFOPLIST_FILE: IceGlass/Info.plist
        CODE_SIGN_ENTITLEMENTS: IceGlass.entitlements
        DEVELOPMENT_TEAM: C32Z8JNLG6
        SWIFT_VERSION: "6.0"
        MACOSX_DEPLOYMENT_TARGET: "13.0"
        PRODUCT_NAME: IceGlass
        COMBINE_HIDPI_IMAGES: true
        SWIFT_STRICT_CONCURRENCY: complete
        ENABLE_USER_SCRIPT_SANDBOXING: false
        ENABLE_HARDENED_RUNTIME: true
      configs:
        Debug:
          SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUG
        Release:
          SWIFT_OPTIMIZATION_LEVEL: -O
    dependencies:
      - package: IndieAbout
    postCompileScripts:
      - script: "\"${SRCROOT}/Scripts/update_build_number.sh\""
        name: "Update Build Number"
        shell: /bin/sh
        inputFiles:
          - $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
          - $(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Info.plist
    entitlements:
      path: IceGlass.entitlements
      properties:
        com.apple.security.app-sandbox: true
        com.apple.security.network.client: true

  IceGlass-iOS:
    type: application
    platform: iOS
    sources:
      - path: Shared
        excludes:
          - Resources/TeamLogos
      - path: Shared/Resources/TeamLogos
        type: folder
        buildPhase: resources
      - path: IceGlass-iOS
        excludes:
          - Resources
      - path: LICENSE.md
        buildPhase: resources
      - path: CHANGELOG.md
        buildPhase: resources
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: dev.rzen.indie.IceGlass.iOS
        MARKETING_VERSION: "1.0.0"
        CURRENT_PROJECT_VERSION: "1"
        INFOPLIST_FILE: IceGlass-iOS/Info.plist
        DEVELOPMENT_TEAM: C32Z8JNLG6
        SWIFT_VERSION: "6.0"
        IPHONEOS_DEPLOYMENT_TARGET: "17.0"
        TARGETED_DEVICE_FAMILY: "1"
        PRODUCT_NAME: IceGlass
        SWIFT_STRICT_CONCURRENCY: complete
        ENABLE_USER_SCRIPT_SANDBOXING: false
        GENERATE_INFOPLIST_FILE: false
      configs:
        Debug:
          SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUG
        Release:
          SWIFT_OPTIMIZATION_LEVEL: -O
    dependencies:
      - package: IndieAbout

schemes:
  IceGlass:
    build:
      targets:
        IceGlass: all
    run:
      config: Debug
    archive:
      config: Release

  IceGlass-iOS:
    build:
      targets:
        IceGlass-iOS: all
    run:
      config: Debug
    archive:
      config: Release
