@@ -105,6 +105,7 @@ var harnessCoreSources = [
105105 "projectsRunner.ts" ,
106106 "loggedIO.ts" ,
107107 "rwcRunner.ts" ,
108+ "externalCompileRunner.ts" ,
108109 "test262Runner.ts" ,
109110 "./parallel/shared.ts" ,
110111 "./parallel/host.ts" ,
@@ -154,6 +155,7 @@ var harnessSources = harnessCoreSources.concat([
154155 "symbolWalker.ts" ,
155156 "languageService.ts" ,
156157 "publicApi.ts" ,
158+ "hostNewLineSupport.ts" ,
157159] . map ( function ( f ) {
158160 return path . join ( unittestsDirectory , f ) ;
159161} ) ) . concat ( [
@@ -195,7 +197,8 @@ var es2017LibrarySource = [
195197 "es2017.object.d.ts" ,
196198 "es2017.sharedmemory.d.ts" ,
197199 "es2017.string.d.ts" ,
198- "es2017.intl.d.ts"
200+ "es2017.intl.d.ts" ,
201+ "es2017.typedarrays.d.ts" ,
199202] ;
200203
201204var es2017LibrarySourceMap = es2017LibrarySource . map ( function ( source ) {
@@ -238,6 +241,23 @@ var libraryTargets = librarySourceMap.map(function (f) {
238241 return path . join ( builtLocalDirectory , f . target ) ;
239242} ) ;
240243
244+ /**
245+ * .lcg file is what localization team uses to know what messages to localize.
246+ * The file is always generated in 'enu\diagnosticMessages.generated.json.lcg'
247+ */
248+ var generatedLCGFile = path . join ( builtLocalDirectory , "enu" , "diagnosticMessages.generated.json.lcg" ) ;
249+
250+ /**
251+ * The localization target produces the two following transformations:
252+ * 1. 'src\loc\lcl\<locale>\diagnosticMessages.generated.json.lcl' => 'built\local\<locale>\diagnosticMessages.generated.json'
253+ * convert localized resources into a .json file the compiler can understand
254+ * 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
255+ * generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
256+ */
257+ var localizationTargets = [ "cs" , "de" , "es" , "fr" , "it" , "ja" , "ko" , "pl" , "pt-BR" , "ru" , "tr" , "zh-CN" , "zh-TW" ] . map ( function ( f ) {
258+ return path . join ( builtLocalDirectory , f ) ;
259+ } ) . concat ( path . dirname ( generatedLCGFile ) ) ;
260+
241261// Prepends the contents of prefixFile to destinationFile
242262function prependFile ( prefixFile , destinationFile ) {
243263 if ( ! fs . existsSync ( prefixFile ) ) {
@@ -443,7 +463,6 @@ compileFile(generateLocalizedDiagnosticMessagesJs,
443463 /*useBuiltCompiler*/ false , { noOutFile : true , types : [ "node" , "xml2js" ] } ) ;
444464
445465// Localize diagnostics
446- var generatedLCGFile = path . join ( builtLocalDirectory , "enu" , "diagnosticMessages.generated.json.lcg" ) ;
447466file ( generatedLCGFile , [ generateLocalizedDiagnosticMessagesJs , diagnosticInfoMapTs , generatedDiagnosticMessagesJSON ] , function ( ) {
448467 var cmd = host + " " + generateLocalizedDiagnosticMessagesJs + " " + lclDirectory + " " + builtLocalDirectory + " " + generatedDiagnosticMessagesJSON ;
449468 console . log ( cmd ) ;
@@ -712,7 +731,10 @@ compileFile(word2mdJs,
712731 [ word2mdTs ] ,
713732 [ word2mdTs ] ,
714733 [ ] ,
715- /*useBuiltCompiler*/ false ) ;
734+ /*useBuiltCompiler*/ false ,
735+ {
736+ lib : "scripthost,es5"
737+ } ) ;
716738
717739// The generated spec.md; built for the 'generate-spec' task
718740file ( specMd , [ word2mdJs , specWord ] , function ( ) {
@@ -735,8 +757,7 @@ desc("Makes a new LKG out of the built js files");
735757task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
736758 var expectedFiles = [ tscFile , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , cancellationTokenFile , typingsInstallerFile , buildProtocolDts , watchGuardFile ] .
737759 concat ( libraryTargets ) .
738- concat ( fs . readdirSync ( lclDirectory ) . map ( function ( d ) { return path . join ( builtLocalDirectory , d ) } ) ) .
739- concat ( path . dirname ( generatedLCGFile ) ) ;
760+ concat ( localizationTargets ) ;
740761 var missingFiles = expectedFiles . filter ( function ( f ) {
741762 return ! fs . existsSync ( f ) ;
742763 } ) ;
@@ -827,8 +848,9 @@ function cleanTestDirs() {
827848}
828849
829850// used to pass data from jake command line directly to run.js
830- function writeTestConfigFile ( tests , light , taskConfigsFolder , workerCount , stackTraceLimit , colors ) {
851+ function writeTestConfigFile ( tests , runners , light , taskConfigsFolder , workerCount , stackTraceLimit , colors ) {
831852 var testConfigContents = JSON . stringify ( {
853+ runners : runners ? runners . split ( "," ) : undefined ,
832854 test : tests ? [ tests ] : undefined ,
833855 light : light ,
834856 workerCount : workerCount ,
@@ -854,8 +876,9 @@ function runConsoleTests(defaultReporter, runInParallel) {
854876 var debug = process . env . debug || process . env [ "debug-brk" ] || process . env . d ;
855877 var inspect = process . env . inspect || process . env [ "inspect-brk" ] || process . env . i ;
856878 var testTimeout = process . env . timeout || defaultTestTimeout ;
879+ var runners = process . env . runners || process . env . runner || process . env . ru ;
857880 var tests = process . env . test || process . env . tests || process . env . t ;
858- var light = process . env . light || false ;
881+ var light = process . env . light === undefined || process . env . light !== " false" ;
859882 var stackTraceLimit = process . env . stackTraceLimit ;
860883 var testConfigFile = 'test.config' ;
861884 if ( fs . existsSync ( testConfigFile ) ) {
@@ -875,8 +898,8 @@ function runConsoleTests(defaultReporter, runInParallel) {
875898 workerCount = process . env . workerCount || process . env . p || os . cpus ( ) . length ;
876899 }
877900
878- if ( tests || light || taskConfigsFolder ) {
879- writeTestConfigFile ( tests , light , taskConfigsFolder , workerCount , stackTraceLimit , colors ) ;
901+ if ( tests || runners || light || taskConfigsFolder ) {
902+ writeTestConfigFile ( tests , runners , light , taskConfigsFolder , workerCount , stackTraceLimit , colors ) ;
880903 }
881904
882905 if ( tests && tests . toLocaleLowerCase ( ) === "rwc" ) {
@@ -1011,14 +1034,15 @@ task("runtests-browser", ["browserify", nodeServerOutFile], function () {
10111034 cleanTestDirs ( ) ;
10121035 host = "node" ;
10131036 var browser = process . env . browser || process . env . b || ( os . platform ( ) === "linux" ? "chrome" : "IE" ) ;
1037+ var runners = process . env . runners || process . env . runner || process . env . ru ;
10141038 var tests = process . env . test || process . env . tests || process . env . t ;
10151039 var light = process . env . light || false ;
10161040 var testConfigFile = 'test.config' ;
10171041 if ( fs . existsSync ( testConfigFile ) ) {
10181042 fs . unlinkSync ( testConfigFile ) ;
10191043 }
1020- if ( tests || light ) {
1021- writeTestConfigFile ( tests , light ) ;
1044+ if ( tests || runners || light ) {
1045+ writeTestConfigFile ( tests , runners , light ) ;
10221046 }
10231047
10241048 tests = tests ? tests : '' ;
@@ -1266,7 +1290,7 @@ task("lint", ["build-rules"], () => {
12661290 const fileMatcher = process . env . f || process . env . file || process . env . files ;
12671291 const files = fileMatcher
12681292 ? `src/**/${ fileMatcher } `
1269- : "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated .d.ts'" ;
1293+ : "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude 'src/lib/*.d.ts'" ;
12701294 const cmd = `node node_modules/tslint/bin/tslint ${ files } --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish` ;
12711295 console . log ( "Linting: " + cmd ) ;
12721296 jake . exec ( [ cmd ] , { interactive : true } , ( ) => {
0 commit comments