IBuildHost abstraction and host adapters#245
Merged
Merged
Conversation
There was a problem hiding this comment.
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.AbstractionswithIBuildHost,LogLevel, andBuildHostExtensions. - Added host adapters:
CakeBuildHost(Tool) andMSBuildTaskHost(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.
e1d67de to
95cc95a
Compare
95cc95a to
ee82533
Compare
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>
ee82533 to
1bbae84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Buildvana.Core.AbstractionswithIBuildHost(Fail,Log(LogLevel, string),IsEnabled(LogLevel)) and aBuildHostExtensionsstatic class that providesFail<T>,Ensure, and the per-levelLogTrace/LogDebug/LogInformation/LogWarning/LogErrorshorthand.CakeBuildHost(inBuildvana.Tool) wrapsICakeContextand is registered asIBuildHostinBuildContext's DI container.MSBuildTaskHost(inBuildvana.Sdk.Tasks) wrapsTaskLoggingHelper+IBuildEngineand is exposed via aHostproperty onBuildvanaSdkTask.ChangelogService.HasUnreleasedChanges(Cake) andGetWinePath.Run(MSBuild). Wholesale migration of remaining callers is out of scope and lands incrementally as libraries are extracted..Abstractionsdiscipline rule in.claude/rules/architecture.md.Closes #239.
Test plan
dotnet bv buildclean — 0 warnings, 0 errors.--dry-runnot available forbv).