-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
electron-builder-config.js
120 lines (111 loc) · 2.93 KB
/
electron-builder-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
const OS_ARCH_TYPE = {
amd64: 'amd64',
arm64: 'arm64',
};
const getBinariesSupportedSystemArchitecture = () => {
if (process.arch === 'arm64') {
return OS_ARCH_TYPE.arm64;
}
return OS_ARCH_TYPE.amd64;
};
module.exports = () => {
const getExtraFiles = () => {
const currentSystemArch = getBinariesSupportedSystemArchitecture();
let macResourceBinFilter;
switch (currentSystemArch) {
case OS_ARCH_TYPE.arm64:
macResourceBinFilter = [`${OS_ARCH_TYPE.arm64}/**/*`, `mtp-cli`];
break;
case OS_ARCH_TYPE.amd64:
default:
macResourceBinFilter = [
`${OS_ARCH_TYPE.amd64}/**/*`,
`medieval/${OS_ARCH_TYPE.amd64}/**/*`,
`mtp-cli`,
];
break;
}
return [
{
from: 'build/mac/bin',
to: 'Resources/bin',
filter: macResourceBinFilter,
},
];
};
return {
productName: 'OpenMTP',
appId: 'io.ganeshrvel.openmtp',
forceCodeSigning: true,
// eslint-disable-next-line no-template-curly-in-string
artifactName: '${name}-${version}-${os}-${arch}.${ext}',
copyright: '© Ganesh Rathinavel',
afterPack: './internals/scripts/AfterPack.js',
afterSign: './internals/scripts/Notarize.js',
npmRebuild: false,
publish: [
{
provider: 'github',
owner: 'ganeshrvel',
repo: 'openmtp',
private: false,
},
],
files: [
'app/dist/',
'app/app.html',
'app/main.prod.js',
'app/main.prod.js.map',
'package.json',
],
extraFiles: getExtraFiles(),
mac: {
type: 'distribution',
icon: 'build/icon.icns',
category: 'public.app-category.productivity',
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: './build/entitlements.mac.plist',
entitlementsInherit: './build/entitlements.mac.plist',
extendInfo: {
LSMinimumSystemVersion: '10.11.0',
NSDesktopFolderUsageDescription: 'Desktop folder access',
NSDocumentsFolderUsageDescription: 'Documents folder access',
NSDownloadsFolderUsageDescription: 'Downloads folder access',
NSRemovableVolumesUsageDescription: 'Removable Disk access',
NSPhotoLibraryUsageDescription: 'Photo library access',
},
target: {
target: 'default',
},
},
mas: {
type: 'distribution',
category: 'public.app-category.productivity',
entitlements: 'build/entitlements.mas.plist',
icon: 'build/icon.icns',
binaries: ['dist/mas/OpenMTP.app/Contents/Resources/bin/mtp-cli'],
},
dmg: {
contents: [
{
x: 130,
y: 220,
},
{
x: 410,
y: 220,
type: 'link',
path: '/Applications',
},
],
},
win: {
target: ['nsis'],
},
linux: {
target: ['deb', 'AppImage'],
category: 'public.app-category.productivity',
},
};
};