Do not schedule updating bundle if the buildInfo file wont be generated for the project

Fixes #30346
This commit is contained in:
Sheetal Nandi
2019-03-12 16:08:01 -07:00
parent ab8153602a
commit 2477159782
3 changed files with 776 additions and 8 deletions

View File

@@ -1012,9 +1012,9 @@ namespace ts {
return;
}
const buildResult = status.type === UpToDateStatusType.OutOfDateWithPrepend ?
updateBundle(resolved) : // Fake that files have been built by manipulating prepend and existing output
buildSingleProject(resolved); // Actual build
const buildResult = needsBuild(status, resolved) ?
buildSingleProject(resolved) : // Actual build
updateBundle(resolved); // Fake that files have been built by manipulating prepend and existing output
if (buildResult & BuildResultFlags.AnyErrors) return;
const { referencingProjectsMap, buildQueue } = getGlobalDependencyGraph();
@@ -1424,9 +1424,10 @@ namespace ts {
continue;
}
const buildResult = status.type === UpToDateStatusType.OutOfDateWithPrepend && !options.force ?
updateBundle(next) : // Fake that files have been built by manipulating prepend and existing output
buildSingleProject(next); // Actual build
const buildResult = needsBuild(status, next) ?
buildSingleProject(next) : // Actual build
updateBundle(next); // Fake that files have been built by manipulating prepend and existing output
anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors);
}
reportErrorSummary();
@@ -1440,6 +1441,15 @@ namespace ts {
return anyFailed ? ExitStatus.DiagnosticsPresent_OutputsSkipped : ExitStatus.Success;
}
function needsBuild(status: UpToDateStatus, configFile: ResolvedConfigFileName) {
if (status.type !== UpToDateStatusType.OutOfDateWithPrepend || options.force) return true;
const config = parseConfigFile(configFile);
return !config ||
config.fileNames.length === 0 ||
!!config.errors.length ||
!isIncrementalCompilation(config.options);
}
function reportParseConfigFileDiagnostic(proj: ResolvedConfigFileName) {
reportAndStoreErrors(proj, [configFileCache.getValue(proj) as Diagnostic]);
}

View File

@@ -322,12 +322,11 @@ namespace ts {
modifyFs: noop
});
// Verify baseline with build info
// Verify baseline with build info + dts unChanged
verifyOutFileScenario({
scenario: "when final project is not composite but uses project references",
modifyFs: fs => replaceText(fs, sources[project.third][source.config], `"composite": true,`, ""),
ignoreDtsChanged: true,
ignoreDtsUnchanged: true,
baselineOnly: true
});