@@ -21,6 +21,8 @@ const { src, dest, task, parallel, series, watch } = gulp;
2121const copyright = "CopyrightNotice.txt" ;
2222const cleanTasks = [ ] ;
2323
24+ const testRunner = "./built/local/testRunner/runner.js" ;
25+
2426const buildScripts = ( ) => buildProject ( "scripts" ) ;
2527task ( "scripts" , buildScripts ) ;
2628task ( "scripts" ) . description = "Builds files in the 'scripts' folder." ;
@@ -91,6 +93,14 @@ const localize = async () => {
9193 }
9294} ;
9395
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+
94104const buildDebugTools = ( ) => buildProject ( "src/debug" ) ;
95105const cleanDebugTools = ( ) => cleanProject ( "src/debug" ) ;
96106cleanTasks . push ( cleanDebugTools ) ;
@@ -405,8 +415,8 @@ task("watch-local").flags = {
405415const preTest = parallel ( buildTsc , buildTests , buildServices , buildLssl ) ;
406416preTest . displayName = "preTest" ;
407417
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
410420task ( "runtests" ) . description = "Runs the tests using the built run.js file." ;
411421task ( "runtests" ) . flags = {
412422 "-t --tests=<regex>" : "Pattern for tests to run." ,
@@ -424,8 +434,8 @@ task("runtests").flags = {
424434 " --shardId" : "1-based ID of this shard (default: 1)" ,
425435} ;
426436
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
429439task ( "runtests-parallel" ) . description = "Runs all the tests in parallel using the built run.js file." ;
430440task ( "runtests-parallel" ) . flags = {
431441 " --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
550560// write some kind of trigger file that indicates build completion that we could listen for instead.
551561const watchRuntests = ( ) => watch ( [ "built/local/*.js" , "tests/cases/**/*.ts" , "tests/cases/**/tsconfig.json" ] , { delay : 5000 } , async ( ) => {
552562 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 ) ;
554564 }
555565 else {
556- await runConsoleTests ( "built/local/run.js" , "min" , /*runInParallel*/ true , /*watchMode*/ true ) ;
566+ await runConsoleTests ( testRunner , "min" , /*runInParallel*/ true , /*watchMode*/ true ) ;
557567 }
558568} ) ;
559569task ( "watch" , series ( preBuild , preTest , parallel ( watchLib , watchDiagnostics , watchServices , watchLssl , watchTests , watchRuntests ) ) ) ;
0 commit comments