Skip to content

Commit 230ccd6

Browse files
Added a 'publish-nightly' task to to the Jakefile.
1 parent 86b8405 commit 230ccd6

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

Jakefile.js

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ var processDiagnosticMessagesTs = path.join(scriptsDirectory, "processDiagnostic
311311
var diagnosticMessagesJson = path.join(compilerDirectory, "diagnosticMessages.json");
312312
var diagnosticInfoMapTs = path.join(compilerDirectory, "diagnosticInformationMap.generated.ts");
313313

314-
file(processDiagnosticMessagesTs)
314+
file(processDiagnosticMessagesTs);
315315

316316
// processDiagnosticMessages script
317317
compileFile(processDiagnosticMessagesJs,
@@ -342,6 +342,65 @@ desc("Generates a diagnostic file in TypeScript based on an input JSON file");
342342
task("generate-diagnostics", [diagnosticInfoMapTs])
343343

344344

345+
// Publish nightly
346+
var configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js");
347+
var configureNightlyTs = path.join(scriptsDirectory, "configureNightly.ts");
348+
var packageJson = "package.json";
349+
var programTs = path.join(compilerDirectory, "program.ts")
350+
351+
file(configureNightlyTs);
352+
353+
compileFile(/*outfile*/configureNightlyJs,
354+
/*sources*/ [configureNightlyTs],
355+
/*prereqs*/ [configureNightlyTs],
356+
/*prefixes*/ [],
357+
/*useBuiltCompiler*/ false,
358+
/*noOutFile*/ false,
359+
/*generateDeclarations*/ false,
360+
/*outDir*/ undefined,
361+
/*preserveConstEnums*/ undefined,
362+
/*keepComments*/ false,
363+
/*noResolve*/ false,
364+
/*stripInternal*/ false,
365+
/*callback*/ function () {
366+
var cmd = "node " + configureNightlyJs + " " + packageJson + " " + programTs;
367+
console.log(cmd);
368+
var ex = jake.createExec([cmd]);
369+
// Add listeners for output and error
370+
ex.addListener("stdout", function(output) {
371+
process.stdout.write(output);
372+
});
373+
ex.addListener("stderr", function(error) {
374+
process.stderr.write(error);
375+
});
376+
ex.addListener("cmdEnd", function() {
377+
complete();
378+
});
379+
ex.run();
380+
});
381+
382+
task("setDebugModeTrue", function() {
383+
useDebugMode = true;
384+
});
385+
386+
desc("Configure, build, test, and publish the nightly release.");
387+
task("publish-nightly", [configureNightlyJs, "LKG", "clean", "setDebugModeTrue", "runtests"], function () {
388+
var cmd = "npm publish";
389+
console.log(cmd);
390+
var ex = jake.createExec([cmd]);
391+
// Add listeners for output and error
392+
ex.addListener("stdout", function(output) {
393+
process.stdout.write(output);
394+
});
395+
ex.addListener("stderr", function(error) {
396+
process.stderr.write(error);
397+
});
398+
ex.addListener("cmdEnd", function() {
399+
complete();
400+
});
401+
ex.run();
402+
}, {async: true});
403+
345404
// Local target to build the compiler and services
346405
var tscFile = path.join(builtLocalDirectory, compilerFilename);
347406
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);

0 commit comments

Comments
 (0)