Skip to content

feat: ship Nuke.Common MVP transition shim#70

Merged
ChrisonSimtian merged 2 commits into
mainfrom
feature/shim-nuke-common-mvp
May 21, 2026
Merged

feat: ship Nuke.Common MVP transition shim#70
ChrisonSimtian merged 2 commits into
mainfrom
feature/shim-nuke-common-mvp

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Summary

A hand-written Nuke.Common package that subclasses the canonical Fallout.* types to give NUKE-era consumers a transition lifeline. Adds our GitHub Packages feed, bumps Nuke.Common, and a class Build : NukeBuild { [Parameter] ... [Secret] ... [Solution] ... [GitRepository] ... } compiles unchanged.

Closes the MVP scope of #47. Source-generator follow-up tracked in #69.

Coverage

Old (Nuke.Common) New (Fallout.Common) Mechanism
NukeBuild FalloutBuild Subclass
INukeBuild IFalloutBuild Sub-interface
[Parameter] ParameterAttribute Subclass with constructor mirroring
[Secret] SecretAttribute Subclass
[Solution] (Nuke.Common.ProjectModel) SolutionAttribute Subclass
[GitRepository] (Nuke.Common.Git) GitRepositoryAttribute Subclass

What's NOT in this MVP (in #69)

  • Source generator for the ~150 remaining public types in Common, plus other shim packages
  • CI attributes ([GitHubActions] etc.) — bridged enums (GitHubActionsImage) need source-generator-level work
  • Target delegate — C# disallows cross-type delegate conversion; fallout-migrate handles the source rename
  • Static helper classes (DotNetTasks etc.) — need method-by-method delegation; scale-only-with-generator

Packaging

The shim is IsPackable=false by default — keeps the standard release pipeline from trying to push Nuke.Common to nuget.org (matkoch owns that ID). Producing the nupkg for the GH-Packages-only publish:

dotnet pack src/Shims/Nuke.Common/Nuke.Common.csproj -p:PackShims=true

Verified: default dotnet pack skips this project; with -p:PackShims=true it produces Nuke.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.cs is a compile-only test mirroring a typical consumer Build.cs:

using Nuke.Common;
using Nuke.Common.Git;
using Nuke.Common.ProjectModel;

public abstract class SampleConsumerBuild : NukeBuild, INukeBuild
{
    [Parameter] readonly string Configuration;
    [Secret] readonly string NuGetApiKey;
    [Solution] readonly Fallout.Common.ProjectModel.Solution Solution;
    [Solution("path/to/explicit.slnx")] readonly Fallout.Common.ProjectModel.Solution ExplicitSolution;
    [GitRepository] readonly Fallout.Common.Git.GitRepository GitRepository;
}

If this file compiles, the shim covers what it claims to cover. Compiles cleanly.

Side-effect

StronglyTypedSolutionGeneratorTest.Test#Solution.g.verified.cs regenerated — the new projects (Nuke.Common, Nuke.Common.Shim.Tests) get strongly-typed accessors Solution.Nuke_Common and Solution.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 test fallout.slnx: 408 passed, 7 skipped, 0 failed
  • dotnet pack -p:PackShims=true: produces a valid nupkg
  • dotnet pack (default): correctly skips the shim

Test plan for reviewer

  • CI green on ubuntu-latest
  • On merge, release pipeline doesn't try to push Nuke.Common to nuget.org (default Pack excludes it)
  • Manually pack with PackShims=true and confirm consumers can install from a local feed

🤖 Generated with Claude Code

ChrisonSimtian and others added 2 commits May 21, 2026 20:03
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>
@ChrisonSimtian
ChrisonSimtian merged commit 368a55d into main May 21, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feature/shim-nuke-common-mvp branch May 21, 2026 08:19
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