@@ -138,7 +138,6 @@ function concatenateFiles(destinationFile, sourceFiles) {
138138}
139139
140140var useDebugMode = true ;
141- var generateDeclarations = false ;
142141var host = ( process . env . host || process . env . TYPESCRIPT_HOST || "node" ) ;
143142var compilerFilename = "tsc.js" ;
144143/* Compiles a file from a list of sources
@@ -149,7 +148,7 @@ var compilerFilename = "tsc.js";
149148 * @param useBuiltCompiler: true to use the built compiler, false to use the LKG
150149 * @param noOutFile: true to compile without using --out
151150 */
152- function compileFile ( outFile , sources , prereqs , prefixes , useBuiltCompiler , noOutFile ) {
151+ function compileFile ( outFile , sources , prereqs , prefixes , useBuiltCompiler , noOutFile , generateDeclarations ) {
153152 file ( outFile , prereqs , function ( ) {
154153 var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory ;
155154 var options = "-removeComments --module commonjs -noImplicitAny " ;
@@ -160,7 +159,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
160159 if ( useDebugMode ) {
161160 options += "--preserveConstEnums " ;
162161 }
163-
162+
164163 var cmd = host + " " + dir + compilerFilename + " " + options + " " ;
165164 cmd = cmd + sources . join ( " " ) + ( ! noOutFile ? " -out " + outFile : "" ) ;
166165 if ( useDebugMode ) {
@@ -187,7 +186,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
187186 fs . unlinkSync ( outFile ) ;
188187 console . log ( "Compilation of " + outFile + " unsuccessful" ) ;
189188 } ) ;
190- ex . run ( ) ;
189+ ex . run ( ) ;
191190 } , { async : true } ) ;
192191}
193192
@@ -242,7 +241,7 @@ file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson],
242241 ex . addListener ( "cmdEnd" , function ( ) {
243242 complete ( ) ;
244243 } ) ;
245- ex . run ( ) ;
244+ ex . run ( ) ;
246245} , { async : true } )
247246
248247
@@ -255,7 +254,8 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
255254compileFile ( tscFile , compilerSources , [ builtLocalDirectory , copyright ] . concat ( compilerSources ) , [ copyright ] , /*useBuiltCompiler:*/ false ) ;
256255
257256var servicesFile = path . join ( builtLocalDirectory , "typescriptServices.js" ) ;
258- compileFile ( servicesFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) , [ copyright ] , /*useBuiltCompiler:*/ true ) ;
257+ var servicesDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
258+ compileFile ( servicesFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) , [ copyright ] , /*useBuiltCompiler:*/ true , /*noOutFile:*/ false , /*generateDeclarations:*/ true ) ;
259259
260260// Local target to build the compiler and services
261261desc ( "Builds the full compiler and services" ) ;
@@ -278,11 +278,6 @@ task("clean", function() {
278278 jake . rmRf ( builtDirectory ) ;
279279} ) ;
280280
281- // generate declarations for compiler and services
282- desc ( "Generate declarations for compiler and services" ) ;
283- task ( "declaration" , function ( ) {
284- generateDeclarations = true ;
285- } ) ;
286281
287282// Generate Markdown spec
288283var word2mdJs = path . join ( scriptsDirectory , "word2md.js" ) ;
@@ -317,7 +312,7 @@ task("generate-spec", [specMd])
317312// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
318313desc ( "Makes a new LKG out of the built js files" ) ;
319314task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
320- var expectedFiles = [ tscFile , servicesFile ] . concat ( libraryTargets ) ;
315+ var expectedFiles = [ tscFile , servicesFile , servicesDefinitionsFile ] . concat ( libraryTargets ) ;
321316 var missingFiles = expectedFiles . filter ( function ( f ) {
322317 return ! fs . existsSync ( f ) ;
323318 } ) ;
@@ -559,7 +554,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
559554 jake . rmRf ( temp ) ;
560555 complete ( ) ;
561556 } ) ;
562- ex . run ( ) ;
557+ ex . run ( ) ;
563558} , { async : true } ) ;
564559
565560var instrumenterPath = harnessDirectory + 'instrumenter.ts' ;
0 commit comments