forked from electron/electron-quick-start
-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
63 lines (56 loc) · 1.67 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
54
55
56
57
58
59
60
61
62
63
var gulp = require('gulp')
var inno = require('gulp-inno');
var electron = require('gulp-electron');
var fs = require('fs');
var gnf = require('./npm-files')
var pkg = require('./package.json')
var compileDir = './compile';
gulp.task('version', function(){
// FIXME(ssx): https://github.com/gulpjs/gulp/blob/master/docs/writing-a-plugin/README.md
var pkg = require('./package.json');
fs.writeFileSync('version.json', JSON.stringify({
version: pkg.version,
}))
})
gulp.task('copy', ['version', 'copy:modules'], function(){
return gulp.src(['*.js', 'package.json', 'index.html', 'icons/**/*'],
{base: './'})
.pipe(gulp.dest(compileDir))
})
gulp.task('copy:modules', function(){
return gulp.src(gnf(), {base: './'}).pipe(gulp.dest(compileDir))
})
gulp.task('electron', ['copy'], function() {
return gulp.src("")
.pipe(electron({
src: './compile',
release: './release',
cache: './.cache',
packageJson: pkg,
packaging: false,
version: 'v1.3.1',
platforms: ['win32-x64'], //'darwin-x64'],
asar: true,
asarUnpackDir: 'vendor',
platformResources: {
win: {
"version-string": pkg.version,
"file-version": pkg.version,
"product-version": pkg.version,
icon: 'icons/app.ico',
},
darwin: {
CFBundleDisplayName: pkg.name,
CFBundleIdentifier: pkg.name,
CFBundleName: pkg.name,
CFBundleVersion: pkg.version,
icon: 'icons/app.icns',
},
}
}))
.pipe(gulp.dest(""));
})
gulp.task('inno', ['electron'], function(){
return gulp.src('./inno.iss').pipe(inno());
})
gulp.task('default', ['copy'])