Skip to content

Commit

Permalink
feat(core): project references with reference output assembly=false a…
Browse files Browse the repository at this point in the history
…re implicit deps (#211)
  • Loading branch information
AgentEnder committed Oct 15, 2021
1 parent c4d5f87 commit 34f87ee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/executors/format/executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ describe('Format Executor', () => {
let context: ExecutorContext;
let dotnetClient: DotNetClient;

beforeEach(() => {
beforeEach(async () => {
await rimraf(root);
context = {
root: root,
cwd: root,
Expand Down Expand Up @@ -50,7 +51,7 @@ describe('Format Executor', () => {
);
});

afterEach(async () => {
afterAll(async () => {
await rimraf(root);
});

Expand Down
8 changes: 6 additions & 2 deletions packages/core/src/graph/process-project-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ function visitProject(
getDependantProjectsForNxProject(
projectName,
context.workspace,
(config, dependencyName) => {
builder.addExplicitDependency(projectName, projectFile, dependencyName);
(config, dependencyName, implicit) => {
if (implicit) {
builder.addImplicitDependency(projectName, dependencyName);
} else {
builder.addExplicitDependency(projectName, projectFile, dependencyName);
}
},
);
}
3 changes: 2 additions & 1 deletion packages/core/src/tasks/check-module-boundaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export async function checkModuleBoundariesForProject(
getDependantProjectsForNxProject(
project,
workspace,
(configuration, name) => {
(configuration, name, implicit) => {
if (implicit) return;
const dependencyTags = configuration?.tags ?? [];
for (const constraint of relevantConstraints) {
if (
Expand Down
3 changes: 3 additions & 0 deletions packages/utils/src/lib/utility-functions/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function getDependantProjectsForNxProject(
project: ProjectConfiguration &
NxJsonProjectConfiguration & { projectFile: string },
projectName: string,
implicit: boolean,
) => void,
): {
[projectName: string]: ProjectConfiguration;
Expand Down Expand Up @@ -63,6 +64,7 @@ export function getDependantProjectsForNxProject(
xml.childrenNamed('ItemGroup').forEach((itemGroup) =>
itemGroup.childrenNamed('ProjectReference').forEach((x: XmlElement) => {
const includeFilePath = normalizePath(x.attr['Include']);
const implicit = x.attr['ReferenceOutputAssembly'] === 'false';
const workspaceFilePath = normalizePath(
isAbsolute(includeFilePath)
? includeFilePath
Expand All @@ -78,6 +80,7 @@ export function getDependantProjectsForNxProject(
projectFile: workspaceFilePath,
},
dependency,
implicit,
);
}
dependantProjects[dependency] =
Expand Down

0 comments on commit 34f87ee

Please sign in to comment.