Skip to content

IBuildHost abstraction and host adapters#245

Merged
rdeago merged 2 commits into
Tenacom:mainfrom
rdeago:239-ibuildhost-abstraction
Apr 29, 2026
Merged

IBuildHost abstraction and host adapters#245
rdeago merged 2 commits into
Tenacom:mainfrom
rdeago:239-ibuildhost-abstraction

Conversation

@rdeago
Copy link
Copy Markdown
Member

@rdeago rdeago commented Apr 29, 2026

Summary

  • Adds Buildvana.Core.Abstractions with IBuildHost (Fail, Log(LogLevel, string), IsEnabled(LogLevel)) and a BuildHostExtensions static class that provides Fail<T>, Ensure, and the per-level LogTrace / LogDebug / LogInformation / LogWarning / LogError shorthand.
  • CakeBuildHost (in Buildvana.Tool) wraps ICakeContext and is registered as IBuildHost in BuildContext's DI container.
  • MSBuildTaskHost (in Buildvana.Sdk.Tasks) wraps TaskLoggingHelper + IBuildEngine and is exposed via a Host property on BuildvanaSdkTask.
  • Verifies each adapter by porting one call site: ChangelogService.HasUnreleasedChanges (Cake) and GetWinePath.Run (MSBuild). Wholesale migration of remaining callers is out of scope and lands incrementally as libraries are extracted.
  • Documents the .Abstractions discipline rule in .claude/rules/architecture.md.

Closes #239.

Test plan

  • dotnet bv build clean — 0 warnings, 0 errors.
  • Behavior parity verified on CI after an interim publish (per project workflow — local --dry-run not available for bv).

@github-actions github-actions Bot added area:code [issue/PR] affects project code (excluding tests). area:style [issue/PR] affects editor / code analysis settings. labels Apr 29, 2026
@rdeago rdeago added enhancement [issue/PR] requests / implements new or improved functionality. project:tasks labels Apr 29, 2026
@rdeago rdeago requested a review from Copilot April 29, 2026 00:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a host-agnostic IBuildHost abstraction (in a new Buildvana.Core.Abstractions project) plus host-specific adapters for Cake and MSBuild Tasks, then ports one Cake call site and one MSBuild task call site to validate the adapters.

Changes:

  • Added Buildvana.Core.Abstractions with IBuildHost, LogLevel, and BuildHostExtensions.
  • Added host adapters: CakeBuildHost (Tool) and MSBuildTaskHost (SDK.Tasks), and wired them into DI / task base class usage.
  • Ported call sites to the new host surface (ChangelogService.HasUnreleasedChanges, GetWinePath.Run) and updated solution/docs.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Buildvana.Tool/Services/ChangelogService.cs Injects IBuildHost and uses it for Ensure in one call site.
src/Buildvana.Tool/Infrastructure/CakeBuildHost.cs New Cake adapter implementing IBuildHost.
src/Buildvana.Tool/Infrastructure/BuildContext.cs Registers IBuildHost in the Tool DI container.
src/Buildvana.Tool/Buildvana.Tool.csproj References the new abstractions project.
src/Buildvana.Sdk.Tasks/Tasks/GetWinePath.cs Ports one task to Host.Ensure and updates formatting logic.
src/Buildvana.Sdk.Tasks/Tasks/BuildvanaSdkTask.cs Adds a Host property that instantiates MSBuildTaskHost.
src/Buildvana.Sdk.Tasks/MSBuildTaskHost.cs New MSBuild adapter implementing IBuildHost.
src/Buildvana.Sdk.Tasks/Buildvana.Sdk.Tasks.csproj References the new abstractions project.
src/Buildvana.Core.Abstractions/* New contracts project: IBuildHost, LogLevel, extensions, csproj.
Buildvana.slnx.DotSettings Adds an abbreviation entry (currently appears mis-keyed).
Buildvana.slnx Adds the new project to the solution.
.claude/rules/architecture.md Documents the new project and .Abstractions discipline rule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .claude/rules/architecture.md
Comment thread src/Buildvana.Core.Abstractions/Buildvana.Core.Abstractions.csproj
Comment thread src/Buildvana.Tool/Infrastructure/CakeBuildHost.cs
Comment thread Buildvana.slnx.DotSettings Outdated
@rdeago rdeago force-pushed the 239-ibuildhost-abstraction branch from e1d67de to 95cc95a Compare April 29, 2026 00:58
@github-actions github-actions Bot added the area:deps [issue/PR] adds, updates, or removes dependencies. label Apr 29, 2026
@rdeago rdeago force-pushed the 239-ibuildhost-abstraction branch 2 times, most recently from 95cc95a to ee82533 Compare April 29, 2026 12:16
rdeago and others added 2 commits April 29, 2026 14:35
Adds Buildvana.Core.Abstractions with the IBuildHost interface (Fail,
Log(LogLevel, string), IsEnabled(LogLevel)) and a BuildHostExtensions
static class providing Fail<T>, Ensure, and the per-level LogTrace /
LogDebug / LogInformation / LogWarning / LogError shorthand.

Two adapters ship outside the abstractions:

- CakeBuildHost wraps ICakeContext and is registered as IBuildHost
  in BuildContext's DI container.
- MSBuildTaskHost wraps TaskLoggingHelper + IBuildEngine and is
  exposed as a Host property on BuildvanaSdkTask.

Verified by porting one call site each:
ChangelogService.HasUnreleasedChanges (Cake) and GetWinePath.Run
(MSBuild). Wholesale migration of remaining callers is deliberately
out of scope and will land incrementally as libraries are extracted.

Closes Tenacom#239.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Stops the "Suggested name is 'MsBuildTaskHost'" warning on
MSBuild-prefixed type names.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rdeago rdeago force-pushed the 239-ibuildhost-abstraction branch from ee82533 to 1bbae84 Compare April 29, 2026 12:36
@rdeago rdeago merged commit 3772e3a into Tenacom:main Apr 29, 2026
3 checks passed
@rdeago rdeago deleted the 239-ibuildhost-abstraction branch April 29, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:code [issue/PR] affects project code (excluding tests). area:deps [issue/PR] adds, updates, or removes dependencies. area:style [issue/PR] affects editor / code analysis settings. enhancement [issue/PR] requests / implements new or improved functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buildvana.Core Phase 1 — Introduce Buildvana.Core.Abstractions and host implementations

2 participants