forked from Ezelia/eureca.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
81 lines (65 loc) · 2.27 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Include gulp
const gulp = require('gulp');
const ts = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
const Jasmine = require('jasmine');
const JasmineConsoleReporter = require('jasmine-console-reporter');
let buildTarget = 'ES6';
gulp.task('build-client-lib', () => {
var tsResult = gulp.src('src/Client.class.ts')
//.pipe(sourcemaps.init())
.pipe(ts({
noImplicitAny: false,
declarationFiles: false,
sourceMap: false,
target: buildTarget,
removeComments:true,
out: 'EurecaClient.js'
}));
return tsResult.js
//.pipe(sourcemaps.write())
.pipe(gulp.dest('lib'));
});
gulp.task('build-server-lib', () => {
var tsResult = gulp.src('src/Server.class.ts')
//.pipe(sourcemaps.init())
.pipe(ts({
noImplicitAny: false,
declarationFiles: false,
sourceMap: false,
target: buildTarget,
removeComments: true,
out: 'EurecaServer.js'
}));
return tsResult.js
//.pipe(sourcemaps.write())
.pipe(gulp.dest('lib'));
});
gulp.task('test', (done) => {
// setup Jasmine
const jasmine = new Jasmine();
jasmine.loadConfig({
spec_dir: 'spec',
spec_files: ['**/*[sS]pec.js'],
helpers: ['helpers/**/*.js'],
random: false,
seed: null,
stopSpecOnExpectationFailure: false
});
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
// setup console reporter
const reporter = new JasmineConsoleReporter({
colors: 1, // (0|false)|(1|true)|2
cleanStack: 1, // (0|false)|(1|true)|2|3
verbosity: 4, // (0|false)|1|2|(3|true)|4
listStyle: 'indent', // "flat"|"indent"
activity: false
});
// initialize and execute
jasmine.onComplete(passed => {done()});
jasmine.env.clearReporters();
jasmine.addReporter(reporter);
jasmine.execute();
});
gulp.task('build-all', gulp.series((done) => {buildTarget = 'ES6'; done()}, 'build-server-lib', 'build-client-lib'));
//gulp.task('es5-build-all', gulp.series((done) => {buildTarget = 'ES5'; done()}, 'build-server-lib', 'build-client-lib'));