forked from Mazzanicolas/quaero-lang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
executable file
·35 lines (30 loc) · 943 Bytes
/
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
var gulp = require("gulp");
var rename = require("gulp-rename");
var run = require("gulp-run");
var sourcemaps = require('gulp-sourcemaps');
var ts = require("gulp-typescript");
var jest = require('gulp-jest').default;
var tsproj = ts.createProject("tsconfig.json");
// Depends on gen-grammar
gulp.task("default", ["test","gen-grammar"], function () {
return tsproj.src()
.pipe(sourcemaps.init())
.pipe(tsproj()).js
.pipe(sourcemaps.write("."))
.pipe(gulp.dest("bin"));
});
// Generates grammar
gulp.task("gen-grammar", function () {
return run("nearleyc src/parser/Grammar.ne -o src/parser/Grammar.ts").exec()
});
gulp.task('test', function () {
return gulp.src('test').pipe(jest({
"preprocessorIgnorePatterns": [
"<rootDir>/dist/", "<rootDir>/node_modules/"
],
"testPathIgnorePatterns":[
"/utils/"
],
"automock": false
}));
});