@@ -176,7 +176,7 @@ var serverCoreSources = [
176176 "lsHost.ts" ,
177177 "project.ts" ,
178178 "editorServices.ts" ,
179- "protocol.d. ts" ,
179+ "protocol.ts" ,
180180 "session.ts" ,
181181 "server.ts"
182182] . map ( function ( f ) {
@@ -200,14 +200,13 @@ var typingsInstallerSources = [
200200var serverSources = serverCoreSources . concat ( servicesSources ) ;
201201
202202var languageServiceLibrarySources = [
203- "protocol.d. ts" ,
203+ "protocol.ts" ,
204204 "utilities.ts" ,
205205 "scriptVersionCache.ts" ,
206206 "scriptInfo.ts" ,
207207 "lsHost.ts" ,
208208 "project.ts" ,
209209 "editorServices.ts" ,
210- "protocol.d.ts" ,
211210 "session.ts" ,
212211
213212] . map ( function ( f ) {
@@ -261,15 +260,14 @@ var harnessSources = harnessCoreSources.concat([
261260] . map ( function ( f ) {
262261 return path . join ( unittestsDirectory , f ) ;
263262} ) ) . concat ( [
264- "protocol.d. ts" ,
263+ "protocol.ts" ,
265264 "utilities.ts" ,
266265 "scriptVersionCache.ts" ,
267266 "scriptInfo.ts" ,
268267 "lsHost.ts" ,
269268 "project.ts" ,
270269 "typingsCache.ts" ,
271270 "editorServices.ts" ,
272- "protocol.d.ts" ,
273271 "session.ts" ,
274272] . map ( function ( f ) {
275273 return path . join ( serverDirectory , f ) ;
@@ -520,6 +518,40 @@ compileFile(processDiagnosticMessagesJs,
520518 [ ] ,
521519 /*useBuiltCompiler*/ false ) ;
522520
521+ var buildProtocolTs = path . join ( scriptsDirectory , "buildProtocol.ts" ) ;
522+ var buildProtocolJs = path . join ( scriptsDirectory , "buildProtocol.js" ) ;
523+ var buildProtocolDts = path . join ( builtLocalDirectory , "protocol.d.ts" ) ;
524+ var typescriptServicesDts = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
525+
526+ file ( buildProtocolTs ) ;
527+
528+ compileFile ( buildProtocolJs ,
529+ [ buildProtocolTs ] ,
530+ [ buildProtocolTs ] ,
531+ [ ] ,
532+ /*useBuiltCompiler*/ false ,
533+ { noOutFile : true } ) ;
534+
535+ file ( buildProtocolDts , [ buildProtocolTs , buildProtocolJs , typescriptServicesDts ] , function ( ) {
536+
537+ var protocolTs = path . join ( serverDirectory , "protocol.ts" ) ;
538+
539+ var cmd = host + " " + buildProtocolJs + " " + protocolTs + " " + typescriptServicesDts + " " + buildProtocolDts ;
540+ console . log ( cmd ) ;
541+ var ex = jake . createExec ( [ cmd ] ) ;
542+ // Add listeners for output and error
543+ ex . addListener ( "stdout" , function ( output ) {
544+ process . stdout . write ( output ) ;
545+ } ) ;
546+ ex . addListener ( "stderr" , function ( error ) {
547+ process . stderr . write ( error ) ;
548+ } ) ;
549+ ex . addListener ( "cmdEnd" , function ( ) {
550+ complete ( ) ;
551+ } ) ;
552+ ex . run ( ) ;
553+ } , { async : true } )
554+
523555// The generated diagnostics map; built for the compiler and for the 'generate-diagnostics' task
524556file ( diagnosticInfoMapTs , [ processDiagnosticMessagesJs , diagnosticMessagesJson ] , function ( ) {
525557 var cmd = host + " " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson ;
@@ -657,6 +689,8 @@ compileFile(
657689 inlineSourceMap : true
658690 } ) ;
659691
692+ file ( typescriptServicesDts , [ servicesFile ] ) ;
693+
660694var cancellationTokenFile = path . join ( builtLocalDirectory , "cancellationToken.js" ) ;
661695compileFile ( cancellationTokenFile , cancellationTokenSources , [ builtLocalDirectory ] . concat ( cancellationTokenSources ) , /*prefixes*/ [ copyright ] , /*useBuiltCompiler*/ true , { outDir : builtLocalDirectory , noOutFile : true } ) ;
662696
@@ -691,7 +725,7 @@ task("build-fold-end", [], function () {
691725
692726// Local target to build the compiler and services
693727desc ( "Builds the full compiler and services" ) ;
694- task ( "local" , [ "build-fold-start" , "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile , serverFile , builtGeneratedDiagnosticMessagesJSON , "lssl" , "build-fold-end" ] ) ;
728+ task ( "local" , [ "build-fold-start" , "generate-diagnostics" , "lib" , tscFile , servicesFile , nodeDefinitionsFile , serverFile , buildProtocolDts , builtGeneratedDiagnosticMessagesJSON , "lssl" , "build-fold-end" ] ) ;
695729
696730// Local target to build only tsc.js
697731desc ( "Builds only the compiler" ) ;
@@ -747,7 +781,7 @@ task("generate-spec", [specMd]);
747781// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
748782desc ( "Makes a new LKG out of the built js files" ) ;
749783task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
750- var expectedFiles = [ tscFile , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , cancellationTokenFile , typingsInstallerFile ] . concat ( libraryTargets ) ;
784+ var expectedFiles = [ tscFile , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , cancellationTokenFile , typingsInstallerFile , buildProtocolDts ] . concat ( libraryTargets ) ;
751785 var missingFiles = expectedFiles . filter ( function ( f ) {
752786 return ! fs . existsSync ( f ) ;
753787 } ) ;
0 commit comments