@@ -21,6 +21,8 @@ const { src, dest, task, parallel, series, watch } = gulp;
21
21
const copyright = "CopyrightNotice.txt" ;
22
22
const cleanTasks = [ ] ;
23
23
24
+ const testRunner = "./built/local/testRunner/runner.js" ;
25
+
24
26
const buildScripts = ( ) => buildProject ( "scripts" ) ;
25
27
task ( "scripts" , buildScripts ) ;
26
28
task ( "scripts" ) . description = "Builds files in the 'scripts' folder." ;
@@ -91,6 +93,14 @@ const localize = async () => {
91
93
}
92
94
} ;
93
95
96
+ const preSrc = parallel ( generateLibs , series ( buildScripts , generateDiagnostics , localize ) ) ;
97
+ const buildSrc = ( ) => buildProject ( "src" ) ;
98
+
99
+ task ( "build-src" , series ( preSrc , buildSrc ) ) ;
100
+
101
+ const cleanSrc = ( ) => cleanProject ( "src" ) ;
102
+ task ( "clean-src" , cleanSrc ) ;
103
+
94
104
const buildDebugTools = ( ) => buildProject ( "src/debug" ) ;
95
105
const cleanDebugTools = ( ) => cleanProject ( "src/debug" ) ;
96
106
cleanTasks . push ( cleanDebugTools ) ;
@@ -405,8 +415,8 @@ task("watch-local").flags = {
405
415
const preTest = parallel ( buildTsc , buildTests , buildServices , buildLssl ) ;
406
416
preTest . displayName = "preTest" ;
407
417
408
- const runTests = ( ) => runConsoleTests ( "built/local/run.js" , "mocha-fivemat-progress-reporter" , /*runInParallel*/ false , /*watchMode*/ false ) ;
409
- task ( "runtests" , series ( preBuild , preTest , runTests ) ) ;
418
+ const runTests = ( ) => runConsoleTests ( testRunner , "mocha-fivemat-progress-reporter" , /*runInParallel*/ false , /*watchMode*/ false ) ;
419
+ task ( "runtests" , series ( /* preBuild, preTest,*/ task ( "build-src" ) , runTests ) ) ; // TODO(jakebailey): fix this for modules
410
420
task ( "runtests" ) . description = "Runs the tests using the built run.js file." ;
411
421
task ( "runtests" ) . flags = {
412
422
"-t --tests=<regex>" : "Pattern for tests to run." ,
@@ -424,8 +434,8 @@ task("runtests").flags = {
424
434
" --shardId" : "1-based ID of this shard (default: 1)" ,
425
435
} ;
426
436
427
- const runTestsParallel = ( ) => runConsoleTests ( "built/local/run.js" , "min" , /*runInParallel*/ cmdLineOptions . workers > 1 , /*watchMode*/ false ) ;
428
- task ( "runtests-parallel" , series ( preBuild , preTest , runTestsParallel ) ) ;
437
+ const runTestsParallel = ( ) => runConsoleTests ( testRunner , "min" , /*runInParallel*/ cmdLineOptions . workers > 1 , /*watchMode*/ false ) ;
438
+ task ( "runtests-parallel" , series ( /* preBuild, preTest,*/ task ( "build-src" ) , runTestsParallel ) ) ; // TODO(jakebailey): fix this for modules
429
439
task ( "runtests-parallel" ) . description = "Runs all the tests in parallel using the built run.js file." ;
430
440
task ( "runtests-parallel" ) . flags = {
431
441
" --light" : "Run tests in light mode (fewer verifications, but tests run faster)." ,
@@ -550,10 +560,10 @@ task("publish-nightly").description = "Runs `npm publish --tag next` to create a
550
560
// write some kind of trigger file that indicates build completion that we could listen for instead.
551
561
const watchRuntests = ( ) => watch ( [ "built/local/*.js" , "tests/cases/**/*.ts" , "tests/cases/**/tsconfig.json" ] , { delay : 5000 } , async ( ) => {
552
562
if ( cmdLineOptions . tests || cmdLineOptions . failed ) {
553
- await runConsoleTests ( "built/local/run.js" , "mocha-fivemat-progress-reporter" , /*runInParallel*/ false , /*watchMode*/ true ) ;
563
+ await runConsoleTests ( testRunner , "mocha-fivemat-progress-reporter" , /*runInParallel*/ false , /*watchMode*/ true ) ;
554
564
}
555
565
else {
556
- await runConsoleTests ( "built/local/run.js" , "min" , /*runInParallel*/ true , /*watchMode*/ true ) ;
566
+ await runConsoleTests ( testRunner , "min" , /*runInParallel*/ true , /*watchMode*/ true ) ;
557
567
}
558
568
} ) ;
559
569
task ( "watch" , series ( preBuild , preTest , parallel ( watchLib , watchDiagnostics , watchServices , watchLssl , watchTests , watchRuntests ) ) ) ;
0 commit comments