From b3eb9c5e6cda7675bab57d8bfde458ae113e478f Mon Sep 17 00:00:00 2001 From: vladima Date: Tue, 4 Nov 2014 11:27:34 -0800 Subject: [PATCH] add 'emitReverseMapping' task to jakefile --- Jakefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Jakefile b/Jakefile index 64394c2d60e..8bd725bdd28 100644 --- a/Jakefile +++ b/Jakefile @@ -134,6 +134,7 @@ function concatenateFiles(destinationFile, sourceFiles) { } var useDebugMode = false; +var emitReverseMapping = false; var generateDeclarations = false; var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node"); var compilerFilename = "tsc.js"; @@ -148,10 +149,14 @@ var compilerFilename = "tsc.js"; function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) { file(outFile, prereqs, function() { var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; - var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants " + var options = "-removeComments --module commonjs -noImplicitAny "; if (generateDeclarations) { options += "--declaration "; } + + if (emitReverseMapping) { + options += "--preserveConstEnums "; + } var cmd = host + " " + dir + compilerFilename + " " + options + " "; if (useDebugMode) { @@ -259,10 +264,14 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]); // Local target to build the compiler and services desc("Emit debug mode files with sourcemaps"); -task("debug", function() { +task("debug", ["emitReverseMapping"], function() { useDebugMode = true; }); +desc("Emit reverse mapping for const enums"); +task("emitReverseMapping", function() { + emitReverseMapping = true; +}); // Set the default task to "local" task("default", ["local"]);