Skip to content

Commit

Permalink
Merge pull request #29813 from Microsoft/incrementalBuildInfo
Browse files Browse the repository at this point in the history
Build .tsbuildinfo file when building using tsc --b
  • Loading branch information
sheetalkamat authored Mar 8, 2019
2 parents a9ad94a + b2cda16 commit 97fbc87
Show file tree
Hide file tree
Showing 188 changed files with 226,457 additions and 7,510 deletions.
42 changes: 10 additions & 32 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const mkdirp = require("mkdirp");
const { src, dest, task, parallel, series, watch } = require("gulp");
const { append, transform } = require("gulp-insert");
const { prependFile } = require("./scripts/build/prepend");
const { exec, readJson, needsUpdate, getDiffTool, getDirSize, flatten, rm } = require("./scripts/build/utils");
const { exec, readJson, needsUpdate, getDiffTool, getDirSize, rm } = require("./scripts/build/utils");
const { runConsoleTests, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests");
const { buildProject, cleanProject, watchProject } = require("./scripts/build/projects");
const cmdLineOptions = require("./scripts/build/options");
Expand Down Expand Up @@ -113,18 +113,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno
const preBuild = cmdLineOptions.lkg ? lkgPreBuild : localPreBuild;

const buildServices = (() => {
// flatten the services project
const flattenServicesConfig = async () => flatten("src/services/tsconfig.json", "built/local/typescriptServices.tsconfig.json", {
compilerOptions: {
"removeComments": false,
"stripInternal": true,
"declarationMap": false,
"outFile": "typescriptServices.out.js"
}
});

// build typescriptServices.out.js
const buildTypescriptServicesOut = () => buildProject("built/local/typescriptServices.tsconfig.json", cmdLineOptions);
const buildTypescriptServicesOut = () => buildProject("src/typescriptServices/tsconfig.json", cmdLineOptions);

// create typescriptServices.js
const createTypescriptServicesJs = () => src("built/local/typescriptServices.out.js")
Expand Down Expand Up @@ -166,13 +156,13 @@ const buildServices = (() => {
.pipe(dest("built/local"));

return series(
flattenServicesConfig,
buildTypescriptServicesOut,
createTypescriptServicesJs,
createTypescriptServicesDts,
createTypescriptJs,
createTypescriptDts,
createTypescriptStandaloneDts);
createTypescriptStandaloneDts,
);
})();
task("services", series(preBuild, buildServices));
task("services").description = "Builds the language service";
Expand All @@ -185,13 +175,13 @@ const cleanServices = async () => {
await cleanProject("built/local/typescriptServices.tsconfig.json");
}
await del([
"built/local/typescriptServices.tsconfig.json",
"built/local/typescriptServices.out.js",
"built/local/typescriptServices.out.d.ts",
"built/local/typescriptServices.out.tsbuildinfo",
"built/local/typescriptServices.js",
"built/local/typescript.js",
"built/local/typescript.d.ts",
"built/local/typescript_standalone.d.ts",
"built/local/typescript_standalone.d.ts"
]);
};
cleanTasks.push(cleanServices);
Expand Down Expand Up @@ -247,20 +237,8 @@ task("watch-min").flags = {
}

const buildLssl = (() => {
// flatten the server project
const flattenTsServerProject = async () => flatten("src/tsserver/tsconfig.json", "built/local/tsserverlibrary.tsconfig.json", {
exclude: ["src/tsserver/server.ts"],
compilerOptions: {
"removeComments": false,
"stripInternal": true,
"declaration": true,
"declarationMap": false,
"outFile": "tsserverlibrary.out.js"
}
});

// build tsserverlibrary.out.js
const buildServerLibraryOut = () => buildProject("built/local/tsserverlibrary.tsconfig.json", cmdLineOptions);
const buildServerLibraryOut = () => buildProject("src/tsserverlibrary/tsconfig.json", cmdLineOptions);

// create tsserverlibrary.js
const createServerLibraryJs = () => src("built/local/tsserverlibrary.out.js")
Expand All @@ -281,10 +259,10 @@ const buildLssl = (() => {
.pipe(dest("built/local"));

return series(
flattenTsServerProject,
buildServerLibraryOut,
createServerLibraryJs,
createServerLibraryDts);
createServerLibraryDts,
);
})();
task("lssl", series(preBuild, buildLssl));
task("lssl").description = "Builds language service server library";
Expand All @@ -297,9 +275,9 @@ const cleanLssl = async () => {
await cleanProject("built/local/tsserverlibrary.tsconfig.json");
}
await del([
"built/local/tsserverlibrary.tsconfig.json",
"built/local/tsserverlibrary.out.js",
"built/local/tsserverlibrary.out.d.ts",
"built/local/tsserverlibrary.out.tsbuildinfo",
"built/local/tsserverlibrary.js",
"built/local/tsserverlibrary.d.ts",
]);
Expand Down
72 changes: 72 additions & 0 deletions lib/enu/diagnosticMessages.generated.json.lcg
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_update_output_of_project_0_6375" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would update output of project '{0}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would update timestamps for output of project '{0}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A parameter initializer is only allowed in a function or constructor implementation.]]></Val>
Expand Down Expand Up @@ -1641,6 +1653,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot update output of project '{0}' because there was error reading file '{1}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use JSX unless the '--jsx' flag is provided.]]></Val>
Expand Down Expand Up @@ -1671,6 +1689,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot write file '{0}' because it would be overwritten by multiple input files.]]></Val>
Expand Down Expand Up @@ -1869,6 +1893,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Composite_projects_may_not_disable_incremental_compilation_6379" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Composite projects may not disable incremental compilation.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Computed_property_names_are_not_allowed_in_enums_1164" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Computed property names are not allowed in enums.]]></Val>
Expand Down Expand Up @@ -2031,6 +2061,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_to_named_parameters_95075" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert to named parameters]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Corrupted_locale_file_0_6051" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Corrupted locale file {0}.]]></Val>
Expand Down Expand Up @@ -2421,6 +2457,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Enable_incremental_compilation_6378" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Enable incremental compilation]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Enable_project_compilation_6302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Enable project compilation]]></Val>
Expand Down Expand Up @@ -4485,6 +4527,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is out of date because output of its dependency '{1}' has changed]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Project '{0}' is up to date]]></Val>
Expand Down Expand Up @@ -5343,6 +5397,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_file_to_store_incremental_compilation_information_6380" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify file to store incremental compilation information]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_library_files_to_be_included_in_the_compilation_6079" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify library files to be included in the compilation.]]></Val>
Expand Down Expand Up @@ -6237,6 +6297,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type parameter '{0}' of exported mapped object type is using private name '{1}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type parameter '{0}' of exported type alias has or is using private name '{1}'.]]></Val>
Expand Down Expand Up @@ -6465,6 +6531,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Updating_output_of_project_0_6373" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Updating output of project '{0}'...]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Updating_output_timestamps_of_project_0_6359" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Updating output timestamps of project '{0}'...]]></Val>
Expand Down
25 changes: 25 additions & 0 deletions lib/protocol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ declare namespace ts.server.protocol {
OpenExternalProject = "openExternalProject",
OpenExternalProjects = "openExternalProjects",
CloseExternalProject = "closeExternalProject",
UpdateOpen = "updateOpen",
GetOutliningSpans = "getOutliningSpans",
TodoComments = "todoComments",
Indentation = "indentation",
Expand Down Expand Up @@ -1117,6 +1118,30 @@ declare namespace ts.server.protocol {
*/
interface CloseExternalProjectResponse extends Response {
}
/**
* Request to synchronize list of open files with the client
*/
interface UpdateOpenRequest extends Request {
command: CommandTypes.UpdateOpen;
arguments: UpdateOpenRequestArgs;
}
/**
* Arguments to UpdateOpenRequest
*/
interface UpdateOpenRequestArgs {
/**
* List of newly open files
*/
openFiles?: OpenRequestArgs[];
/**
* List of open files files that were changes
*/
changedFiles?: FileCodeEdits[];
/**
* List of files that were closed
*/
closedFiles?: string[];
}
/**
* Request to set compiler options for inferred projects.
* External projects are opened / closed explicitly.
Expand Down
Loading

0 comments on commit 97fbc87

Please sign in to comment.