From bb29a1087ed5f2ef294e26b449e661812f81d0c7 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Mon, 18 Jun 2018 11:11:03 -0700 Subject: [PATCH] Fixes downstream prepend projects not being built correctly on upstream changes --- Jakefile.js | 2 +- src/compiler/tsbuild.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 633e4f45cb6..7a16c681b6e 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -204,7 +204,7 @@ task(TaskNames.lint, [TaskNames.buildRules], () => { if (fold.isTravis()) console.log(fold.end("lint")); complete(); })); -}); +}, { async: true }); desc("Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable"); task('diff', function () { diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 80f6d1c1cc8..97b7c0afad7 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -777,6 +777,7 @@ namespace ts { let pseudoUpToDate = false; let usesPrepend = false; + let upstreamChangedProject: string | undefined; if (project.projectReferences) { for (const ref of project.projectReferences) { usesPrepend = usesPrepend || !!(ref.prepend); @@ -809,6 +810,7 @@ namespace ts { // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild if (refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) { pseudoUpToDate = true; + upstreamChangedProject = ref.path; continue; } @@ -837,8 +839,12 @@ namespace ts { }; } - if (usesPrepend) { - pseudoUpToDate = false; + if (usesPrepend && pseudoUpToDate) { + return { + type: UpToDateStatusType.OutOfDateWithUpstream, + outOfDateOutputFileName: oldestOutputFileName, + newerProjectName: upstreamChangedProject! + }; } // Up to date