@@ -11,6 +11,7 @@ const concat = require("gulp-concat");
11
11
const clone = require ( "gulp-clone" ) ;
12
12
const newer = require ( "gulp-newer" ) ;
13
13
const tsc = require ( "gulp-typescript" ) ;
14
+ const tsc_oop = require ( "./scripts/build/gulp-typescript-oop" ) ;
14
15
const insert = require ( "gulp-insert" ) ;
15
16
const sourcemaps = require ( "gulp-sourcemaps" ) ;
16
17
const Q = require ( "q" ) ;
@@ -409,6 +410,10 @@ function prependCopyright(outputCopyright = !useDebugMode) {
409
410
return insert . prepend ( outputCopyright ? ( copyrightContent || ( copyrightContent = fs . readFileSync ( copyright ) . toString ( ) ) ) : "" ) ;
410
411
}
411
412
413
+ function getCompilerPath ( useBuiltCompiler ) {
414
+ return useBuiltCompiler ? "./built/local/typescript.js" : "./lib/typescript.js" ;
415
+ }
416
+
412
417
gulp . task ( builtLocalCompiler , /*help*/ false , [ servicesFile ] , ( ) => {
413
418
const localCompilerProject = tsc . createProject ( "src/compiler/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
414
419
return localCompilerProject . src ( )
@@ -421,7 +426,7 @@ gulp.task(builtLocalCompiler, /*help*/ false, [servicesFile], () => {
421
426
} ) ;
422
427
423
428
gulp . task ( servicesFile , /*help*/ false , [ "lib" , "generate-diagnostics" ] , ( ) => {
424
- const servicesProject = tsc . createProject ( "src/services/tsconfig.json" , getCompilerSettings ( { removeComments : false } , /*useBuiltCompiler*/ false ) ) ;
429
+ const servicesProject = tsc_oop . createProject ( "src/services/tsconfig.json" , getCompilerSettings ( { removeComments : false } ) , { typescript : getCompilerPath ( /*useBuiltCompiler*/ false ) } ) ;
425
430
const { js, dts} = servicesProject . src ( )
426
431
. pipe ( newer ( servicesFile ) )
427
432
. pipe ( sourcemaps . init ( ) )
@@ -496,7 +501,7 @@ const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js")
496
501
const tsserverLibraryDefinitionFile = path . join ( builtLocalDirectory , "tsserverlibrary.d.ts" ) ;
497
502
498
503
gulp . task ( tsserverLibraryFile , /*help*/ false , [ servicesFile , typesMapJson ] , ( done ) => {
499
- const serverLibraryProject = tsc . createProject ( "src/server/tsconfig.library.json" , getCompilerSettings ( { removeComments : false } , /*useBuiltCompiler*/ true ) ) ;
504
+ const serverLibraryProject = tsc_oop . createProject ( "src/server/tsconfig.library.json" , getCompilerSettings ( { removeComments : false } ) , { typescript : getCompilerPath ( /*useBuiltCompiler*/ true ) } ) ;
500
505
/** @type {{ js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } } */
501
506
const { js, dts} = serverLibraryProject . src ( )
502
507
. pipe ( sourcemaps . init ( ) )
@@ -587,7 +592,7 @@ gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUse
587
592
// Task to build the tests infrastructure using the built compiler
588
593
const run = path . join ( builtLocalDirectory , "run.js" ) ;
589
594
gulp . task ( run , /*help*/ false , [ servicesFile , tsserverLibraryFile ] , ( ) => {
590
- const testProject = tsc . createProject ( "src/harness/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
595
+ const testProject = tsc_oop . createProject ( "src/harness/tsconfig.json" , getCompilerSettings ( { } ) , { typescript : getCompilerPath ( /*useBuiltCompiler*/ true ) } ) ;
591
596
return testProject . src ( )
592
597
. pipe ( newer ( run ) )
593
598
. pipe ( sourcemaps . init ( ) )
0 commit comments