Skip to content

Commit bb29a10

Browse files
committed
Fixes downstream prepend projects not being built correctly on upstream changes
1 parent 3bab6af commit bb29a10

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Jakefile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ task(TaskNames.lint, [TaskNames.buildRules], () => {
204204
if (fold.isTravis()) console.log(fold.end("lint"));
205205
complete();
206206
}));
207-
});
207+
}, { async: true });
208208

209209
desc("Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable");
210210
task('diff', function () {

src/compiler/tsbuild.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ namespace ts {
777777

778778
let pseudoUpToDate = false;
779779
let usesPrepend = false;
780+
let upstreamChangedProject: string | undefined;
780781
if (project.projectReferences) {
781782
for (const ref of project.projectReferences) {
782783
usesPrepend = usesPrepend || !!(ref.prepend);
@@ -809,6 +810,7 @@ namespace ts {
809810
// *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
810811
if (refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
811812
pseudoUpToDate = true;
813+
upstreamChangedProject = ref.path;
812814
continue;
813815
}
814816

@@ -837,8 +839,12 @@ namespace ts {
837839
};
838840
}
839841

840-
if (usesPrepend) {
841-
pseudoUpToDate = false;
842+
if (usesPrepend && pseudoUpToDate) {
843+
return {
844+
type: UpToDateStatusType.OutOfDateWithUpstream,
845+
outOfDateOutputFileName: oldestOutputFileName,
846+
newerProjectName: upstreamChangedProject!
847+
};
842848
}
843849

844850
// Up to date

0 commit comments

Comments
 (0)