mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 12:32:08 -06:00
add declaration target to generate declarations for compiler and services
This commit is contained in:
parent
37a839fcf7
commit
e5b6bfbc46
22
Jakefile
22
Jakefile
@ -128,6 +128,7 @@ function concatenateFiles(destinationFile, sourceFiles) {
|
||||
}
|
||||
|
||||
var useDebugMode = false;
|
||||
var generateDeclarations = false;
|
||||
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
|
||||
var compilerFilename = "tsc.js";
|
||||
/* Compiles a file from a list of sources
|
||||
@ -142,6 +143,9 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
|
||||
file(outFile, prereqs, function() {
|
||||
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
|
||||
var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants "
|
||||
if (generateDeclarations) {
|
||||
options += "--declaration ";
|
||||
}
|
||||
|
||||
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
|
||||
if (useDebugMode) {
|
||||
@ -250,7 +254,7 @@ 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() {
|
||||
useDebugMode = true;
|
||||
useDebugMode = true;
|
||||
});
|
||||
|
||||
|
||||
@ -264,6 +268,12 @@ task("clean", function() {
|
||||
jake.rmRf(builtDirectory);
|
||||
});
|
||||
|
||||
// generate declarations for compiler and services
|
||||
desc("Generate declarations for compiler and services");
|
||||
task("declaration", function() {
|
||||
generateDeclarations = true;
|
||||
});
|
||||
|
||||
// Generate Markdown spec
|
||||
var word2mdJs = path.join(scriptsDirectory, "word2md.js");
|
||||
var word2mdTs = path.join(scriptsDirectory, "word2md.ts");
|
||||
@ -283,12 +293,12 @@ compileFile(word2mdJs,
|
||||
// The generated spec.md; built for the 'generate-spec' task
|
||||
file(specMd, [word2mdJs, specWord], function () {
|
||||
jake.cpR(headerMd, specMd, {silent: true});
|
||||
var specWordFullPath = path.resolve(specWord);
|
||||
var specWordFullPath = path.resolve(specWord);
|
||||
var cmd = "cscript //nologo " + word2mdJs + ' "' + specWordFullPath + '" >>' + specMd;
|
||||
console.log(cmd);
|
||||
child_process.exec(cmd, function () {
|
||||
complete();
|
||||
});
|
||||
console.log(cmd);
|
||||
child_process.exec(cmd, function () {
|
||||
complete();
|
||||
});
|
||||
}, {async: true})
|
||||
|
||||
|
||||
|
||||
@ -174,7 +174,7 @@ module ts {
|
||||
}
|
||||
|
||||
/// TODO: delete this, it is only needed until the VS interface is updated
|
||||
enum LanguageVersion {
|
||||
export enum LanguageVersion {
|
||||
EcmaScript3 = 0,
|
||||
EcmaScript5 = 1,
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user