@@ -361,7 +361,7 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
361361 /*keepComments*/ true ,
362362 /*noResolve*/ false ,
363363 /*stripInternal*/ true ,
364- /*callback*/ function ( ) {
364+ /*callback*/ function ( ) {
365365 jake . cpR ( servicesFile , nodePackageFile , { silent : true } ) ;
366366
367367 prependFile ( copyright , standaloneDefinitionsFile ) ;
@@ -379,12 +379,12 @@ compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(se
379379
380380var lsslFile = path . join ( builtLocalDirectory , "tslssl.js" ) ;
381381compileFile (
382- lsslFile ,
383- languageServiceLibrarySources ,
382+ lsslFile ,
383+ languageServiceLibrarySources ,
384384 [ builtLocalDirectory , copyright ] . concat ( languageServiceLibrarySources ) ,
385- /*prefixes*/ [ copyright ] ,
386- /*useBuiltCompiler*/ true ,
387- /*noOutFile*/ false ,
385+ /*prefixes*/ [ copyright ] ,
386+ /*useBuiltCompiler*/ true ,
387+ /*noOutFile*/ false ,
388388 /*generateDeclarations*/ true ) ;
389389
390390// Local target to build the language service server library
@@ -488,7 +488,7 @@ var refTest262Baseline = path.join(internalTests, "baselines/test262/reference")
488488desc ( "Builds the test infrastructure using the built compiler" ) ;
489489task ( "tests" , [ "local" , run ] . concat ( libraryTargets ) ) ;
490490
491- function exec ( cmd , completeHandler ) {
491+ function exec ( cmd , completeHandler , errorHandler ) {
492492 var ex = jake . createExec ( [ cmd ] , { windowsVerbatimArguments : true } ) ;
493493 // Add listeners for output and error
494494 ex . addListener ( "stdout" , function ( output ) {
@@ -504,8 +504,12 @@ function exec(cmd, completeHandler) {
504504 complete ( ) ;
505505 } ) ;
506506 ex . addListener ( "error" , function ( e , status ) {
507- fail ( "Process exited with code " + status ) ;
508- } )
507+ if ( errorHandler ) {
508+ errorHandler ( e , status ) ;
509+ } else {
510+ fail ( "Process exited with code " + status ) ;
511+ }
512+ } ) ;
509513
510514 ex . run ( ) ;
511515}
@@ -721,3 +725,16 @@ task("update-sublime", [serverFile], function() {
721725 jake . cpR ( serverFile , "../TypeScript-Sublime-Plugin/tsserver/" ) ;
722726 jake . cpR ( serverFile + ".map" , "../TypeScript-Sublime-Plugin/tsserver/" ) ;
723727} ) ;
728+
729+ // if the codebase were free of linter errors we could make jake runtests
730+ // run this task automatically
731+ desc ( "Runs tslint on the compiler sources" ) ;
732+ task ( "lint" , [ ] , function ( ) {
733+ for ( var f of compilerSources ) {
734+ var cmd = 'tslint -f ' + f ;
735+ exec ( cmd ,
736+ function ( ) { console . log ( 'SUCCESS: No linter errors' ) ; } ,
737+ function ( ) { console . log ( 'FAILURE: Please fix linting errors in ' + f + '\n' ) ;
738+ } ) ;
739+ }
740+ } , { async : true } ) ;
0 commit comments