name: MLXServer
options:
  bundleIdPrefix: com.mlxserver
  deploymentTarget:
    macOS: "15.0"
  xcodeVersion: "16.4"
  minimumXcodeGenVersion: "2.40"

packages:
  mlx-swift-lm:
    url: https://github.com/ml-explore/mlx-swift-lm
    branch: main
  MarkdownUI:
    url: https://github.com/gonzalezreal/swift-markdown-ui
    from: "2.4.0"

targets:
  MLXServer:
    type: application
    platform: macOS
    sources:
      - MLXServer
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: de.rfc1437.mlxserver
        PRODUCT_NAME: MLX Server
        MARKETING_VERSION: "1.0.0"
        CURRENT_PROJECT_VERSION: "1"
        SWIFT_VERSION: "6.0"
        MACOSX_DEPLOYMENT_TARGET: "15.0"
        GENERATE_INFOPLIST_FILE: "NO"
        INFOPLIST_FILE: MLXServer/Info.plist
        CODE_SIGN_ENTITLEMENTS: MLXServer/MLXServer.entitlements
        CODE_SIGN_IDENTITY: "-"
        CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION: "YES"
    dependencies:
      - package: mlx-swift-lm
        product: MLXLLM
      - package: mlx-swift-lm
        product: MLXVLM
      - package: mlx-swift-lm
        product: MLXLMCommon
      - package: MarkdownUI
        product: MarkdownUI
  MLXServerTests:
    type: bundle.unit-test
    platform: macOS
    sources:
      - MLXServerTests
    settings:
      base:
        GENERATE_INFOPLIST_FILE: "YES"
        TEST_HOST: "$(BUILT_PRODUCTS_DIR)/MLX Server.app/Contents/MacOS/MLX Server"
        BUNDLE_LOADER: "$(TEST_HOST)"
    dependencies:
      - target: MLXServer

schemes:
  MLXServer:
    build:
      targets:
        MLXServer: all
        MLXServerTests: [test]
    test:
      targets:
        - MLXServerTests
