@@ -12,10 +12,9 @@ const merge2 = require("merge2");
12
12
const mkdirp = require ( "mkdirp" ) ;
13
13
const { src, dest, task, parallel, series, watch } = require ( "gulp" ) ;
14
14
const { append, transform } = require ( "gulp-insert" ) ;
15
- const { browserify } = require ( "./scripts/build/browserify" ) ;
16
15
const { prependFile } = require ( "./scripts/build/prepend" ) ;
17
- const { exec, readJson, needsUpdate, getDiffTool, getDirSize, flatten , rm } = require ( "./scripts/build/utils" ) ;
18
- const { runConsoleTests, cleanTestDirs , writeTestConfigFile , refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require ( "./scripts/build/tests" ) ;
16
+ const { exec, readJson, needsUpdate, getDiffTool, getDirSize, rm } = require ( "./scripts/build/utils" ) ;
17
+ const { runConsoleTests, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require ( "./scripts/build/tests" ) ;
19
18
const { buildProject, cleanProject, watchProject } = require ( "./scripts/build/projects" ) ;
20
19
const cmdLineOptions = require ( "./scripts/build/options" ) ;
21
20
@@ -114,18 +113,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno
114
113
const preBuild = cmdLineOptions . lkg ? lkgPreBuild : localPreBuild ;
115
114
116
115
const buildServices = ( ( ) => {
117
- // flatten the services project
118
- const flattenServicesConfig = async ( ) => flatten ( "src/services/tsconfig.json" , "built/local/typescriptServices.tsconfig.json" , {
119
- compilerOptions : {
120
- "removeComments" : false ,
121
- "stripInternal" : true ,
122
- "declarationMap" : false ,
123
- "outFile" : "typescriptServices.out.js"
124
- }
125
- } ) ;
126
-
127
116
// build typescriptServices.out.js
128
- const buildTypescriptServicesOut = ( ) => buildProject ( "built/local/ typescriptServices. tsconfig.json" , cmdLineOptions ) ;
117
+ const buildTypescriptServicesOut = ( ) => buildProject ( "src/ typescriptServices/ tsconfig.json" , cmdLineOptions ) ;
129
118
130
119
// create typescriptServices.js
131
120
const createTypescriptServicesJs = ( ) => src ( "built/local/typescriptServices.out.js" )
@@ -167,13 +156,13 @@ const buildServices = (() => {
167
156
. pipe ( dest ( "built/local" ) ) ;
168
157
169
158
return series (
170
- flattenServicesConfig ,
171
159
buildTypescriptServicesOut ,
172
160
createTypescriptServicesJs ,
173
161
createTypescriptServicesDts ,
174
162
createTypescriptJs ,
175
163
createTypescriptDts ,
176
- createTypescriptStandaloneDts ) ;
164
+ createTypescriptStandaloneDts ,
165
+ ) ;
177
166
} ) ( ) ;
178
167
task ( "services" , series ( preBuild , buildServices ) ) ;
179
168
task ( "services" ) . description = "Builds the language service" ;
@@ -186,13 +175,13 @@ const cleanServices = async () => {
186
175
await cleanProject ( "built/local/typescriptServices.tsconfig.json" ) ;
187
176
}
188
177
await del ( [
189
- "built/local/typescriptServices.tsconfig.json" ,
190
178
"built/local/typescriptServices.out.js" ,
191
179
"built/local/typescriptServices.out.d.ts" ,
180
+ "built/local/typescriptServices.out.tsbuildinfo" ,
192
181
"built/local/typescriptServices.js" ,
193
182
"built/local/typescript.js" ,
194
183
"built/local/typescript.d.ts" ,
195
- "built/local/typescript_standalone.d.ts" ,
184
+ "built/local/typescript_standalone.d.ts"
196
185
] ) ;
197
186
} ;
198
187
cleanTasks . push ( cleanServices ) ;
@@ -248,20 +237,8 @@ task("watch-min").flags = {
248
237
}
249
238
250
239
const buildLssl = ( ( ) => {
251
- // flatten the server project
252
- const flattenTsServerProject = async ( ) => flatten ( "src/tsserver/tsconfig.json" , "built/local/tsserverlibrary.tsconfig.json" , {
253
- exclude : [ "src/tsserver/server.ts" ] ,
254
- compilerOptions : {
255
- "removeComments" : false ,
256
- "stripInternal" : true ,
257
- "declaration" : true ,
258
- "declarationMap" : false ,
259
- "outFile" : "tsserverlibrary.out.js"
260
- }
261
- } ) ;
262
-
263
240
// build tsserverlibrary.out.js
264
- const buildServerLibraryOut = ( ) => buildProject ( "built/local/ tsserverlibrary. tsconfig.json" , cmdLineOptions ) ;
241
+ const buildServerLibraryOut = ( ) => buildProject ( "src/ tsserverlibrary/ tsconfig.json" , cmdLineOptions ) ;
265
242
266
243
// create tsserverlibrary.js
267
244
const createServerLibraryJs = ( ) => src ( "built/local/tsserverlibrary.out.js" )
@@ -282,10 +259,10 @@ const buildLssl = (() => {
282
259
. pipe ( dest ( "built/local" ) ) ;
283
260
284
261
return series (
285
- flattenTsServerProject ,
286
262
buildServerLibraryOut ,
287
263
createServerLibraryJs ,
288
- createServerLibraryDts ) ;
264
+ createServerLibraryDts ,
265
+ ) ;
289
266
} ) ( ) ;
290
267
task ( "lssl" , series ( preBuild , buildLssl ) ) ;
291
268
task ( "lssl" ) . description = "Builds language service server library" ;
@@ -298,9 +275,9 @@ const cleanLssl = async () => {
298
275
await cleanProject ( "built/local/tsserverlibrary.tsconfig.json" ) ;
299
276
}
300
277
await del ( [
301
- "built/local/tsserverlibrary.tsconfig.json" ,
302
278
"built/local/tsserverlibrary.out.js" ,
303
279
"built/local/tsserverlibrary.out.d.ts" ,
280
+ "built/local/tsserverlibrary.out.tsbuildinfo" ,
304
281
"built/local/tsserverlibrary.js" ,
305
282
"built/local/tsserverlibrary.d.ts" ,
306
283
] ) ;
@@ -454,44 +431,6 @@ task("runtests-parallel").flags = {
454
431
" --built" : "Compile using the built version of the compiler." ,
455
432
} ;
456
433
457
- const buildWebTestServer = ( ) => buildProject ( "tests/webTestServer.tsconfig.json" ) ;
458
- const cleanWebTestServer = ( ) => cleanProject ( "tests/webTestServer.tsconfig.json" ) ;
459
- cleanTasks . push ( cleanWebTestServer ) ;
460
-
461
- const browserifyTests = ( ) => src ( [ "built/local/run.js" ] , { base : "built/local" } )
462
- . pipe ( newer ( "built/local/bundle.js" ) )
463
- . pipe ( sourcemaps . init ( { loadMaps : true } ) )
464
- . pipe ( browserify ( ) )
465
- . pipe ( rename ( "bundle.js" ) )
466
- . pipe ( sourcemaps . write ( "." , /**@type {* }*/ ( { includeContent : false , destPath : "built/local" } ) ) )
467
- . pipe ( dest ( "built/local" ) ) ;
468
-
469
- const runtestsBrowser = async ( ) => {
470
- await cleanTestDirs ( ) ;
471
- const { tests, runners, light } = cmdLineOptions ;
472
- const testConfigFile = "test.config" ;
473
- await del ( [ testConfigFile ] ) ;
474
- if ( tests || runners || light ) {
475
- writeTestConfigFile ( tests , runners , light ) ;
476
- }
477
- const args = [ "tests/webTestServer.js" ] ;
478
- if ( cmdLineOptions . browser ) {
479
- args . push ( cmdLineOptions . browser ) ;
480
- }
481
- if ( tests ) {
482
- args . push ( JSON . stringify ( tests ) ) ;
483
- }
484
- await exec ( process . execPath , args ) ;
485
- } ;
486
-
487
- task ( "runtests-browser" , series ( preBuild , parallel ( buildTests , buildServices , buildLssl , buildWebTestServer ) , browserifyTests , runtestsBrowser ) ) ;
488
- task ( "runtests-browser" ) . description = "Runs the tests using the built run.js file like 'gulp runtests'." ;
489
- task ( "runtests-browser" ) . flags = {
490
- "-t --tests=<regex>" : "pattern for tests to run" ,
491
- "-b --browser=<browser>" : "Either 'IE' or 'chrome'" ,
492
- " --built" : "Compile using the built version of the compiler." ,
493
- } ;
494
-
495
434
task ( "diff" , ( ) => exec ( getDiffTool ( ) , [ refBaseline , localBaseline ] , { ignoreExitCode : true } ) ) ;
496
435
task ( "diff" ) . description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable" ;
497
436
@@ -515,26 +454,6 @@ task("baseline-accept").description = "Makes the most recent test results the ne
515
454
task ( "baseline-accept-rwc" , ( ) => baselineAccept ( localRwcBaseline , refRwcBaseline ) ) ;
516
455
task ( "baseline-accept-rwc" ) . description = "Makes the most recent rwc test results the new baseline, overwriting the old baseline" ;
517
456
518
- // TODO(rbuckton): Determine if 'webhost' is still in use.
519
- const buildWebHost = ( ) => buildProject ( "tests/webhost/webtsc.tsconfig.json" ) ;
520
- task ( "webhost" , series ( lkgPreBuild , buildWebHost ) ) ;
521
- task ( "webhost" ) . description = "Builds the tsc web host" ;
522
-
523
- const cleanWebHost = ( ) => cleanProject ( "tests/webhost/webtsc.tsconfig.json" ) ;
524
- cleanTasks . push ( cleanWebHost ) ;
525
- task ( "clean-webhost" , cleanWebHost ) ;
526
- task ( "clean-webhost" ) . description = "Cleans the outputs of the tsc web host" ;
527
-
528
- // TODO(rbuckton): Determine if 'perftsc' is still in use.
529
- const buildPerfTsc = ( ) => buildProject ( "tests/perftsc.tsconfig.json" ) ;
530
- task ( "perftsc" , series ( lkgPreBuild , buildPerfTsc ) ) ;
531
- task ( "perftsc" ) . description = "Builds augmented version of the compiler for perf tests" ;
532
-
533
- const cleanPerfTsc = ( ) => cleanProject ( "tests/perftsc.tsconfig.json" ) ;
534
- cleanTasks . push ( cleanPerfTsc ) ;
535
- task ( "clean-perftsc" , cleanPerfTsc ) ;
536
- task ( "clean-perftsc" ) . description = "Cleans the outputs of the perftsc project" ;
537
-
538
457
const buildLoggedIO = async ( ) => {
539
458
mkdirp . sync ( "built/local/temp" ) ;
540
459
await exec ( process . execPath , [ "lib/tsc" , "--types" , "--target" , "es5" , "--lib" , "es5" , "--outdir" , "built/local/temp" , "src/harness/loggedIO.ts" ] ) ;
0 commit comments