Skip to content

build: add package projects (#2) - #28

Merged
michaelstonis merged 1 commit into
mainfrom
2-package-projects
Oct 9, 2026
Merged

michaelstonis merged 1 commit into
mainfrom
2-package-projects

Conversation

@michaelstonis

Copy link
Copy Markdown
Owner

Closes #2

Plan row 0.2: empty class libraries for every package in the Packages table except Layout and Viewer.

What was done

  • Eight projects under src/<Name>/<Name>.csproj, each with an empty PublicAPI.Shipped.txt, a PublicAPI.Unshipped.txt containing #nullable enable, a one-paragraph <Description> matching the Packages table, and an internal static class AssemblyMarker so the assembly is non-empty. No other code. Package versions come from Directory.Packages.props; no Version attributes.
    • Broadside (net10.0): Microsoft.Extensions.DependencyInjection.Abstractions, Microsoft.Extensions.Logging.Abstractions, Microsoft.Extensions.Options, System.Security.Cryptography.Pkcs
    • Broadside.Rendering (net10.0) -> Broadside
    • Broadside.Rendering.Skia (net10.0) -> Broadside.Rendering, SkiaSharp
    • Broadside.Rendering.CoreGraphics (net10.0-macos; net10.0-ios; net10.0-maccatalyst) -> Broadside.Rendering
    • Broadside.Rendering.Direct2D (net10.0-windows10.0.19041.0) -> Broadside.Rendering, Microsoft.Windows.CsWin32 (PrivateAssets=all)
    • Broadside.Rendering.Android (net10.0-android) -> Broadside.Rendering
    • Broadside.Fonts.Standard14 (net10.0) -> Broadside
    • Broadside.Fonts.Cmaps (net10.0) -> Broadside
  • All eight added to Broadside.slnx under the /src/ solution folder.
  • Broadside.Core.slnf: solution filter with the six projects that need no workload (the net10.0 ones plus Direct2D).
  • Platform gate for CoreGraphics and Android: BroadsideBuildPlatformBackends defaults to $([MSBuild]::IsOSPlatform('OSX')) and can be forced with -p:BroadsideBuildPlatformBackends=true|false. When it is off the project does not import the SDK at all and only declares no-op Restore/Build/Rebuild/Clean/Pack targets, so a solution build, restore or pack on a host without workloads (Linux CI) walks past it. See "Deviations" for why.
  • Directory.Solution.props sets DisableWarnForInvalidRestoreProjects so NuGet's solution restore does not warn NU1503 about the gated-off projects (it is imported by the solution build only, which does not read Directory.Build.props).
  • README gains a short "Building" section describing the two build commands, the filter and the gate.

Verification (on this Mac)

Command Result
/usr/local/share/dotnet/dotnet build Broadside.slnx -warnaserror -p:JavaSdkDirectory=/Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home (install with macos, ios, maccatalyst, android workloads) Build succeeded, 0 Warning(s), 0 Error(s); 11 assemblies: 6 core + CoreGraphics x3 TFMs + Android + Direct2D
dotnet build Broadside.Core.slnf -warnaserror (Homebrew install, no workloads) Build succeeded, 0 Warning(s), 0 Error(s)
dotnet pack Broadside.Core.slnf -c Release (Homebrew) 6 packages under artifacts/package/release/: Broadside, Broadside.Rendering, Broadside.Rendering.Skia, Broadside.Rendering.Direct2D, Broadside.Fonts.Standard14, Broadside.Fonts.Cmaps (0.1.0-preview.0.3.nupkg + .snupkg each)
dotnet build Broadside.slnx -warnaserror -p:BroadsideBuildPlatformBackends=false (Homebrew; simulates Linux CI) Build succeeded, 0 Warning(s), 0 Error(s); CoreGraphics and Android skipped
dotnet pack Broadside.slnx -c Release -p:BroadsideBuildPlatformBackends=false (Homebrew) exit 0, 6 packages, platform projects skipped
/usr/local/share/dotnet/dotnet pack Broadside.slnx -c Release -p:JavaSdkDirectory=... exit 0, all 8 packages

Also checked that dotnet build Broadside.slnx on the Homebrew install with the gate at its macOS default fails with NETSDK1147 (workloads missing), which is the case the filter exists for.

Deviations

  • Gate shape. The suggested form (conditional TargetFrameworks that ends up empty) does not work: with both TargetFramework and TargetFrameworks empty the SDK takes the single-target path and fails at restore (NETSDK1210 from IsAotCompatible), and a framework list with no entries sends GetAllRuntimeIdentifiers into a circular dependency during restore. Making the SDK import itself conditional is the form that actually leaves the project with no targets. Side effect: on a host where the gate is off, an IDE loads those two projects as empty shells; Broadside.Core.slnf is the answer there.
  • Directory.Solution.props is a new root file, needed only to silence NU1503 for the gated-off projects during solution restore.
  • EnableWindowsTargeting=true on Direct2D: a versioned net10.0-windows TFM errors NETSDK1100 on macOS and Linux without it.
  • AndroidGenerateResourceDesigner=false on Android: the Android SDK otherwise generates a public Resource class, which fails RS0016 against the empty PublicAPI files. A Canvas backend has no Android resources.
  • No NativeMethods.txt for Direct2D: CsWin32 raised nothing with none present.
  • No .editorconfig changes; no analyzer rule fired on the scaffolding.
  • JDK on this machine. ~/.config/xbuild/monodroid-config.xml points at a removed microsoft-21.jdk, so the Android build here needs -p:JavaSdkDirectory= pointing at the installed JDK 17. That is local configuration, not a repository issue, and was left alone.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 9, 2026 16:20
Eight class libraries under src/ with empty PublicAPI files and an internal AssemblyMarker each, added to Broadside.slnx under /src/. The CoreGraphics and Android backends gate their SDK import on the host (macOS by default, BroadsideBuildPlatformBackends to override) and reduce to no-op targets elsewhere, so the solution builds on hosts without workloads; Broadside.Core.slnf covers the net10.0 projects only. Direct2D enables EnableWindowsTargeting so it builds everywhere.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@michaelstonis
michaelstonis merged commit acf7d91 into main Oct 9, 2026
1 check passed
@michaelstonis
michaelstonis deleted the 2-package-projects branch October 9, 2026 16:22

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.

🟢 Approval recommended

The scaffold meets the issue scope; the remaining README wording feedback is non-blocking.

0 open findings

What changed in this PR

Scaffolds the eight Phase 0 package projects and integrates them into the repository’s build and packaging structure.

Changes:

  • Adds eight packable projects with API baselines and assembly markers.
  • Adds platform-backend gating and a workload-free solution filter.
  • Documents build and packaging commands.
File Description
src/​Broadside/​Broadside.csproj Defines the core package and dependencies.
src/​Broadside/​AssemblyMarker.cs Keeps the core assembly non-empty.
src/​Broadside/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside/​PublicAPI.Unshipped.txt Enables nullable API tracking.
src/​Broadside.Rendering/​Broadside.Rendering.csproj Defines the managed rendering package.
src/​Broadside.Rendering/​AssemblyMarker.cs Keeps the rendering assembly non-empty.
src/​Broadside.Rendering/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside.Rendering/​PublicAPI.Unshipped.txt Enables nullable API tracking.
src/​Broadside.Rendering.Skia/​Broadside.Rendering.Skia.csproj Defines the SkiaSharp backend package.
src/​Broadside.Rendering.Skia/​AssemblyMarker.cs Keeps the Skia assembly non-empty.
src/​Broadside.Rendering.Skia/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside.Rendering.Skia/​PublicAPI.Unshipped.txt Enables nullable API tracking.
src/​Broadside.Rendering.Direct2D/​Broadside.Rendering.Direct2D.csproj Defines the Direct2D backend package.
src/​Broadside.Rendering.Direct2D/​AssemblyMarker.cs Keeps the Direct2D assembly non-empty.
src/​Broadside.Rendering.Direct2D/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside.Rendering.Direct2D/​PublicAPI.Unshipped.txt Enables nullable API tracking.
src/​Broadside.Rendering.CoreGraphics/​Broadside.Rendering.CoreGraphics.csproj Defines and gates the Apple backend package.
src/​Broadside.Rendering.CoreGraphics/​AssemblyMarker.cs Keeps the CoreGraphics assembly non-empty.
src/​Broadside.Rendering.CoreGraphics/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside.Rendering.CoreGraphics/​PublicAPI.Unshipped.txt Enables nullable API tracking.
src/​Broadside.Rendering.Android/​Broadside.Rendering.Android.csproj Defines and gates the Android backend package.
src/​Broadside.Rendering.Android/​AssemblyMarker.cs Keeps the Android assembly non-empty.
src/​Broadside.Rendering.Android/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside.Rendering.Android/​PublicAPI.Unshipped.txt Enables nullable API tracking.
src/​Broadside.Fonts.Standard14/​Broadside.Fonts.Standard14.csproj Defines the Standard 14 glyph package.
src/​Broadside.Fonts.Standard14/​AssemblyMarker.cs Keeps the font assembly non-empty.
src/​Broadside.Fonts.Standard14/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside.Fonts.Standard14/​PublicAPI.Unshipped.txt Enables nullable API tracking.
src/​Broadside.Fonts.Cmaps/​Broadside.Fonts.Cmaps.csproj Defines the predefined CMaps package.
src/​Broadside.Fonts.Cmaps/​AssemblyMarker.cs Keeps the CMaps assembly non-empty.
src/​Broadside.Fonts.Cmaps/​PublicAPI.Shipped.txt Adds the shipped API baseline.
src/​Broadside.Fonts.Cmaps/​PublicAPI.Unshipped.txt Enables nullable API tracking.
Broadside.slnx Registers all package projects.
Broadside.Core.slnf Adds the workload-free project filter.
Directory.Solution.props Suppresses intentional skipped-project restore warnings.
README.md Documents build, pack, filter, and gate usage.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

[Scaffold] Package projects

2 participants