-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
62 lines (55 loc) · 1.7 KB
/
Copy pathgulpfile.js
File metadata and controls
62 lines (55 loc) · 1.7 KB
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
53
54
55
56
57
58
59
60
61
62
const gulp = require('gulp');
const ts = require('gulp-typescript');
const jasmine = require('gulp-jasmine');
const clean = require('gulp-clean');
const runSequence = require('run-sequence');
var typedoc = require("gulp-typedoc");
gulp.task("typedoc", function() {
return gulp
.src(["src/**/*.ts"])
.pipe(typedoc({
// TypeScript options (see typescript docs)
module: "commonjs",
target: "es5",
includeDeclarations: false,
ignoreCompilerErrors: true,
exclude : "*.spec.ts",
// Output options (see typedoc docs)
out: "./docs",
// TypeDoc options (see typedoc docs)
name: "hexenginets",
version: false,
}))
;
});
gulp.task('build', function () {
const merge = require('merge2');
const tsProject = ts.createProject('tsconfig.json');
var tsResult = tsProject.src()
.pipe(tsProject());
return merge([
tsResult.dts.pipe(gulp.dest('./definitions')),
tsResult.js.pipe(gulp.dest(tsProject.config.compilerOptions.outDir))
]);
});
gulp.task('clean', function () {
return gulp.src('dist', { read: false })
.pipe(clean());
});
gulp.task('cleandef', function () {
return gulp.src('definitions', { read: false })
.pipe(clean());
});
gulp.task('test:run', function () {
return gulp.src('dist/spec/**')
.pipe(jasmine())
});
gulp.task('watch', ['default'], function () {
gulp.watch('src/**/*.ts', ['default']);
});
gulp.task('test', [], function (cb) {
runSequence('clean','cleandef', 'build', 'test:run', cb);
});
gulp.task('default', [], function (cb) {
runSequence('clean','cleandef', 'build', 'typedoc', cb);
});