@@ -113,7 +113,7 @@ var languageServiceLibrarySources = [
113
113
return path . join ( serverDirectory , f ) ;
114
114
} ) . concat ( servicesSources ) ;
115
115
116
- var harnessSources = [
116
+ var harnessCoreSources = [
117
117
"harness.ts" ,
118
118
"sourceMapRecorder.ts" ,
119
119
"harnessLanguageService.ts" ,
@@ -129,7 +129,9 @@ var harnessSources = [
129
129
"runner.ts"
130
130
] . map ( function ( f ) {
131
131
return path . join ( harnessDirectory , f ) ;
132
- } ) . concat ( [
132
+ } ) ;
133
+
134
+ var harnessSources = harnessCoreSources . concat ( [
133
135
"incrementalParser.ts" ,
134
136
"jsDocParsing.ts" ,
135
137
"services/colorization.ts" ,
@@ -361,7 +363,7 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
361
363
/*keepComments*/ true ,
362
364
/*noResolve*/ false ,
363
365
/*stripInternal*/ true ,
364
- /*callback*/ function ( ) {
366
+ /*callback*/ function ( ) {
365
367
jake . cpR ( servicesFile , nodePackageFile , { silent : true } ) ;
366
368
367
369
prependFile ( copyright , standaloneDefinitionsFile ) ;
@@ -379,12 +381,12 @@ compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(se
379
381
380
382
var lsslFile = path . join ( builtLocalDirectory , "tslssl.js" ) ;
381
383
compileFile (
382
- lsslFile ,
383
- languageServiceLibrarySources ,
384
+ lsslFile ,
385
+ languageServiceLibrarySources ,
384
386
[ builtLocalDirectory , copyright ] . concat ( languageServiceLibrarySources ) ,
385
- /*prefixes*/ [ copyright ] ,
386
- /*useBuiltCompiler*/ true ,
387
- /*noOutFile*/ false ,
387
+ /*prefixes*/ [ copyright ] ,
388
+ /*useBuiltCompiler*/ true ,
389
+ /*noOutFile*/ false ,
388
390
/*generateDeclarations*/ true ) ;
389
391
390
392
// Local target to build the language service server library
@@ -488,7 +490,7 @@ var refTest262Baseline = path.join(internalTests, "baselines/test262/reference")
488
490
desc ( "Builds the test infrastructure using the built compiler" ) ;
489
491
task ( "tests" , [ "local" , run ] . concat ( libraryTargets ) ) ;
490
492
491
- function exec ( cmd , completeHandler ) {
493
+ function exec ( cmd , completeHandler , errorHandler ) {
492
494
var ex = jake . createExec ( [ cmd ] , { windowsVerbatimArguments : true } ) ;
493
495
// Add listeners for output and error
494
496
ex . addListener ( "stdout" , function ( output ) {
@@ -504,8 +506,12 @@ function exec(cmd, completeHandler) {
504
506
complete ( ) ;
505
507
} ) ;
506
508
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
+ } ) ;
509
515
510
516
ex . run ( ) ;
511
517
}
@@ -562,7 +568,7 @@ task("runtests", ["tests", builtLocalDirectory], function() {
562
568
colors = process . env . colors || process . env . color
563
569
colors = colors ? ' --no-colors ' : ' --colors ' ;
564
570
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 ' ;
566
572
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
567
573
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
568
574
var cmd = host + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run ;
@@ -717,7 +723,22 @@ task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function
717
723
} , { async : true } ) ;
718
724
719
725
desc ( "Updates the sublime plugin's tsserver" ) ;
720
- task ( "update-sublime" , [ serverFile ] , function ( ) {
726
+ task ( "update-sublime" , [ "local" , serverFile ] , function ( ) {
721
727
jake . cpR ( serverFile , "../TypeScript-Sublime-Plugin/tsserver/" ) ;
722
728
jake . cpR ( serverFile + ".map" , "../TypeScript-Sublime-Plugin/tsserver/" ) ;
723
729
} ) ;
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