@@ -13,17 +13,17 @@ var gulp = require("gulp"),
1313//******************************************************************************
1414//* LINT
1515//******************************************************************************
16- gulp . task ( "lint" , function ( ) {
16+ gulp . task ( "lint" , function ( ) {
1717
1818 var config = {
1919 fornatter : "verbose" ,
2020 emitError : ( process . env . CI ) ? true : false
2121 } ;
2222
2323 return gulp . src ( [
24- "src/**/**.ts" ,
25- "test/**/**.test.ts"
26- ] )
24+ "src/**/**.ts" ,
25+ "test/**/**.test.ts"
26+ ] )
2727 . pipe ( tslint ( config ) )
2828 . pipe ( tslint . report ( ) ) ;
2929} ) ;
@@ -35,12 +35,12 @@ var tsLibProject = tsc.createProject("tsconfig.json", {
3535 module : "commonjs"
3636} ) ;
3737
38- gulp . task ( "build-lib" , function ( ) {
38+ gulp . task ( "build-lib" , function ( ) {
3939 return gulp . src ( [
40- "src/**/*.ts"
41- ] )
40+ "src/**/*.ts"
41+ ] )
4242 . pipe ( tsLibProject ( ) )
43- . on ( "error" , function ( err ) {
43+ . on ( "error" , function ( err ) {
4444 process . exit ( 1 ) ;
4545 } )
4646 . js . pipe ( gulp . dest ( "lib/" ) ) ;
@@ -50,12 +50,12 @@ var tsAmdProject = tsc.createProject("tsconfig.json", {
5050 module : "amd"
5151} ) ;
5252
53- gulp . task ( "build-amd" , function ( ) {
53+ gulp . task ( "build-amd" , function ( ) {
5454 return gulp . src ( [
55- "src/**/*.ts"
56- ] )
55+ "src/**/*.ts"
56+ ] )
5757 . pipe ( tsAmdProject ( ) )
58- . on ( "error" , function ( err ) {
58+ . on ( "error" , function ( err ) {
5959 process . exit ( 1 ) ;
6060 } )
6161 . js . pipe ( gulp . dest ( "amd/" ) ) ;
@@ -66,12 +66,12 @@ var tsEsProject = tsc.createProject("tsconfig.json", {
6666 module : "es2015"
6767} ) ;
6868
69- gulp . task ( "build-es" , function ( ) {
69+ gulp . task ( "build-es" , function ( ) {
7070 return gulp . src ( [
71- "src/**/*.ts"
72- ] )
71+ "src/**/*.ts"
72+ ] )
7373 . pipe ( tsEsProject ( ) )
74- . on ( "error" , function ( err ) {
74+ . on ( "error" , function ( err ) {
7575 process . exit ( 1 ) ;
7676 } )
7777 . js . pipe ( gulp . dest ( "es/" ) ) ;
@@ -82,12 +82,12 @@ var tsDtsProject = tsc.createProject("tsconfig.json", {
8282 noResolve : false
8383} ) ;
8484
85- gulp . task ( "build-dts" , function ( ) {
85+ gulp . task ( "build-dts" , function ( ) {
8686 return gulp . src ( [
87- "src/**/*.ts"
88- ] )
87+ "src/**/*.ts"
88+ ] )
8989 . pipe ( tsDtsProject ( ) )
90- . on ( "error" , function ( err ) {
90+ . on ( "error" , function ( err ) {
9191 process . exit ( 1 ) ;
9292 } )
9393 . dts . pipe ( gulp . dest ( "dts" ) ) ;
@@ -99,66 +99,69 @@ gulp.task("build-dts", function() {
9999//******************************************************************************
100100var tstProject = tsc . createProject ( "tsconfig.json" ) ;
101101
102- gulp . task ( "build-src" , function ( ) {
102+ gulp . task ( "build-src" , function ( ) {
103103 return gulp . src ( [
104- "src/**/*.ts"
105- ] )
104+ "src/**/*.ts"
105+ ] )
106106 . pipe ( tstProject ( ) )
107- . on ( "error" , function ( err ) {
107+ . on ( "error" , function ( err ) {
108108 process . exit ( 1 ) ;
109109 } )
110110 . js . pipe ( gulp . dest ( "src/" ) ) ;
111111} ) ;
112112
113113var tsTestProject = tsc . createProject ( "tsconfig.json" , { rootDir : "./" } ) ;
114114
115- gulp . task ( "build-test" , function ( ) {
115+ gulp . task ( "build-test" , function ( ) {
116116 return gulp . src ( [
117- "test/**/*.ts"
118- ] )
117+ "test/**/*.ts"
118+ ] )
119119 . pipe ( tsTestProject ( ) )
120- . on ( "error" , function ( err ) {
120+ . on ( "error" , function ( err ) {
121121 process . exit ( 1 ) ;
122122 } )
123123 . js . pipe ( gulp . dest ( "./test/" ) ) ;
124124} ) ;
125125
126- gulp . task ( "mocha" , function ( ) {
126+ gulp . task ( "mocha" , function ( ) {
127127 return gulp . src ( [
128- "node_modules/reflect-metadata/Reflect.js" ,
129- "test/**/*.test.js"
130- ] )
128+ "node_modules/reflect-metadata/Reflect.js" ,
129+ "test/**/*.test.js"
130+ ] )
131131 . pipe ( mocha ( {
132132 ui : "bdd"
133133 } ) )
134134 . pipe ( istanbul . writeReports ( ) ) ;
135135} ) ;
136136
137- gulp . task ( "istanbul:hook" , function ( ) {
137+ gulp . task ( "istanbul:hook" , function ( ) {
138138 return gulp . src ( [ "src/**/*.js" ] )
139139 // Covering files
140140 . pipe ( istanbul ( ) )
141141 // Force `require` to return covered files
142142 . pipe ( istanbul . hookRequire ( ) ) ;
143143} ) ;
144144
145- gulp . task ( "test" , function ( cb ) {
146- runSequence ( "istanbul:hook" , "mocha" , cb ) ;
147- } ) ;
145+ gulp . task ( "test" , gulp . series ( "istanbul:hook" , "mocha" ) ) ;
148146
149- gulp . task ( "build" , function ( cb ) {
150- runSequence (
151- "lint" , [ "build-src" , "build-es" , "build-lib" , "build-amd" , "build-dts" ] , // tests + build es and lib
147+ gulp . task ( "build" ,
148+ gulp . series (
149+ "lint" ,
150+ gulp . parallel (
151+ "build-src" ,
152+ "build-es" ,
153+ "build-lib" ,
154+ "build-amd" ,
155+ "build-dts"
156+ ) ,
152157 "build-test" ,
153- cb ) ;
154- } ) ;
158+ )
159+ ) ;
155160
156161//******************************************************************************
157162//* DEFAULT
158163//******************************************************************************
159- gulp . task ( "default" , function ( cb ) {
160- runSequence (
161- "build" ,
162- "test" ,
163- cb ) ;
164- } ) ;
164+ gulp . task ( "default" , gulp . series (
165+ "build" ,
166+ "test" ,
167+ ) ) ;
0 commit comments