Skip to content

Fix/configuration conditional compilation#1056

Open
mtsfoni wants to merge 4 commits intomasterfrom
fix/configuration-conditional-compilation
Open

Fix/configuration conditional compilation#1056
mtsfoni wants to merge 4 commits intomasterfrom
fix/configuration-conditional-compilation

Conversation

@mtsfoni
Copy link
Copy Markdown
Member

@mtsfoni mtsfoni commented Mar 7, 2026

No description provided.

mtsfoni added 4 commits March 7, 2026 22:09
Adds a --configuration / -c CLI option (e.g. Debug, Release) that is
passed as -p:Configuration=<value> to dotnet restore. This causes NuGet
to evaluate MSBuild Condition attributes on PackageReference items
during restore, so configuration-specific packages (e.g. debug-only
Avalonia.Diagnostics) are no longer included in the SBOM when a Release
configuration is requested.

Fixes: #1028

Generated by construct
- Update all existing Restore() mock setups from 3 to 4 args to match
  the updated interface signature
- DotnetUtilsServiceTests: verify Restore() includes -p:Configuration=
  in the dotnet command when configuration is set, and omits it when null
- ProjectFileServiceTests: verify GetProjectDotnetDependencysAsync
  forwards the configuration argument through to Restore()

Generated by construct
Three E2E tests verify that conditional PackageReference items (with
MSBuild Configuration conditions) are correctly included or excluded
depending on the --configuration value passed to the tool.

Also adds Configuration property to ToolRunOptions and wires it into
BuildArgs() in CycloneDxRunner.

Generated by construct
@mtsfoni mtsfoni requested a review from a team as a code owner March 7, 2026 22:52
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