@@ -113,7 +113,7 @@ var languageServiceLibrarySources = [
113113 return path . join ( serverDirectory , f ) ;
114114} ) . concat ( servicesSources ) ;
115115
116- var harnessSources = [
116+ var harnessCoreSources = [
117117 "harness.ts" ,
118118 "sourceMapRecorder.ts" ,
119119 "harnessLanguageService.ts" ,
@@ -129,7 +129,9 @@ var harnessSources = [
129129 "runner.ts"
130130] . map ( function ( f ) {
131131 return path . join ( harnessDirectory , f ) ;
132- } ) . concat ( [
132+ } ) ;
133+
134+ var harnessSources = harnessCoreSources . concat ( [
133135 "incrementalParser.ts" ,
134136 "jsDocParsing.ts" ,
135137 "services/colorization.ts" ,
@@ -361,7 +363,7 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
361363 /*keepComments*/ true ,
362364 /*noResolve*/ false ,
363365 /*stripInternal*/ true ,
364- /*callback*/ function ( ) {
366+ /*callback*/ function ( ) {
365367 jake . cpR ( servicesFile , nodePackageFile , { silent : true } ) ;
366368
367369 prependFile ( copyright , standaloneDefinitionsFile ) ;
@@ -379,12 +381,12 @@ compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(se
379381
380382var lsslFile = path . join ( builtLocalDirectory , "tslssl.js" ) ;
381383compileFile (
382- lsslFile ,
383- languageServiceLibrarySources ,
384+ lsslFile ,
385+ languageServiceLibrarySources ,
384386 [ builtLocalDirectory , copyright ] . concat ( languageServiceLibrarySources ) ,
385- /*prefixes*/ [ copyright ] ,
386- /*useBuiltCompiler*/ true ,
387- /*noOutFile*/ false ,
387+ /*prefixes*/ [ copyright ] ,
388+ /*useBuiltCompiler*/ true ,
389+ /*noOutFile*/ false ,
388390 /*generateDeclarations*/ true ) ;
389391
390392// Local target to build the language service server library
@@ -488,7 +490,7 @@ var refTest262Baseline = path.join(internalTests, "baselines/test262/reference")
488490desc ( "Builds the test infrastructure using the built compiler" ) ;
489491task ( "tests" , [ "local" , run ] . concat ( libraryTargets ) ) ;
490492
491- function exec ( cmd , completeHandler ) {
493+ function exec ( cmd , completeHandler , errorHandler ) {
492494 var ex = jake . createExec ( [ cmd ] , { windowsVerbatimArguments : true } ) ;
493495 // Add listeners for output and error
494496 ex . addListener ( "stdout" , function ( output ) {
@@ -504,8 +506,12 @@ function exec(cmd, completeHandler) {
504506 complete ( ) ;
505507 } ) ;
506508 ex . addListener ( "error" , function ( e , status ) {
507- fail ( "Process exited with code " + status ) ;
508- } )
509+ if ( errorHandler ) {
510+ errorHandler ( e , status ) ;
511+ } else {
512+ fail ( "Process exited with code " + status ) ;
513+ }
514+ } ) ;
509515
510516 ex . run ( ) ;
511517}
@@ -562,7 +568,7 @@ task("runtests", ["tests", builtLocalDirectory], function() {
562568 colors = process . env . colors || process . env . color
563569 colors = colors ? ' --no-colors ' : ' --colors ' ;
564570 tests = tests ? ' -g ' + tests : '' ;
565- reporter = process . env . reporter || process . env . r || 'dot ' ;
571+ reporter = process . env . reporter || process . env . r || 'mocha-fivemat-progress-reporter ' ;
566572 // timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
567573 // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
568574 var cmd = host + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run ;
@@ -717,7 +723,22 @@ task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function
717723} , { async : true } ) ;
718724
719725desc ( "Updates the sublime plugin's tsserver" ) ;
720- task ( "update-sublime" , [ serverFile ] , function ( ) {
726+ task ( "update-sublime" , [ "local" , serverFile ] , function ( ) {
721727 jake . cpR ( serverFile , "../TypeScript-Sublime-Plugin/tsserver/" ) ;
722728 jake . cpR ( serverFile + ".map" , "../TypeScript-Sublime-Plugin/tsserver/" ) ;
723729} ) ;
730+
731+ // if the codebase were free of linter errors we could make jake runtests
732+ // run this task automatically
733+ desc ( "Runs tslint on the compiler sources" ) ;
734+ task ( "lint" , [ ] , function ( ) {
735+ function success ( f ) { return function ( ) { console . log ( 'SUCCESS: No linter errors in ' + f + '\n' ) ; } } ;
736+ function failure ( f ) { return function ( ) { console . log ( 'FAILURE: Please fix linting errors in ' + f + '\n' ) } } ;
737+
738+ var lintTargets = compilerSources . concat ( harnessCoreSources ) ;
739+ for ( var i in lintTargets ) {
740+ var f = lintTargets [ i ] ;
741+ var cmd = 'tslint -f ' + f ;
742+ exec ( cmd , success ( f ) , failure ( f ) ) ;
743+ }
744+ } , { async : true } ) ;
0 commit comments