Skip to content

feat(ir): add typed helper for MSBuild@1#1088

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
feat/ir-msbuild-v1-89d569b85237a9e0
Draft

feat(ir): add typed helper for MSBuild@1#1088
github-actions[bot] wants to merge 1 commit into
mainfrom
feat/ir-msbuild-v1-89d569b85237a9e0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed factory function msbuild_step() for MSBuild@1 to the ado-aw IR tasks module.

Motivation

Previously, any code that needed to emit an MSBuild@1 step had to hand-craft TaskStep::new("MSBuild@1", ...) with raw string inputs. MSBuild@1 is the standard build tool for .NET Framework solutions and projects — filling a gap left by dot_net_core_cli_step (which targets cross-platform .NET Core / .NET 5+). This PR introduces a well-typed helper with a clear required/optional input boundary.

Changes

  • src/compile/ir/tasks.rs: msbuild_step(solution) factory function with full doc-comment table of optional inputs, placed after docker_logout_step().
  • src/compile/ir/tasks.rs (tests): Six new unit tests covering required-only construction, platform/configuration, msbuildArguments, optional boolean flags (clean, maximumCpuCount, restoreNugetPackages), explicit MSBuild location (msbuildLocationMethod = location), and .csproj project targets.

API

// Minimal — build all solutions in the repo
let step = msbuild_step("**/*.sln");

// Typical release build
let step = msbuild_step("src/MyApp/MyApp.sln")
    .with_input("platform", "x64")
    .with_input("configuration", "Release");

// With extra MSBuild arguments
let step = msbuild_step("**/*.sln")
    .with_input("msbuildArguments", "/p:DeployOnBuild=true /p:WebPublishMethod=Package")
    .with_input("maximumCpuCount", "true");

// Explicit MSBuild binary path
let step = msbuild_step("**/*.sln")
    .with_input("msbuildLocationMethod", "location")
    .with_input("msbuildLocation", "C:\\Program Files\\MSBuild\\17.0\\Bin\\msbuild.exe");

ADO Task Reference

Validation

  • cargo build --all-targets
  • cargo test (6 new tests, all passing)
  • cargo clippy --all-targets --all-features --workspace -- -D warnings

Created by the ado-task-ir-contributor workflow.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com
  • spsprodweu4.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"
    - "spsprodweu4.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by ADO Task IR Contributor · 680.4 AIC · ⌖ 26.8 AIC · ⊞ 37K ·

Adds msbuild_step() factory function to src/compile/ir/tasks.rs for the
MSBuild@1 ADO built-in task. The helper accepts the required solution
path as a positional parameter and exposes all optional inputs (platform,
configuration, msbuildArguments, clean, maximumCpuCount,
restoreNugetPackages, msbuildLocationMethod, msbuildVersion,
msbuildArchitecture, msbuildLocation, logProjectEvents, createLogFile,
logFileVerbosity) via .with_input() on the returned TaskStep.

Six unit tests cover: required-only construction, platform/configuration,
msbuildArguments, optional boolean flags, explicit msbuild location, and
.csproj project targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

0 participants