@@ -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/" ;
@@ -64,6 +65,7 @@ var servicesSources = [
6465 return path . join ( compilerDirectory , f ) ;
6566} ) . concat ( [
6667 "breakpoints.ts" ,
68+ "navigateTo.ts" ,
6769 "navigationBar.ts" ,
6870 "outliningElementsCollector.ts" ,
6971 "services.ts" ,
@@ -90,6 +92,16 @@ var servicesSources = [
9092 return path . join ( servicesDirectory , f ) ;
9193} ) ) ;
9294
95+ var serverSources = [
96+ "node.d.ts" ,
97+ "editorServices.ts" ,
98+ "protocol.d.ts" ,
99+ "session.ts" ,
100+ "server.ts"
101+ ] . map ( function ( f ) {
102+ return path . join ( serverDirectory , f ) ;
103+ } ) ;
104+
93105var definitionsRoots = [
94106 "compiler/types.d.ts" ,
95107 "compiler/scanner.d.ts" ,
@@ -130,6 +142,13 @@ var harnessSources = [
130142 "services/preProcessFile.ts"
131143] . map ( function ( f ) {
132144 return path . join ( unittestsDirectory , f ) ;
145+ } ) ) . concat ( [
146+ "protocol.d.ts" ,
147+ "session.ts" ,
148+ "client.ts" ,
149+ "editorServices.ts" ,
150+ ] . map ( function ( f ) {
151+ return path . join ( serverDirectory , f ) ;
133152} ) ) ;
134153
135154var librarySourceMap = [
@@ -327,6 +346,7 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
327346compileFile ( tscFile , compilerSources , [ builtLocalDirectory , copyright ] . concat ( compilerSources ) , [ copyright ] , /*useBuiltCompiler:*/ false ) ;
328347
329348var servicesFile = path . join ( builtLocalDirectory , "typescriptServices.js" ) ;
349+ var nodePackageFile = path . join ( builtLocalDirectory , "typescript.js" ) ;
330350compileFile ( servicesFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) ,
331351 /*prefixes*/ [ copyright ] ,
332352 /*useBuiltCompiler*/ true ,
@@ -336,7 +356,10 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
336356 /*preserveConstEnums*/ true ,
337357 /*keepComments*/ false ,
338358 /*noResolve*/ false ,
339- /*stripInternal*/ false ) ;
359+ /*stripInternal*/ false ,
360+ /*callback*/ function ( ) {
361+ jake . cpR ( servicesFile , nodePackageFile , { silent : true } ) ;
362+ } ) ;
340363
341364var nodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript.d.ts" ) ;
342365var standaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
@@ -378,9 +401,12 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
378401 jake . rmRf ( tempDirPath , { silent : true } ) ;
379402 } ) ;
380403
404+ var serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
405+ compileFile ( serverFile , serverSources , [ builtLocalDirectory , copyright ] . concat ( serverSources ) , /*prefixes*/ [ copyright ] , /*useBuiltCompiler*/ true ) ;
406+
381407// Local target to build the compiler and services
382408desc ( "Builds the full compiler and services" ) ;
383- task ( "local" , [ "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile ] ) ;
409+ task ( "local" , [ "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile , serverFile ] ) ;
384410
385411// Local target to build only tsc.js
386412desc ( "Builds only the compiler" ) ;
@@ -435,7 +461,7 @@ task("generate-spec", [specMd])
435461// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
436462desc ( "Makes a new LKG out of the built js files" ) ;
437463task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
438- var expectedFiles = [ tscFile , servicesFile , nodeDefinitionsFile , standaloneDefinitionsFile , internalNodeDefinitionsFile , internalStandaloneDefinitionsFile ] . concat ( libraryTargets ) ;
464+ var expectedFiles = [ tscFile , servicesFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , internalNodeDefinitionsFile , internalStandaloneDefinitionsFile ] . concat ( libraryTargets ) ;
439465 var missingFiles = expectedFiles . filter ( function ( f ) {
440466 return ! fs . existsSync ( f ) ;
441467 } ) ;
@@ -542,7 +568,7 @@ task("runtests", ["tests", builtLocalDirectory], function() {
542568 }
543569
544570 if ( tests && tests . toLocaleLowerCase ( ) === "rwc" ) {
545- testTimeout = 50000 ;
571+ testTimeout = 100000 ;
546572 }
547573
548574 colors = process . env . colors || process . env . color
0 commit comments