-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
52 lines (45 loc) · 1.31 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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
jasmine = require('gulp-jasmine'),
markdown = require('gulp-markdown'),
coverage = require('gulp-coverage'),
coveralls = require('gulp-coveralls');
var filePaths = [
'web/jquery.min.js',
'lib/WutController.js',
'lib/AlertController.js',
'web/startup.js'
];
gulp.task('minify',function() {
return gulp.src(filePaths)
.pipe(uglify())
.pipe(concat('all.min.js'))
.pipe(gulp.dest('./build'));
});
gulp.task('dev',function() {
return gulp.src(filePaths)
.pipe(concat('all.min.js'))
.pipe(gulp.dest('./build'));
});
gulp.task('readme',function() {
return gulp.src('README.md')
.pipe(markdown())
.pipe(gulp.dest('./docs/'));
});
gulp.task('test',function() {
return gulp.src('spec/wuttest.js')
.pipe(coverage.instrument({
pattern: ['lib/*.js'],
debugDirectory: 'debug'
}))
.pipe(jasmine())
.pipe(coverage.gather())
.pipe(coverage.format([{reporter:'html'},{reporter:'lcov'}]))
.pipe(gulp.dest('reports'));
});
gulp.task('coveralls',function() {
return gulp.src('./reports/coverage.lcov')
.pipe(coveralls());
});
gulp.task('default',['minify','readme']);