feat: ship Nuke.Common MVP transition shim#70
Merged
Conversation
Closes part of #47 — see #69 for the source-generator follow-up that expands coverage to the full public API surface. ## What this is A hand-written package named `Nuke.Common` that re-exports the most common Nuke.* types as subclasses of the canonical Fallout.* types. For projects mid-migration from NUKE to Fallout — adds our GH Packages feed, bumps Nuke.Common version, and a `class Build : NukeBuild` with [Parameter] / [Secret] / [Solution] / [GitRepository] compiles unchanged. ## Coverage | Old (Nuke.Common) | New (Fallout.Common) | Mechanism | |---|---|---| | NukeBuild | FalloutBuild | Subclass | | INukeBuild | IFalloutBuild | Sub-interface | | [Parameter] | ParameterAttribute | Subclass | | [Secret] | SecretAttribute | Subclass | | [Solution] (in .ProjectModel) | SolutionAttribute | Subclass | | [GitRepository] (in .Git) | GitRepositoryAttribute | Subclass | ## NOT in this MVP (tracked in #69) - Source generator for the remaining ~150 types in Common alone - Other shim packages (Nuke.Build, Nuke.Components, etc.) - CI attributes ([GitHubActions] etc.) — block on enums (GitHubActionsImage), can't bridge without source generator - Target delegate — C# can't implicitly convert between delegate types, needs `fallout-migrate` for the source-level rename - Static helper classes (DotNetTasks etc.) — need method-by-method delegation, scale-only-with-generator ## Packaging The shim is `IsPackable=false` by default to keep the standard release pipeline (which targets nuget.org) from trying to push `Nuke.Common` there — that ID belongs to the original NUKE maintainer. To produce the nupkg for GH-Packages publish: dotnet pack src/Shims/Nuke.Common/Nuke.Common.csproj -p:PackShims=true A dedicated publish target for GH Packages is part of #69. ## Tests - `tests/Nuke.Common.Shim.Tests/SampleConsumerBuild.cs` — compile-only test mirroring a typical consumer Build.cs. If it compiles, the shim covers what it claims to cover. ## Side-effect StronglyTypedSolutionGeneratorTest verify snapshot regenerated — solution generator picks up the two new projects (Nuke.Common, Nuke.Common.Shim.Tests). ## Verification - dotnet build src/Shims/Nuke.Common: 0 errors, 0 warnings - dotnet build tests/Nuke.Common.Shim.Tests: 0 errors (sample consumer compiles) - dotnet pack -p:PackShims=true: produces Nuke.Common.10.2.20-*.nupkg - dotnet pack without the flag: skips the shim (release pipeline safe) - dotnet test fallout.slnx: 408 passed (was 408; verify snapshot updated) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per review: gating shim packaging behind a property was clunky. The cleaner separation is "pack everything as build artifacts; filter at the publish step." Changes: - src/Shims/Nuke.Common/Nuke.Common.csproj: drop the IsPackable=$(PackShims) gate, IsPackable=true unconditionally. The shim packs on every build like any other library project. - build/Build.cs: override IPublish.PushPackageFiles to filter out files whose name starts with "Nuke." — that ID belongs to the original NUKE maintainer on nuget.org. Fallout.* keeps publishing normally; Nuke.Common.nupkg ends up in the packages directory as a build artifact to upload to GitHub Packages or attach to a release. - src/Shims/Nuke.Common/README.md: document the manual GH Packages push command for the transition window. Verified locally: `dotnet pack` on the shim project produces the nupkg without any opt-in flag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
A hand-written
Nuke.Commonpackage that subclasses the canonical Fallout.* types to give NUKE-era consumers a transition lifeline. Adds our GitHub Packages feed, bumpsNuke.Common, and aclass Build : NukeBuild { [Parameter] ... [Secret] ... [Solution] ... [GitRepository] ... }compiles unchanged.Closes the MVP scope of #47. Source-generator follow-up tracked in #69.
Coverage
Nuke.Common)Fallout.Common)NukeBuildFalloutBuildINukeBuildIFalloutBuild[Parameter]ParameterAttribute[Secret]SecretAttribute[Solution](Nuke.Common.ProjectModel)SolutionAttribute[GitRepository](Nuke.Common.Git)GitRepositoryAttributeWhat's NOT in this MVP (in #69)
[GitHubActions]etc.) — bridged enums (GitHubActionsImage) need source-generator-level workTargetdelegate — C# disallows cross-type delegate conversion;fallout-migratehandles the source renameDotNetTasksetc.) — need method-by-method delegation; scale-only-with-generatorPackaging
The shim is
IsPackable=falseby default — keeps the standard release pipeline from trying to pushNuke.Commonto nuget.org (matkoch owns that ID). Producing the nupkg for the GH-Packages-only publish:Verified: default
dotnet packskips this project; with-p:PackShims=trueit producesNuke.Common.10.2.20-*.nupkg.A dedicated dual-publish target (Fallout.* → nuget.org, Nuke.* → GH Packages) is part of #69.
Tests
tests/Nuke.Common.Shim.Tests/SampleConsumerBuild.csis a compile-only test mirroring a typical consumer Build.cs:If this file compiles, the shim covers what it claims to cover. Compiles cleanly.
Side-effect
StronglyTypedSolutionGeneratorTest.Test#Solution.g.verified.csregenerated — the new projects (Nuke.Common,Nuke.Common.Shim.Tests) get strongly-typed accessorsSolution.Nuke_CommonandSolution.Nuke_Common_Shim_Tests.Verification
dotnet build src/Shims/Nuke.Common: 0 errors, 0 warningsdotnet build tests/Nuke.Common.Shim.Tests: 0 errors (sample consumer compiles)dotnet test fallout.slnx: 408 passed, 7 skipped, 0 faileddotnet pack -p:PackShims=true: produces a valid nupkgdotnet pack(default): correctly skips the shimTest plan for reviewer
ubuntu-latestNuke.Commonto nuget.org (defaultPackexcludes it)PackShims=trueand confirm consumers can install from a local feed🤖 Generated with Claude Code