# A-6 — real macOS .app target for the DS app shell.
#
# Why this exists: opening Package.swift directly in Xcode produced an *executable* SwiftPM target
# with no .app bundle / Info.plist, so macOS treated it as an accessory and Cmd+R never opened a
# window (see ds-native-app-program memory). This generates a proper application target whose @main
# lives in App/DSApp.swift and which links the AppFeature library product from the local SwiftPM
# package. project.yml is the source of truth; DSApp.xcodeproj + Support/*.plist|.entitlements are
# generated artifacts (gitignored). Regenerate with: xcodegen generate
name: DSApp
options:
  bundleIdPrefix: net.hyungi
  deploymentTarget:
    macOS: "26.0"
  createIntermediateGroups: true
  minimumXcodeGenVersion: "2.40.0"

settings:
  base:
    SWIFT_VERSION: "6.0"               # Swift 6 language mode (matches package .swiftLanguageMode(.v6))
    SWIFT_STRICT_CONCURRENCY: complete
    MACOSX_DEPLOYMENT_TARGET: "26.0"
    CODE_SIGN_STYLE: Automatic
    # Local dev: no signing identity needed to build/run on this Mac.
    CODE_SIGNING_ALLOWED: "NO"
    CODE_SIGNING_REQUIRED: "NO"

packages:
  # Local SwiftPM package = this repo (Package.swift): AIFabric + DSKit + AppFeature libraries.
  DSPackage:
    path: .

targets:
  DSApp:
    type: application
    platform: macOS
    deploymentTarget: "26.0"
    sources:
      - path: App          # App/DSApp.swift only — @main window + DI shell
    dependencies:
      - package: DSPackage
        product: AppFeature
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: net.hyungi.dsapp
        PRODUCT_NAME: DS
        GENERATE_INFOPLIST_FILE: "NO"
        MARKETING_VERSION: "0.1"
        CURRENT_PROJECT_VERSION: "1"
        ENABLE_HARDENED_RUNTIME: "YES"
    info:
      path: Support/Info.plist
      properties:
        CFBundleName: DS
        CFBundleDisplayName: DS
        CFBundleShortVersionString: "0.1"
        CFBundleVersion: "1"
        CFBundlePackageType: APPL
        LSMinimumSystemVersion: "26.0"
        LSApplicationCategoryType: public.app-category.productivity
        NSHumanReadableCopyright: ""
    entitlements:
      path: Support/DSApp.entitlements
      properties:
        com.apple.security.app-sandbox: true
        com.apple.security.network.client: true                 # LiveDSClient HTTP → DS / mac mini :8890
        com.apple.security.files.user-selected.read-write: true # FU-C upload / FU-D download save

schemes:
  DSApp:
    build:
      targets:
        DSApp: all
    run:
      config: Debug
    test:
      config: Debug
