forked from tympanix/Electorrent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
63 lines (48 loc) · 1.87 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
'use strict';
const gulp = require('gulp');
const electron = require('electron-connect').server.create();
const useref = require('gulp-useref');
const clean = require('gulp-clean');
const runSequence = require('run-sequence');
const run = require('gulp-run');
const OUT = "./app";
const CLEAN = ['!' + OUT + '/package.json', '!' + OUT + '/node_modules', OUT + '/*'];
gulp.task('serve', function () {
// Start browser process
electron.start('--debug');
// Restart browser process
gulp.watch(['app.js', 'lib/*.js'], electron.restart);
// Reload renderer process
gulp.watch(['main.js', 'index.html', 'css/**/*', 'scripts/**/*', 'views/**/*'], electron.reload);
});
gulp.task('default', ['serve']);
gulp.task('build:clean', function() {
return gulp.src(CLEAN, {read: false})
.pipe(clean());
});
gulp.task('build:concat', function() {
return gulp.src('./*.html')
.pipe(useref())
.pipe(gulp.dest(OUT))
});
gulp.task('build:app', function() {
return gulp.src(['./app.js'])
.pipe(gulp.dest(OUT));
});
gulp.task('build:static', function() {
return gulp.src(['./views/**/*', './lib/**/*', './css/fonts/**/*', './img/**/*'], { base: './'})
.pipe(gulp.dest(OUT))
})
gulp.task('build:assets' , function () {
return gulp.src('./bower_components/semantic/dist/themes/default/assets/**')
.pipe(gulp.dest(OUT + '/css/themes/default/assets'))
});
gulp.task('build', function() {
runSequence('build:clean', ['build:concat', 'build:app', 'build:assets', 'build:static']);
});
gulp.task('pack:win64', ['build'], function(){
return run('electron-packager ./dist Electorrent --icon=./icon.ico --platform=win32 --arch=x64 --out=./build --overwrite').exec()
});
gulp.task('pack:win32', ['build'], function(){
return run('electron-packager ./dist Electorrent --icon=./icon.ico --platform=win32 --arch=ia32 --out=./build --overwrite').exec()
});