forked from amitmerchant1990/electron-markdownify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (44 loc) · 1.09 KB
/
gulpfile.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
'use strict';
const fs = require('fs');
const gulp = require('gulp');
const packager = require('electron-packager');
const config = JSON.parse(fs.readFileSync('package.json'));
const appVersion = config.version;
const electronVersion = config.devDependencies['electron'].match(/[\d.]+/)[0];
const options = {
asar: true,
dir: '.',
icon: './app/img/markdownify.icns',
name: 'Markdownify',
out: 'dist',
overwrite: true,
prune: true,
version: electronVersion,
'app-version': appVersion
};
gulp.task('build:osx', (done) => {
options.arch = 'x64';
options.platform = 'darwin';
options['app-bundle-id'] = 'com.amitmerchant.markdownify';
options['helper-bundle-id'] = 'com.amitmerchant.markdownify.helper';
packager(options, (err, paths) => {
if (err) {
console.error(err);
}
done();
});
});
gulp.task('build:linux', () => {
// @TODO
});
gulp.task('build:windows', () => {
options.arch = 'x64';
options.platform = 'win32';
packager(options, (err, paths) => {
if (err) {
console.error(err);
}
done();
});
});
gulp.task('build', ['build:osx', 'build:linux', 'build:windows']);