-
Notifications
You must be signed in to change notification settings - Fork 25
/
gulpfile.js
44 lines (36 loc) · 1.05 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 tslint = require('gulp-tslint');
var shell = require('gulp-shell');
var bump = require('gulp-bump')
var git = require('gulp-git');
var tag_version = require('gulp-tag-version');
var files = {
src: [
'./src/**/*.ts',
'./bin/**/*.ts'
],
};
function bumpVersion(ver) {
return gulp.src(['./package.json'])
.pipe(bump({ type: ver }))
.pipe(gulp.dest('./'))
.pipe(git.commit('Bump package version'))
.pipe(tag_version());
}
gulp.task('compile', shell.task([
'npm run compile'
]));
gulp.task('tslint', function () {
return gulp.src(files.src)
.pipe(tslint({
formatter: "verbose"
}))
.pipe(tslint.report())
});
gulp.task('test', shell.task([
'npm test'
]));
gulp.task('patch', ['default'], function () { return bumpVersion('patch'); })
gulp.task('minor', ['default'], function () { return bumpVersion('minor'); })
gulp.task('major', ['default'], function () { return bumpVersion('major'); })
gulp.task('default', ['compile', 'tslint']);