From ead933971c0bacc91ee1d8604f939cb499363db3 Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Sat, 23 May 2026 00:01:45 +1200 Subject: [PATCH 1/2] feat(shims): add Nuke.Build and Nuke.Components transition shims (#69 session 3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the two remaining historically-published Nuke.* package IDs as transition shims. `Nuke.GlobalTool` is omitted (was a CLI tool, not a library consumers used `using` against). `Nuke.MSBuildTasks` is omitted (never shipped to nuget.org). Each shim is the same pattern as src/Shims/Nuke.Common: - TargetFramework=net10.0 - Analyzer-attached Fallout.SourceGenerators reference, so the TransitionShimGenerator emits the type mirror at compile time - ShimMarker.cs holds the single `[assembly: ShimAllPublicTypesUnder]` declaration scoping the generator's namespace swap - README.md pointing at docs/migration/from-nuke.md Marker namespaces: - Nuke.Build ← Fallout.Build (currently covers Fallout.Build.Execution.Extensions) - Nuke.Components ← Fallout.Components (covers the IPack / ICompile / ITest / IPublish / IHaz* interface family) Both build clean against the existing generator (0 warnings, 0 errors). StronglyTypedSolutionGeneratorTest snapshot regenerated to include the two new projects in fallout.slnx. release.yml already globs `output/packages/Nuke.*.nupkg` for the GH Packages push (#47), so the new shim nupkgs will be published automatically on the next release run. Co-Authored-By: Claude Opus 4.7 (1M context) --- fallout.slnx | 2 ++ src/Shims/Nuke.Build/Nuke.Build.csproj | 30 +++++++++++++++++++ src/Shims/Nuke.Build/README.md | 19 ++++++++++++ src/Shims/Nuke.Build/ShimMarker.cs | 12 ++++++++ .../Nuke.Components/Nuke.Components.csproj | 28 +++++++++++++++++ src/Shims/Nuke.Components/README.md | 19 ++++++++++++ src/Shims/Nuke.Components/ShimMarker.cs | 13 ++++++++ ...nGeneratorTest.Test#Solution.g.verified.cs | 2 ++ 8 files changed, 125 insertions(+) create mode 100644 src/Shims/Nuke.Build/Nuke.Build.csproj create mode 100644 src/Shims/Nuke.Build/README.md create mode 100644 src/Shims/Nuke.Build/ShimMarker.cs create mode 100644 src/Shims/Nuke.Components/Nuke.Components.csproj create mode 100644 src/Shims/Nuke.Components/README.md create mode 100644 src/Shims/Nuke.Components/ShimMarker.cs diff --git a/fallout.slnx b/fallout.slnx index f85edeeb2..797d0cb45 100644 --- a/fallout.slnx +++ b/fallout.slnx @@ -17,7 +17,9 @@ + + diff --git a/src/Shims/Nuke.Build/Nuke.Build.csproj b/src/Shims/Nuke.Build/Nuke.Build.csproj new file mode 100644 index 000000000..2db4b8b3b --- /dev/null +++ b/src/Shims/Nuke.Build/Nuke.Build.csproj @@ -0,0 +1,30 @@ + + + + net10.0 + Nuke.Build + Nuke.Build + Nuke.Build + Nuke.Build (Fallout transition shim) + + true + Transition shim that re-exports the most common Nuke.Build types as subclasses/wrappers of the canonical Fallout.* types. For projects mid-migration from NUKE to Fallout. Published only to GitHub Packages (nuget.org's Nuke.Build is owned by the original NUKE maintainer). + build automation continuous-integration tools orchestration nuke shim transition + + false + + + + + + + + diff --git a/src/Shims/Nuke.Build/README.md b/src/Shims/Nuke.Build/README.md new file mode 100644 index 000000000..c4d6797d8 --- /dev/null +++ b/src/Shims/Nuke.Build/README.md @@ -0,0 +1,19 @@ +# Nuke.Build transition shim + +Transition shim for projects mid-migration from NUKE to Fallout. Published to **GitHub Packages** only — `Nuke.Build` on nuget.org is owned by the original NUKE maintainer. + +Generated by Fallout's `TransitionShimGenerator` from the canonical `Fallout.Build` namespace surface. Types are emitted as subclass/sub-interface wrappers inheriting from their `Fallout.*` counterparts; consumer code that says `using Nuke.Build;` keeps compiling against the new types. + +Coverage and limitations are the same as the `Nuke.Common` shim — see [`../Nuke.Common/README.md`](../Nuke.Common/README.md) for the full surface description. + +## Consumer setup + +Add this fork's GitHub Packages feed to your `nuget.config`: + +```xml + +``` + +Then bump your `Nuke.Build` package reference to the latest 10.3.x or later. + +Full migration walkthrough: [`docs/migration/from-nuke.md`](../../../docs/migration/from-nuke.md). diff --git a/src/Shims/Nuke.Build/ShimMarker.cs b/src/Shims/Nuke.Build/ShimMarker.cs new file mode 100644 index 000000000..cd8dc5a3a --- /dev/null +++ b/src/Shims/Nuke.Build/ShimMarker.cs @@ -0,0 +1,12 @@ +// Copyright 2026 Maintainers of Fallout. +// Originally based on NUKE by Matthias Koch and contributors. +// Distributed under the MIT License. +// https://github.com/ChrisonSimtian/Fallout/blob/main/LICENSE + +// Tells the TransitionShimGenerator to emit shims for every public type whose +// namespace begins with "Fallout.Build." into the corresponding "Nuke.Build." +// namespace. + +[assembly: Fallout.Migrate.Shims.ShimAllPublicTypesUnder( + fromNamespacePrefix: "Fallout.Build", + toNamespacePrefix: "Nuke.Build")] diff --git a/src/Shims/Nuke.Components/Nuke.Components.csproj b/src/Shims/Nuke.Components/Nuke.Components.csproj new file mode 100644 index 000000000..0bb08b6c8 --- /dev/null +++ b/src/Shims/Nuke.Components/Nuke.Components.csproj @@ -0,0 +1,28 @@ + + + + net10.0 + Nuke.Components + Nuke.Components + Nuke.Components + Nuke.Components (Fallout transition shim) + + true + Transition shim that re-exports the Nuke.Components composition interfaces (ICompile, IRestore, IPack, etc.) as sub-interfaces of the canonical Fallout.Components types. For projects mid-migration from NUKE to Fallout. Published only to GitHub Packages. + build automation continuous-integration tools orchestration nuke shim transition components + false + + + + + + + + diff --git a/src/Shims/Nuke.Components/README.md b/src/Shims/Nuke.Components/README.md new file mode 100644 index 000000000..db8cf1a09 --- /dev/null +++ b/src/Shims/Nuke.Components/README.md @@ -0,0 +1,19 @@ +# Nuke.Components transition shim + +Transition shim for projects mid-migration from NUKE to Fallout. Published to **GitHub Packages** only — `Nuke.Components` on nuget.org is owned by the original NUKE maintainer. + +Mirrors the canonical `Fallout.Components` interface family (`ICompile`, `IRestore`, `IPack`, `ITest`, `IPublish`, the `IHaz*` family, etc.) under the `Nuke.Components` namespace. Consumer code that says `class Build : NukeBuild, IPack, ITest` continues to compile. + +Limitations are the same as the `Nuke.Common` shim — see [`../Nuke.Common/README.md`](../Nuke.Common/README.md). + +## Consumer setup + +Add this fork's GitHub Packages feed to your `nuget.config`: + +```xml + +``` + +Then bump your `Nuke.Components` package reference to the latest 10.3.x or later. + +Full migration walkthrough: [`docs/migration/from-nuke.md`](../../../docs/migration/from-nuke.md). diff --git a/src/Shims/Nuke.Components/ShimMarker.cs b/src/Shims/Nuke.Components/ShimMarker.cs new file mode 100644 index 000000000..b1fc4d3f7 --- /dev/null +++ b/src/Shims/Nuke.Components/ShimMarker.cs @@ -0,0 +1,13 @@ +// Copyright 2026 Maintainers of Fallout. +// Originally based on NUKE by Matthias Koch and contributors. +// Distributed under the MIT License. +// https://github.com/ChrisonSimtian/Fallout/blob/main/LICENSE + +// Tells the TransitionShimGenerator to emit shims for every public type whose +// namespace begins with "Fallout.Components" into the corresponding +// "Nuke.Components" namespace. The bulk of this assembly is the component +// interface family (ICompile, IRestore, IPack, ITest, IPublish, IHaz*). + +[assembly: Fallout.Migrate.Shims.ShimAllPublicTypesUnder( + fromNamespacePrefix: "Fallout.Components", + toNamespacePrefix: "Nuke.Components")] diff --git a/tests/Fallout.SourceGenerators.Tests/StronglyTypedSolutionGeneratorTest.Test#Solution.g.verified.cs b/tests/Fallout.SourceGenerators.Tests/StronglyTypedSolutionGeneratorTest.Test#Solution.g.verified.cs index c6ea8197a..d1264f175 100644 --- a/tests/Fallout.SourceGenerators.Tests/StronglyTypedSolutionGeneratorTest.Test#Solution.g.verified.cs +++ b/tests/Fallout.SourceGenerators.Tests/StronglyTypedSolutionGeneratorTest.Test#Solution.g.verified.cs @@ -39,8 +39,10 @@ internal class Solution(SolutionModel model, AbsolutePath path) : Fallout.Common public Fallout.Common.ProjectModel.Project Fallout_Utilities_Text_Json => this.GetProject("Fallout.Utilities.Text.Json"); public Fallout.Common.ProjectModel.Project Fallout_Utilities_Text_Yaml => this.GetProject("Fallout.Utilities.Text.Yaml"); public Fallout.Common.ProjectModel.Project Fallout_VisualStudio_SolutionPersistence => this.GetProject("Fallout.VisualStudio.SolutionPersistence"); + public Fallout.Common.ProjectModel.Project Nuke_Build => this.GetProject("Nuke.Build"); public Fallout.Common.ProjectModel.Project Nuke_Common => this.GetProject("Nuke.Common"); public Fallout.Common.ProjectModel.Project Nuke_Common_Shim_Tests => this.GetProject("Nuke.Common.Shim.Tests"); + public Fallout.Common.ProjectModel.Project Nuke_Components => this.GetProject("Nuke.Components"); public _misc misc => Unsafe.As<_misc>(this.GetSolutionFolder("misc")); From cf281f7e83c4888282a61ebcc94bcca3cd90d0ce Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Fri, 22 May 2026 22:51:10 +1200 Subject: [PATCH 2/2] ci(pr): attach HEAD on PR checkout so detached-HEAD-sensitive tests pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions/checkout defaults to the merge SHA on pull_request events, leaving HEAD detached. GitRepository.FromLocalDirectory asserts repository.Branch != null which throws in that state, so Fallout.Common.Tests.GitHubTasksTest.GitHubRepositoryFromLocalDirectoryTest fails the moment any PR triggers ubuntu-latest validation. ref: ${{ github.head_ref }} checks out the source branch directly, which leaves HEAD attached to the branch name. Tests then see the same git state they'd see on a developer's machine. This file is auto-generated by Fallout — the next regen via `fallout --generate-configuration GitHubActions_ubuntu-latest` will overwrite this fix. Tracking the underlying issue (either fix the generator to emit ref: github.head_ref on PR triggers, or make GitRepository.FromLocalDirectory tolerate detached HEAD) is queued. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ubuntu-latest.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index 721ca8569..7aaa4355a 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -34,6 +34,11 @@ jobs: with: submodules: recursive fetch-depth: 0 + # Check out the source branch (not the merge SHA) so HEAD stays + # attached. GitHubTasksTest.GitHubRepositoryFromLocalDirectoryTest + # requires repository.Branch to be non-null. NOTE: this file is + # auto-generated by Fallout; next regen will overwrite. Track in #110. + ref: ${{ github.head_ref }} - name: 'Cache: .fallout/temp, ~/.nuget/packages' uses: actions/cache@v4 with: