From cabf72b514ab046f8066902a7986f95c707731cb Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 15 Mar 2019 16:03:36 -0700 Subject: [PATCH] Revert "Passing --force option to build, builds project from start" This reverts commit 434fa94bdca63be629304bfde231ffa25d6754ed. --- src/compiler/tsbuild.ts | 1 - src/testRunner/unittests/tsbuild/sample.ts | 18 ++---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index e9311bd9a4..c649665cf7 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -1178,7 +1178,6 @@ namespace ts { } function getOldProgram(proj: ResolvedConfigFileName, parsed: ParsedCommandLine) { - if (options.force) return undefined; const value = builderPrograms.getValue(proj); if (value) return value; return readBuilderProgram(parsed.options, readFileWithCache) as any as T; diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index a813f28ee8..c225840a56 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -168,14 +168,14 @@ namespace ts { }); describe("can detect when and what to rebuild", () => { - function initializeWithBuild(opts?: BuildOptions) { + function initializeWithBuild() { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); const builder = createSolutionBuilder(host, ["/src/tests"], { verbose: true }); builder.buildAllProjects(); host.clearDiagnostics(); tick(); - builder.resetBuildContext(opts ? { ...opts, verbose: true } : undefined); + builder.resetBuildContext(); return { fs, host, builder }; } @@ -254,20 +254,6 @@ namespace ts { [Diagnostics.Building_project_0, "/src/tests/tsconfig.json"], ); }); - - it("rebuilds from start if --f is passed", () => { - const { host, builder } = initializeWithBuild({ force: true }); - builder.buildAllProjects(); - host.assertDiagnosticMessages( - getExpectedDiagnosticForProjectsInBuild("src/core/tsconfig.json", "src/logic/tsconfig.json", "src/tests/tsconfig.json"), - [Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, "src/core/tsconfig.json", "src/core/anotherModule.ts", "src/core/anotherModule.js"], - [Diagnostics.Building_project_0, "/src/core/tsconfig.json"], - [Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, "src/logic/tsconfig.json"], - [Diagnostics.Building_project_0, "/src/logic/tsconfig.json"], - [Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, "src/tests/tsconfig.json"], - [Diagnostics.Building_project_0, "/src/tests/tsconfig.json"] - ); - }); }); describe("downstream-blocked compilations", () => {