forked from maidsafe/sn_browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
builderConfig.js
132 lines (120 loc) · 3.18 KB
/
builderConfig.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
121
122
123
124
125
126
127
128
129
130
131
132
const thePackage = require( './package' );
const { platform } = process;
const allPassedArguments = process.argv;
const OSX = 'darwin';
const LINUX = 'linux';
const WINDOWS = 'win32';
// eslint-disable-next-line consistent-return, @typescript-eslint/explicit-function-return-type
const publishedFilePath = () => {
const { name } = thePackage;
if ( platform === LINUX ) {
return `${name}-linux`;
}
if ( platform === WINDOWS ) {
return `${name}-win`;
}
return `${name}-mac`;
};
// eslint-disable-next-line consistent-return, @typescript-eslint/explicit-function-return-type
const getProductName = () => {
let { productName } = thePackage;
if ( thePackage.version.includes( '-alpha' ) ) {
productName = `${productName} Alpha`;
}
if ( thePackage.version.includes( '-beta' ) ) {
productName = `${productName} Beta`;
}
return productName;
};
const buildConfig = {
appId: 'com.electron.safe-browser',
generateUpdatesFilesForAllChannels: true,
artifactName: `${thePackage.name}-v\${version}-\${os}-x64.\${ext}`,
afterPack: './afterPack.js',
afterSign: './afterSign.js',
productName: getProductName(),
files: [
'app/dist/',
'locales',
'app/locales',
'app/app.html',
'app/bg.html',
'app/background.prod.js',
'app/background.prod.js.map',
'app/webPreload.prod.js',
'app/webPreload.prod.js.map',
'app/main.prod.js',
'app/main.prod.js.map',
'package',
'app/extensions/safe/defaultNewSite/index.html'
],
extraResources: [
{
from: 'resources/favicon.ico',
to: 'favicon.ico'
},
{
from: 'resources/locales',
to: 'locales'
},
{
from: 'node_modules/nessie-ui/dist/styles.css',
to: 'nessie-styles.css'
}
],
protocols: {
name: 'SAFE Network URL',
schemes: ['safe']
},
dmg: {
contents: [
{
x: 130,
y: 220
},
{
x: 410,
y: 220,
type: 'link',
path: '/Applications'
}
]
},
win: {
target: ['nsis', 'zip']
},
linux: {
target: ['AppImage', 'zip'],
category: 'Development'
},
mac: {
target: ['dmg', 'pkg', 'zip'],
hardenedRuntime: true,
entitlements: 'resources/entitlements.mac.plist',
entitlementsInherit: 'resources/entitlements.mac.plist',
extendInfo: {
// hide dock icon by default for auto updating
LSUIElement: 1
}
},
directories: {
buildResources: 'resources',
output: 'release'
},
// publish part needed to generate correct release channel yml files
publish: {
provider: 's3',
bucket: 'safe-browser',
path: publishedFilePath()
}
};
// commented out for when we need to build dev
/*
if ( isBuildingDev ) {
buildConfig.extraResources.push( {
from: 'resources/startAsMock',
to: 'startAsMock'
} );
}
*/
module.exports = buildConfig;