@@ -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 } ) ;
@@ -399,13 +402,18 @@ var importDefinitelyTypedTestsDirectory = path.join(scriptsDirectory, "importDef
399402var importDefinitelyTypedTestsJs = path . join ( importDefinitelyTypedTestsDirectory , "importDefinitelyTypedTests.js" ) ;
400403var importDefinitelyTypedTestsTs = path . join ( importDefinitelyTypedTestsDirectory , "importDefinitelyTypedTests.ts" ) ;
401404
402- file ( importDefinitelyTypedTestsJs ) ;
403- file ( importDefinitelyTypedTestsTs , [ "tsd-scripts" , importDefinitelyTypedTestsJs ] )
404- task ( "importDefinitelyTyped" , importDefinitelyTypedTestsTs , function ( ) {
405- var cmd = "node " + importDefinitelyTypedTestsJs + " ./ ../DefinitelyTyped" ;
405+ file ( importDefinitelyTypedTestsTs ) ;
406+ file ( importDefinitelyTypedTestsJs , [ "tsd-scripts" , importDefinitelyTypedTestsTs ] , function ( ) {
407+ var cmd = host + " " + LKGCompiler + " -p " + importDefinitelyTypedTestsDirectory ;
406408 console . log ( cmd ) ;
407409 exec ( cmd ) ;
408- } , { async : true } )
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 } ) ;
409417
410418// Local target to build the compiler and services
411419var tscFile = path . join ( builtLocalDirectory , compilerFilename ) ;
0 commit comments