-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (37 loc) · 1.12 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
var gulp = require('gulp');
var typescript = require('gulp-tsc');
var ava = require('gulp-ava');
var del = require('del');
var dest_test = "build/output_test";
var fs = require('fs');
var run = require('gulp-run');
var crlf = require('crlf');
gulp.task('preparePublish', ['version'], function(){
return gulp.start('crlf');
});
gulp.task('crlf', function(){
return new Promise((good)=>{
crlf.set('./build/output/ks.js', 'LF', function(err, endingType) {
console.log(endingType);
});
});
});
gulp.task('version', function(){
return run('npm version patch').exec();
});
gulp.task('test',["compile:tests"], function() {
return gulp.src(dest_test + '/tests/runTests/*.js')
.pipe(ava({verbose: true}));
});
gulp.task('compile:tests',["clean:test"], function(){
var tsconfig = JSON.parse(fs.readFileSync('tests/tsconfig.json', 'utf8'));
tsconfig.compilerOptions.outDir = dest_test;
return gulp.src(['tests/**/*.ts'])
.pipe(typescript(tsconfig.compilerOptions))
.pipe(gulp.dest(dest_test));
});
gulp.task('clean:test', function () {
return del([
dest_test + '/**/*'
]);
});