Skip to content

Commit e5b6bfb

Browse files
committed
add declaration target to generate declarations for compiler and services
1 parent 37a839f commit e5b6bfb

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

Jakefile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ function concatenateFiles(destinationFile, sourceFiles) {
128128
}
129129

130130
var useDebugMode = false;
131+
var generateDeclarations = false;
131132
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
132133
var compilerFilename = "tsc.js";
133134
/* Compiles a file from a list of sources
@@ -142,6 +143,9 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
142143
file(outFile, prereqs, function() {
143144
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
144145
var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants "
146+
if (generateDeclarations) {
147+
options += "--declaration ";
148+
}
145149

146150
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
147151
if (useDebugMode) {
@@ -250,7 +254,7 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]);
250254
// Local target to build the compiler and services
251255
desc("Emit debug mode files with sourcemaps");
252256
task("debug", function() {
253-
useDebugMode = true;
257+
useDebugMode = true;
254258
});
255259

256260

@@ -264,6 +268,12 @@ task("clean", function() {
264268
jake.rmRf(builtDirectory);
265269
});
266270

271+
// generate declarations for compiler and services
272+
desc("Generate declarations for compiler and services");
273+
task("declaration", function() {
274+
generateDeclarations = true;
275+
});
276+
267277
// Generate Markdown spec
268278
var word2mdJs = path.join(scriptsDirectory, "word2md.js");
269279
var word2mdTs = path.join(scriptsDirectory, "word2md.ts");
@@ -283,12 +293,12 @@ compileFile(word2mdJs,
283293
// The generated spec.md; built for the 'generate-spec' task
284294
file(specMd, [word2mdJs, specWord], function () {
285295
jake.cpR(headerMd, specMd, {silent: true});
286-
var specWordFullPath = path.resolve(specWord);
296+
var specWordFullPath = path.resolve(specWord);
287297
var cmd = "cscript //nologo " + word2mdJs + ' "' + specWordFullPath + '" >>' + specMd;
288-
console.log(cmd);
289-
child_process.exec(cmd, function () {
290-
complete();
291-
});
298+
console.log(cmd);
299+
child_process.exec(cmd, function () {
300+
complete();
301+
});
292302
}, {async: true})
293303

294304

src/services/shims.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ module ts {
174174
}
175175

176176
/// TODO: delete this, it is only needed until the VS interface is updated
177-
enum LanguageVersion {
177+
export enum LanguageVersion {
178178
EcmaScript3 = 0,
179179
EcmaScript5 = 1,
180180
}

0 commit comments

Comments
 (0)