@@ -8,6 +8,7 @@ var child_process = require("child_process");
88// Variables
99var compilerDirectory = "src/compiler/" ;
1010var servicesDirectory = "src/services/" ;
11+ var serverDirectory = "src/server/" ;
1112var harnessDirectory = "src/harness/" ;
1213var libraryDirectory = "src/lib/" ;
1314var scriptsDirectory = "scripts/" ;
@@ -90,6 +91,16 @@ var servicesSources = [
9091 return path . join ( servicesDirectory , f ) ;
9192} ) ) ;
9293
94+ var serverSources = [
95+ "node.d.ts" ,
96+ "editorServices.ts" ,
97+ "protocol.d.ts" ,
98+ "session.ts" ,
99+ "server.ts"
100+ ] . map ( function ( f ) {
101+ return path . join ( serverDirectory , f ) ;
102+ } ) ;
103+
93104var definitionsRoots = [
94105 "compiler/types.d.ts" ,
95106 "compiler/scanner.d.ts" ,
@@ -130,6 +141,13 @@ var harnessSources = [
130141 "services/preProcessFile.ts"
131142] . map ( function ( f ) {
132143 return path . join ( unittestsDirectory , f ) ;
144+ } ) ) . concat ( [
145+ "protocol.d.ts" ,
146+ "session.ts" ,
147+ "client.ts" ,
148+ "editorServices.ts" ,
149+ ] . map ( function ( f ) {
150+ return path . join ( serverDirectory , f ) ;
133151} ) ) ;
134152
135153var librarySourceMap = [
@@ -327,6 +345,7 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
327345compileFile ( tscFile , compilerSources , [ builtLocalDirectory , copyright ] . concat ( compilerSources ) , [ copyright ] , /*useBuiltCompiler:*/ false ) ;
328346
329347var servicesFile = path . join ( builtLocalDirectory , "typescriptServices.js" ) ;
348+ var nodePackageFile = path . join ( builtLocalDirectory , "typescript.js" ) ;
330349compileFile ( servicesFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) ,
331350 /*prefixes*/ [ copyright ] ,
332351 /*useBuiltCompiler*/ true ,
@@ -336,7 +355,10 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
336355 /*preserveConstEnums*/ true ,
337356 /*keepComments*/ false ,
338357 /*noResolve*/ false ,
339- /*stripInternal*/ false ) ;
358+ /*stripInternal*/ false ,
359+ /*callback*/ function ( ) {
360+ jake . cpR ( servicesFile , nodePackageFile , { silent : true } ) ;
361+ } ) ;
340362
341363var nodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript.d.ts" ) ;
342364var standaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
@@ -378,9 +400,12 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
378400 jake . rmRf ( tempDirPath , { silent : true } ) ;
379401 } ) ;
380402
403+ var serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
404+ compileFile ( serverFile , serverSources , [ builtLocalDirectory , copyright ] . concat ( serverSources ) , /*prefixes*/ [ copyright ] , /*useBuiltCompiler*/ true ) ;
405+
381406// Local target to build the compiler and services
382407desc ( "Builds the full compiler and services" ) ;
383- task ( "local" , [ "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile ] ) ;
408+ task ( "local" , [ "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile , serverFile ] ) ;
384409
385410// Local target to build only tsc.js
386411desc ( "Builds only the compiler" ) ;
@@ -435,7 +460,7 @@ task("generate-spec", [specMd])
435460// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
436461desc ( "Makes a new LKG out of the built js files" ) ;
437462task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
438- var expectedFiles = [ tscFile , servicesFile , nodeDefinitionsFile , standaloneDefinitionsFile , internalNodeDefinitionsFile , internalStandaloneDefinitionsFile ] . concat ( libraryTargets ) ;
463+ var expectedFiles = [ tscFile , servicesFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , internalNodeDefinitionsFile , internalStandaloneDefinitionsFile ] . concat ( libraryTargets ) ;
439464 var missingFiles = expectedFiles . filter ( function ( f ) {
440465 return ! fs . existsSync ( f ) ;
441466 } ) ;
@@ -542,7 +567,7 @@ task("runtests", ["tests", builtLocalDirectory], function() {
542567 }
543568
544569 if ( tests && tests . toLocaleLowerCase ( ) === "rwc" ) {
545- testTimeout = 50000 ;
570+ testTimeout = 100000 ;
546571 }
547572
548573 colors = process . env . colors || process . env . color
0 commit comments