// @see - https://www.electron.build/configuration/configuration
{
  "$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
  "appId": "com.siddharthvaddem.openscreen",
  "asar": true,
  // .node binaries can't be dlopen'd from inside an asar — must live unpacked.
  "asarUnpack": [
    "**/*.node"
  ],
  "productName": "Openscreen",
  "npmRebuild": true,
  "buildDependenciesFromSource": true,
  "compression": "normal",
  "directories": {
    "output": "release/${version}"
  },
  "files": [
    "dist",
    "dist-electron",
    "!*.png",
    "!preview*.png",
    "!*.md",
    "!README.md",
    "!CONTRIBUTING.md",
    "!LICENSE"
  ],
  // Asset layout contract: "wallpapers/" under resourcesPath must align with
  // assetBaseDir in electron/preload.ts (packaged branch).
  "extraResources": [
    {
      "from": "public/wallpapers",
      "to": "wallpapers"
    }
  ],

  "mac": {
    "notarize": false,
    "hardenedRuntime": true,
    "entitlements": "macos.entitlements",
    "entitlementsInherit": "macos.entitlements",
    "target": [
      {
        "target": "dmg",
        "arch": ["x64", "arm64"]
      }
    ],
    "icon": "icons/icons/mac/icon.icns",
    "artifactName": "${productName}-Mac-${arch}-${version}-Installer.${ext}",
    "extraResources": [
      {
        "from": "electron/native/bin",
        "to": "electron/native/bin",
        "filter": ["darwin-*/*"]
      }
    ],
    "extendInfo": {
      "NSAudioCaptureUsageDescription": "OpenScreen needs audio capture permission to record system audio.",
      "NSMicrophoneUsageDescription": "OpenScreen needs microphone access to record voice audio.",
      "NSCameraUsageDescription": "OpenScreen needs camera access to record webcam video.",
      "NSScreenCaptureUsageDescription": "OpenScreen needs screen recording permission to detect and capture windows.",
      "NSCameraUseContinuityCameraDeviceType": true
    }
  },
  "linux": {
    "target": [
      "AppImage",
      "deb",
      "pacman"
    ],
    "icon": "icons/icons/png",
    "artifactName": "${productName}-Linux-${version}.${ext}",
    "category": "AudioVideo"
  },
  "win": {
    "target": [
      "nsis"
    ],
    "icon": "icons/icons/win/icon.ico",
    "extraResources": [
      {
        "from": "electron/native/bin",
        "to": "electron/native/bin",
        "filter": ["win32-*/*"]
      }
    ]
  },
  "nsis": {
    "oneClick": false,
    "allowToChangeInstallationDirectory": true
  }
}
