Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/compiler-cli/ngcc/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,17 @@ export function mainNgcc({basePath, targetEntryPointPath,
return;
}

const {entryPoints} =
const {entryPoints, invalidEntryPoints} =
finder.findEntryPoints(AbsoluteFsPath.from(basePath), absoluteTargetEntryPointPath);


invalidEntryPoints.forEach(invalidEntryPoint => {
logger.debug(
`Invalid entry-point ${invalidEntryPoint.entryPoint.path}.`,
`It is missing required dependencies:\n` +
invalidEntryPoint.missingDependencies.map(dep => ` - ${dep}`).join('\n'));
});

if (absoluteTargetEntryPointPath && entryPoints.every(entryPoint => {
return entryPoint.path !== absoluteTargetEntryPointPath;
})) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ export class DependencyResolver {
} else {
dependencies.forEach(dependencyPath => {
if (graph.hasNode(dependencyPath)) {
// The dependency path maps to an entry point that exists in the graph
// so add the dependency.
graph.addDependency(entryPoint.path, dependencyPath);
if (graph.hasNode(entryPoint.path)) {
// The entry-point is still valid (i.e. has no missing dependencies) and
// the dependency maps to an entry point that exists in the graph so add it
graph.addDependency(entryPoint.path, dependencyPath);
}
} else if (invalidEntryPoints.some(i => i.entryPoint.path === dependencyPath)) {
// The dependency path maps to an entry-point that was previously removed
// from the graph, so remove this entry-point as well.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('DependencyResolver', () => {

it('should remove entry points that depended upon an invalid entry-point', () => {
spyOn(host, 'computeDependencies').and.callFake(createFakeComputeDependencies({
[_('/first/index.ts')]: {resolved: [second.path], missing: []},
[_('/first/index.ts')]: {resolved: [second.path, third.path], missing: []},
[_('/second/sub/index.ts')]: {resolved: [], missing: ['/missing']},
[_('/third/index.ts')]: {resolved: [], missing: []},
}));
Expand All @@ -70,7 +70,7 @@ describe('DependencyResolver', () => {

it('should remove entry points that will depend upon an invalid entry-point', () => {
spyOn(host, 'computeDependencies').and.callFake(createFakeComputeDependencies({
[_('/first/index.ts')]: {resolved: [second.path], missing: []},
[_('/first/index.ts')]: {resolved: [second.path, third.path], missing: []},
[_('/second/sub/index.ts')]: {resolved: [], missing: ['/missing']},
[_('/third/index.ts')]: {resolved: [], missing: []},
}));
Expand Down