forked from vinsonizer/f3-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·44 lines (36 loc) · 1.16 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
var gulp = require('gulp');
var shell = require('gulp-shell');
var watch = require('gulp-watch');
var jshint = require('gulp-jshint');
var cleanDest = require('gulp-clean-dest');
var srcRoot = './src/';
var cfgRoot = './cfg/';
var libRoot = './lib/';
var buildDir = './build/';
gulp.task('prepare-upload', function() {
gulp.src([srcRoot + '*.js', cfgRoot + '*.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
.pipe(gulp.dest(buildDir));
// No lint on minified downloaded libraries...
gulp.src([libRoot + '*.js'])
.pipe(gulp.dest(buildDir));
});
gulp.task('upload',
shell.task(['gapps upload'], {
cwd: '.'
}));
gulp.task('cleanup', function() {
return cleanDest(buildDir);
});
gulp.task('watch', function() {
return gulp.src([srcRoot + '*.js', cfgRoot +'*.js'])
.pipe(watch([srcRoot + '*.js', cfgRoot +'*.js']))
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(cleanDest(buildDir))
.pipe(gulp.dest(buildDir))
.pipe(gulp.task('upload'));
});
gulp.task('default', ['cleanup', 'prepare-upload', 'upload']);