forked from davideberlein/kanboard-presenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (40 loc) · 1.19 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
/* File: gulpfile.js */
// grab our gulp packages
var gulp = require('gulp'),
bower = require('gulp-bower'),
del = require('del'),
_ = require('underscore'),
NwBuilder = require('node-webkit-builder');
var paths = {
src: ['package.json', 'server.js', 'public/**/*', "app/**/*"],
libs: {
node: ['node_modules/**/*', '!node_modules/{bower,del,gulp*,nw,node-webkit-builder}/**/*'],
bower: ['bower_components/**/*']
},
bower: 'bower.json',
build: 'build'
};
gulp.task('bower:clean', function (cb) {
del(paths.libs.bower, cb);
});
gulp.task('bower:build', ['bower:clean'], function () {
return bower();
});
gulp.task('nw:clean', function (cb) {
del(paths.build, cb);
});
gulp.task('nw:build', ['nw:clean'], function (cb) {
var nwBuilder = new NwBuilder({
files: _.flatten([paths.src, paths.libs.node, paths.libs.bower]),
platforms: ['win32', 'win64', 'linux32', 'linux64'],
buildDir: paths.build
});
nwBuilder.on('log', console.log);
nwBuilder.build().then(function () {
console.log("Build Finished");
cb();
}).catch(function (error) {
console.error(error);
cb();
});
});