-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
67 lines (56 loc) · 1.5 KB
/
gulpfile.js
File metadata and controls
67 lines (56 loc) · 1.5 KB
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
/*global -$ */
'use strict';
const gulp = require('gulp')
, vfs = require('vinyl-fs')
, nodemon = require('gulp-nodemon')
, jshint = require('gulp-jshint')
, jscs = require('gulp-jscs')
, babel = require('gulp-babel')
, plumber = require('gulp-plumber')
, manifest = require('./package.json')
, NwBuilder = require('node-webkit-builder')
, config = manifest.babelOptions
, mocha = require('gulp-mocha');
const scriptsSrc = [
'./app/scripts/**/*.js'
, '!./app/scripts/nw/*.js'
, '!./app/scripts/BubblesJS/*.js'
];
gulp.task('jscs', function () {
vfs.src(scriptsSrc)
.pipe(plumber())
.pipe(jscs({
esnext: true,
configPath: '.jscsrc'
}));
});
gulp.task('lint', function () {
vfs.src(scriptsSrc)
.pipe(plumber())
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('dev', ['jscs', 'lint'], function() {
gulp.watch(scriptsSrc, ['jscs', 'lint']);
});
function test() {
return gulp.src(['tests/setup/node.js', 'tests/spec/**/*.js'], {read: false})
.pipe(mocha({reporter: 'dot', globals: config.mochaGlobals}));
}
gulp.task('test', function() {
require('babel/register');
return test();
});
gulp.task('nw', function() {
var nw = new NwBuilder({
files: './app/**/**', // use the glob format
version: 'v0.12.1',
platforms: ['osx32', 'osx64', 'win32', 'win64']
});
nw.on('log', console.log);
nw.build().then(function () {
console.log('all done!');
}).catch(function (error) {
console.error(error);
});
});