Skip to content

merge: wire MergeCommand to the new library MergeStrategy engine - #510

Open
jimklimov wants to merge 1 commit into
CycloneDX:mainfrom
jimklimov:merge-strategy-wiring
Open

jimklimov wants to merge 1 commit into
CycloneDX:mainfrom
jimklimov:merge-strategy-wiring

Conversation

@jimklimov

Copy link
Copy Markdown
Contributor

What

MergeCommand now calls CycloneDXUtils.FlatMerge/HierarchicalMerge with MergeStrategy.Default()
when built against a library that has it (#if NET8_0_OR_GREATER, matching the library's own guard —
the CLI is net10.0-only today, but this keeps the two projects' conditional compilation symmetric and
self-documenting), falling back to the plain overload otherwise. No new CLI flags: strategy toggles
aren't exposed at the command-line layer here, so this only changes default merge behavior, not the
command's surface.

Why

Prerequisite plumbing for the rest of the merge-related PRs in this batch (conflict-resolution
option, --input-files-list, metadata/cleanup, --validate-output, --attach-dangling-components,
--strip-empty-lists) — none of them can be reviewed meaningfully without this landing first, since
they all build on MergeCommand actually calling the new library engine. No earlier PR proposed this
specifically; it's foundational work that the (now-closed) old PRs implicitly assumed was already done.

Depends on cyclonedx-dotnet-library#446.
Independent of #509 (rename-entity, no shared files) but a prerequisite for everything else in this
batch.

MergeCommand now calls CycloneDXUtils.FlatMerge/HierarchicalMerge with
MergeStrategy.Default() when built against a library that has it
(#if NET8_0_OR_GREATER, matching the library's own guard -- CLI is
net10.0-only today but this keeps the two projects' conditional
compilation symmetric and self-documenting), falling back to the
plain overload otherwise. No new CLI flags: strategy toggles are not
yet exposed at the command-line layer, so this only changes default
merge behavior, not the command's surface.

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant