Skip to content

Fix self-contained builds: pin SDK, isolate TFMs, add local NuGet feed#4

Merged
ayersdecker merged 2 commits into
mainfrom
copilot/adjust-framework-compatibility
Jun 23, 2026
Merged

Fix self-contained builds: pin SDK, isolate TFMs, add local NuGet feed#4
ayersdecker merged 2 commits into
mainfrom
copilot/adjust-framework-compatibility

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

CI builds were failing because the repo had no SDK pin (letting .NET 10 on runners shadow the intended 9.x install) and no mechanism to resolve Ferrum.* packages locally. The MinimalDemo project reference also forced all TFMs to build even when targeting a single platform.

Changes

  • global.json — pins SDK to 9.0.x (latestMinor). Prevents macOS/Ubuntu runners with .NET 10 pre-installed from picking SDK 10 for workload installs; iOS MAUI workload under SDK 10 resolved net9.0-ios band 26.5.9002, which requires Xcode 26.5 (only 16.2 available).

  • samples/MinimalDemo/MinimalDemo.csproj — adds SetTargetFramework=$(TargetFramework) to the Ferrum.Framework project reference:

    <ProjectReference Include="..\..\src\Framework\Ferrum.Framework.csproj">
      <SetTargetFramework>TargetFramework=$(TargetFramework)</SetTargetFramework>
    </ProjectReference>

    Without this, dotnet build -f net9.0-android still compiled all TFMs of the referenced project (including net9.0-ios), failing on Android-only runners that lack the iOS workload.

  • nuget.config (repo root) — declares a local-packages feed at artifacts/nuget with package-source mapping scoping Ferrum.* to it. Eliminates the dependency on Ferrum.* being published to NuGet.org for in-repo development; pack locally into artifacts/nuget and all consumers restore without issue.

  • templates/maui-ferrum/nuget.config — scaffolded projects carry a ready-to-uncomment local feed config so users developing against a local Ferrum build have a clear path without additional setup.

@ayersdecker ayersdecker left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

:)

@ayersdecker ayersdecker marked this pull request as ready for review June 23, 2026 23:54
Copilot AI review requested due to automatic review settings June 23, 2026 23:54
@ayersdecker ayersdecker merged commit 321e2ae into main Jun 23, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to make builds more self-contained and reliable across CI/local environments by pinning the .NET SDK, preventing unintended cross-TFM project builds, and enabling in-repo package restores via a local NuGet feed.

Changes:

  • Add a global.json to pin the repo’s .NET SDK and control roll-forward behavior.
  • Adjust MinimalDemo’s ProjectReference to build only the currently targeted TFM.
  • Introduce NuGet configuration for a local artifacts/nuget feed (repo-wide) and provide a template nuget.config for scaffolded MAUI projects.

Reviewed changes

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

File Description
global.json Pins the .NET SDK selection to avoid unintended SDK/tooling drift on runners.
samples/MinimalDemo/MinimalDemo.csproj Ensures the referenced framework project builds only the active target framework.
nuget.config Adds a local package source and package source mapping to support in-repo development packages.
templates/maui-ferrum/nuget.config Adds a scaffolded NuGet config to guide consumers on using a local feed during development.

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

Comment thread nuget.config
Comment on lines +16 to +29
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="local-packages" value="artifacts/nuget" />
</packageSources>
<packageSourceMapping>
<!-- Ferrum.* packages come from the local feed (or nuget.org once published). -->
<packageSource key="local-packages">
<package pattern="Ferrum.*" />
</packageSource>
<!-- Everything else comes from nuget.org. -->
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
Comment on lines +11 to +24
Then update the "local-packages" source below to point at that directory.
Once the package is published to NuGet.org you can remove this file or leave
it — the packageSourceMapping ensures only Ferrum.* resolves locally.
-->
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<!-- Uncomment and point at the artifacts/nuget directory produced by
dotnet pack src/Framework/Ferrum.Framework.csproj -o artifacts/nuget
(relative paths are resolved from the directory containing this file):
<add key="local-packages" value="artifacts/nuget" />
-->
</packageSources>
</configuration>
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.

3 participants