2017-03-23 09:51:12 +03:00
|
|
|
var gulp = require("gulp");
|
|
|
|
var karma = require('karma');
|
|
|
|
var ts = require("gulp-typescript");
|
|
|
|
var tsProject = ts.createProject("tsconfig.json");
|
|
|
|
var tslint = require("gulp-tslint");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Compile the source and ship to dist folder
|
|
|
|
*/
|
|
|
|
gulp.task("compile:dist", function () {
|
|
|
|
return tsProject.src()
|
|
|
|
.pipe(tsProject())
|
|
|
|
.js.pipe(gulp.dest("dist"));
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run test once and exit
|
|
|
|
*/
|
|
|
|
gulp.task('test', function (done) {
|
|
|
|
new karma.Server({
|
|
|
|
configFile: __dirname + '/karma.conf.js',
|
|
|
|
singleRun: true
|
|
|
|
}, done).start();
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run lint on source and spec
|
|
|
|
*/
|
|
|
|
gulp.task('lint', () => {
|
2017-03-23 13:12:18 +03:00
|
|
|
return gulp.src(['src/**/*.ts', 'test/**/*.ts'])
|
2017-03-23 09:51:12 +03:00
|
|
|
.pipe(tslint({
|
|
|
|
formatter: "verbose"
|
|
|
|
}))
|
|
|
|
.pipe(tslint.report())
|
|
|
|
});
|