forked from minbrowser/min
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
131 lines (126 loc) · 3.79 KB
/
Gruntfile.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
module.exports = function (grunt) {
const packageFile = require('./package.json')
const version = packageFile.version
const electronVersion = packageFile.electronVersion
const ignoredDirs = ['.DS_Store', 'dist/app', /\.map$/g, /\.md$/g] // directories that will be ignored when building binaries
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
electron: {
osxBuild: {
options: {
name: 'Min',
dir: __dirname,
out: 'dist/app',
version: electronVersion,
'app-version': version,
platform: 'darwin',
arch: 'x64',
icon: 'icon.icns',
ignore: ignoredDirs,
prune: true,
overwrite: true,
protocols: [{
name: 'HTTP link',
schemes: ['http', 'https']
}, {
name: 'File',
schemes: ['file']
}]
}
},
windowsBuild: {
options: {
name: 'Min',
dir: __dirname,
out: 'dist/app',
version: electronVersion,
'app-version': version,
platform: 'win32',
arch: 'all',
icon: 'icons/icon256.ico',
ignore: ignoredDirs,
prune: true,
overwrite: true
}
},
linuxBuild: {
options: {
name: 'min',
dir: __dirname,
out: 'dist/app',
version: electronVersion,
'app-version': version,
platform: 'linux',
arch: 'all',
ignore: ignoredDirs,
prune: true,
overwrite: true
}
}
},
'electron-installer-debian': {
options: {
productName: 'Min',
genericName: 'Web Browser',
version: version,
section: 'web',
homepage: 'https://palmeral.github.io/min/',
icon: 'icons/icon256.png',
categories: ['Network', 'WebBrowser'],
mimeType: ['x-scheme-handler/http', 'x-scheme-handler/https', 'text/html'],
maintainer: 'Min Developers <[email protected]>',
description: 'Min is a faster, smarter web browser.',
productDescription: 'A web browser with smarter search, improved tab management, and built-in ad blocking. Includes full-text history search, instant answers from DuckDuckGo, the ability to split tabs into groups, and more.',
depends: [
'gconf2',
'gconf-service',
'gvfs-bin',
'libc6',
'libcap2',
'libgtk2.0-0',
'libudev0 | libudev1',
'libgcrypt11 | libgcrypt20',
'libnotify4',
'libnss3',
'libxtst6',
'python',
'xdg-utils'
]
},
linux32: {
options: {
arch: 'i386'
},
src: 'dist/app/min-linux-ia32',
dest: 'dist/app/linux'
},
linux64: {
options: {
arch: 'amd64'
},
src: 'dist/app/min-linux-x64',
dest: 'dist/app/linux'
}
},
// https://stackoverflow.com/a/47304117/865175
run: {
buildMain: {
exec: 'npm run buildMain --silent'
},
buildBrowser: {
exec: 'npm run buildBrowser --silent'
},
buildPreload: {
exec: 'npm run buildPreload --silent'
}
}
})
grunt.loadNpmTasks('grunt-electron')
grunt.loadNpmTasks('grunt-electron-installer-debian')
grunt.loadNpmTasks('grunt-run')
grunt.registerTask('default', ['run:buildBrowser', 'run:buildPreload', 'run:buildMain'])
grunt.registerTask('macBuild', ['default', 'electron:osxBuild'])
grunt.registerTask('linuxBuild', ['default', 'electron:linuxBuild', 'electron-installer-debian:linux32', 'electron-installer-debian:linux64'])
grunt.registerTask('windowsBuild', ['default', 'electron:windowsBuild'])
}