@@ -206,6 +206,9 @@ function concatenateFiles(destinationFile, sourceFiles) {
206206var useDebugMode = true ;
207207var host = ( process . env . host || process . env . TYPESCRIPT_HOST || "node" ) ;
208208var compilerFilename = "tsc.js" ;
209+ var LKGCompiler = path . join ( LKGDirectory , compilerFilename ) ;
210+ var builtLocalCompiler = path . join ( builtLocalDirectory , compilerFilename ) ;
211+
209212/* Compiles a file from a list of sources
210213 * @param outFile: the target file name
211214 * @param sources: an array of the names of the source files
@@ -220,7 +223,7 @@ var compilerFilename = "tsc.js";
220223 */
221224function compileFile ( outFile , sources , prereqs , prefixes , useBuiltCompiler , noOutFile , generateDeclarations , outDir , preserveConstEnums , keepComments , noResolve , stripInternal , callback ) {
222225 file ( outFile , prereqs , function ( ) {
223- var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory ;
226+ var compilerPath = useBuiltCompiler ? builtLocalCompiler : LKGCompiler ;
224227 var options = "--module commonjs --noImplicitAny --noEmitOnError" ;
225228
226229 // Keep comments when specifically requested
@@ -257,7 +260,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
257260 options += " --stripInternal"
258261 }
259262
260- var cmd = host + " " + dir + compilerFilename + " " + options + " " ;
263+ var cmd = host + " " + compilerPath + " " + options + " " ;
261264 cmd = cmd + sources . join ( " " ) ;
262265 console . log ( cmd + "\n" ) ;
263266
@@ -328,7 +331,7 @@ compileFile(processDiagnosticMessagesJs,
328331
329332// The generated diagnostics map; built for the compiler and for the 'generate-diagnostics' task
330333file ( diagnosticInfoMapTs , [ processDiagnosticMessagesJs , diagnosticMessagesJson ] , function ( ) {
331- var cmd = "node " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson ;
334+ var cmd = host + " " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson ;
332335 console . log ( cmd ) ;
333336 var ex = jake . createExec ( [ cmd ] ) ;
334337 // Add listeners for output and error
@@ -374,7 +377,7 @@ task("setDebugMode", function() {
374377} ) ;
375378
376379task ( "configure-nightly" , [ configureNightlyJs ] , function ( ) {
377- var cmd = "node " + configureNightlyJs + " " + packageJson + " " + programTs ;
380+ var cmd = host + " " + configureNightlyJs + " " + packageJson + " " + programTs ;
378381 console . log ( cmd ) ;
379382 exec ( cmd ) ;
380383} , { async : true } ) ;
@@ -386,6 +389,32 @@ task("publish-nightly", ["configure-nightly", "LKG", "clean", "setDebugMode", "r
386389 exec ( cmd ) ;
387390} ) ;
388391
392+ var scriptsTsdJson = path . join ( scriptsDirectory , "tsd.json" ) ;
393+ file ( scriptsTsdJson ) ;
394+
395+ task ( "tsd-scripts" , [ scriptsTsdJson ] , function ( ) {
396+ var cmd = "tsd --config " + scriptsTsdJson + " install" ;
397+ console . log ( cmd )
398+ exec ( cmd ) ;
399+ } , { async : true } )
400+
401+ var importDefinitelyTypedTestsDirectory = path . join ( scriptsDirectory , "importDefinitelyTypedTests" ) ;
402+ var importDefinitelyTypedTestsJs = path . join ( importDefinitelyTypedTestsDirectory , "importDefinitelyTypedTests.js" ) ;
403+ var importDefinitelyTypedTestsTs = path . join ( importDefinitelyTypedTestsDirectory , "importDefinitelyTypedTests.ts" ) ;
404+
405+ file ( importDefinitelyTypedTestsTs ) ;
406+ file ( importDefinitelyTypedTestsJs , [ "tsd-scripts" , importDefinitelyTypedTestsTs ] , function ( ) {
407+ var cmd = host + " " + LKGCompiler + " -p " + importDefinitelyTypedTestsDirectory ;
408+ console . log ( cmd ) ;
409+ exec ( cmd ) ;
410+ } , { async : true } ) ;
411+
412+ task ( "importDefinitelyTypedTests" , [ importDefinitelyTypedTestsJs ] , function ( ) {
413+ var cmd = host + " " + importDefinitelyTypedTestsJs + " ./ ../DefinitelyTyped" ;
414+ console . log ( cmd ) ;
415+ exec ( cmd ) ;
416+ } , { async : true } ) ;
417+
389418// Local target to build the compiler and services
390419var tscFile = path . join ( builtLocalDirectory , compilerFilename ) ;
391420compileFile ( tscFile , compilerSources , [ builtLocalDirectory , copyright ] . concat ( compilerSources ) , [ copyright ] , /*useBuiltCompiler:*/ false ) ;
0 commit comments