@@ -59,30 +59,38 @@ const publicApiArgs = [
59
59
'--onStabilityMissing' , 'error'
60
60
] . concat ( entrypoints ) ;
61
61
62
+ gulp . task ( 'build.sh' , ( done ) => {
63
+ const childProcess = require ( 'child_process' ) ;
64
+
65
+ childProcess . exec ( path . join ( __dirname , 'build.sh' ) , error => done ( error ) ) ;
66
+ } ) ;
67
+
62
68
// Note that these two commands work on built d.ts files instead of the source
63
69
gulp . task ( 'public-api:enforce' , ( done ) => {
64
- const child_process = require ( 'child_process' ) ;
65
- child_process
66
- . spawn (
67
- path . join ( __dirname , `/node_modules/.bin/ts-api-guardian${ / ^ w i n / . test ( os . platform ( ) ) ? '.cmd' : '' } ` ) ,
68
- [ '--verifyDir' , publicApiDir ] . concat ( publicApiArgs ) , { stdio : 'inherit' } )
69
- . on ( 'close' , ( errorCode ) => {
70
- if ( errorCode !== 0 ) {
71
- done ( new Error (
72
- 'Public API differs from golden file. Please run `gulp public-api:update`.' ) ) ;
73
- } else {
74
- done ( ) ;
75
- }
76
- } ) ;
70
+ const childProcess = require ( 'child_process' ) ;
71
+
72
+ childProcess
73
+ . spawn (
74
+ path . join ( __dirname , `/node_modules/.bin/ts-api-guardian${ / ^ w i n / . test ( os . platform ( ) ) ? '.cmd' : '' } ` ) ,
75
+ [ '--verifyDir' , publicApiDir ] . concat ( publicApiArgs ) , { stdio : 'inherit' } )
76
+ . on ( 'close' , ( errorCode ) => {
77
+ if ( errorCode !== 0 ) {
78
+ done ( new Error (
79
+ 'Public API differs from golden file. Please run `gulp public-api:update`.' ) ) ;
80
+ } else {
81
+ done ( ) ;
82
+ }
83
+ } ) ;
77
84
} ) ;
78
85
79
- gulp . task ( 'public-api:update' , ( done ) => {
80
- const child_process = require ( 'child_process' ) ;
81
- child_process
82
- . spawn (
83
- path . join ( __dirname , `/node_modules/.bin/ts-api-guardian${ / ^ w i n / . test ( os . platform ( ) ) ? '.cmd' : '' } ` ) ,
84
- [ '--outDir' , publicApiDir ] . concat ( publicApiArgs ) , { stdio : 'inherit' } )
85
- . on ( 'close' , ( errorCode ) => done ( errorCode ) ) ;
86
+ gulp . task ( 'public-api:update' , [ 'build.sh' ] , ( done ) => {
87
+ const childProcess = require ( 'child_process' ) ;
88
+
89
+ childProcess
90
+ . spawn (
91
+ path . join ( __dirname , `/node_modules/.bin/ts-api-guardian${ / ^ w i n / . test ( os . platform ( ) ) ? '.cmd' : '' } ` ) ,
92
+ [ '--outDir' , publicApiDir ] . concat ( publicApiArgs ) , { stdio : 'inherit' } )
93
+ . on ( 'close' , ( errorCode ) => done ( errorCode ) ) ;
86
94
} ) ;
87
95
88
96
gulp . task ( 'lint' , [ 'format:enforce' , 'tools:build' ] , ( ) => {
@@ -102,7 +110,7 @@ gulp.task('lint', ['format:enforce', 'tools:build'], () => {
102
110
gulp . task ( 'tools:build' , ( done ) => { tsc ( 'tools/' , done ) ; } ) ;
103
111
104
112
gulp . task ( 'check-cycle' , ( done ) => {
105
- var madge = require ( 'madge' ) ;
113
+ const madge = require ( 'madge' ) ;
106
114
107
115
var dependencyObject = madge ( [ 'dist/all/' ] , {
108
116
format : 'cjs' ,
@@ -149,9 +157,9 @@ gulp.task('changelog', () => {
149
157
} ) ;
150
158
151
159
function tsc ( projectPath , done ) {
152
- let child_process = require ( 'child_process' ) ;
160
+ const childProcess = require ( 'child_process' ) ;
153
161
154
- child_process
162
+ childProcess
155
163
. spawn (
156
164
path . normalize ( `${ __dirname } /node_modules/.bin/tsc` ) + ( / ^ w i n / . test ( os . platform ( ) ) ? '.cmd' : '' ) ,
157
165
[ '-p' , path . join ( __dirname , projectPath ) ] ,
0 commit comments