{
  "publish": [
    {
    "provider": "generic",
    "url": "https://releases.mattermost.com/desktop"
    }
  ],
  "appId": "Mattermost.Desktop",
  "artifactName": "${version}/${name}-${version}-${os}-${arch}.${ext}",
  "directories": {
    "buildResources": "src/assets",
    "output": "release"
  },
  "extraMetadata": {
    "main": "index.js"
  },
  "files": [
    "!node_modules/**/*",
    "node_modules/bindings/**/*",
    "node_modules/file-uri-to-path/**/*",
    "node_modules/macos-notification-state/**/*",
    "node_modules/windows-focus-assist/**/*",
    "!**/node_modules/macos-notification-state/bin/**/*",
    "!**/node_modules/macos-notification-state/build/**/*",
    "!**/node_modules/windows-focus-assist/bin/**/*",
    "!**/node_modules/windows-focus-assist/build/**/*",
    "node_modules/macos-notification-state/build/**/*.node",
    "node_modules/windows-focus-assist/build/Release/**/*.node",
    {
      "from": "dist",
      "to": ".",
      "filter": "**/*"
    }
  ],
  "protocols": [
    {
      "name": "Mattermost",
      "schemes": [
        "mattermost"
      ]
    }
  ],
  "beforePack": "scripts/beforepack.js",
  "afterPack": "scripts/afterpack.js",
  "afterAllArtifactBuild": "scripts/afterbuild.js",
  "deb": {
    "artifactName": "${version}/${name}_${version}-1_${arch}.${ext}",
    "synopsis": "Mattermost Desktop App",
    "depends": [
      "libnotify4",
      "libxtst6",
      "libnss3"
    ],
    "priority": "optional"
  },
  "asarUnpack": [
    "./node_modules/macos-notification-state/build/Release/**/*.node",
    "./node_modules/windows-focus-assist/build/Release/**/*.node"
  ],
  "linux": {
    "category": "Network;InstantMessaging",
    "target": [
      "deb",
      "tar.gz",
      "appimage",
      "rpm"
    ],
    "extraFiles": [
      {
        "filter": [
          "LICENSE.txt",
          "NOTICE.txt"
        ]
      },
      {
        "from": "src/assets/linux",
        "filter": [
          "create_desktop_file.sh",
          "app_icon.png",
          "README.md"
        ]
      }
    ]
  },
  "appImage": {
    "executableArgs": [" "]
  },
  "mac": {
    "category": "public.app-category.productivity",
    "target": [
      "zip",
      "dmg"
    ],
    "darkModeSupport": true,
    "extraResources": [
      {
        "filter": [
          "LICENSE.txt",
          "NOTICE.txt"
        ]
      }
    ],
    "hardenedRuntime": true,
    "gatekeeperAssess": true,
    "entitlements": "./resources/mac/entitlements.mac.plist",
    "entitlementsInherit": "./resources/mac/entitlements.mac.inherit.plist",
    "extendInfo": {
      "NSMicrophoneUsageDescription": "Microphone access may be used by Mattermost plugins, such as Jitsi video conferencing.",
      "NSCameraUsageDescription": "Camera access may be used by Mattermost plugins, such as Jitsi video conferencing.",
      "NSFocusStatusUsageDescription": "Focus status is used by Mattermost to determine whether to send notifications or not.",
      "LSFileQuarantineEnabled": true
    }
  },
  "mas": {
    "hardenedRuntime": false,
    "entitlements": "./resources/mac/entitlements.mas.plist",
    "entitlementsInherit": "./resources/mac/entitlements.mas.inherit.plist",
    "entitlementsLoginHelper": "./resources/mac/entitlements.mas.inherit.plist",
    "provisioningProfile": "./mas.provisionprofile",
    "extendInfo": {
      "ITSAppUsesNonExemptEncryption": false,
      "NSUserActivityTypes": ["INSendMessageIntent"]
    },
    "singleArchFiles": "*"
  },
  "masDev": {
    "provisioningProfile": "./dev.provisionprofile"
  },
  "dmg": {
    "background": "src/assets/osx/DMG_BG.png",
    "contents": [
      {
        "x": 135,
        "y": 165
      },
      {
        "x": 407,
        "y": 165,
        "type": "link",
        "path": "/Applications"
      }
    ],
    "iconSize": 120,
    "iconTextSize": 14,
    "window": {
        "height": 380
    }
  },
  "squirrelWindows": {
    "iconUrl": "file://src/assets/icon.ico",
    "artifactName": "${version}/${name}-setup-${version}-${arch}.${ext}"
  },
  "win": {
    "target": [
      "nsis",
      "zip",
      "msi"
    ],
    "extraFiles": [
      {
        "filter": [
          "LICENSE.txt",
          "NOTICE.txt"
        ]
      },
      {
        "from": "resources/windows/gpo",
        "to": "gpo"
      }
    ],
    "signDlls": true,
    "publisherName": "CN=\"Mattermost, Inc.\", O=\"Mattermost, Inc.\", L=Palo Alto, S=California, C=US"
  },
  "nsis": {
    "artifactName": "${version}/${name}-setup-${version}-win.${ext}",
    "packElevateHelper": false,
    "uninstallDisplayName": "${productName}",
    "include": "scripts/installer.nsh"
  },
  "msi": {
    "additionalWixArgs": ["-ext", "WixUtilExtension"],
    "upgradeCode": "{8523DAF0-699D-4CC7-9A65-C5E696A9DE6D}"
  },
  "rpm": {
    "fpm": ["--rpm-rpmbuild-define", "_build_id_links none", "--rpm-digest=sha256"]
  }
}
