Add cargo ci dlls command for building C# DLLs and NuGet packages#4033
Add cargo ci dlls command for building C# DLLs and NuGet packages#4033
cargo ci dlls command for building C# DLLs and NuGet packages#4033Conversation
…d NuGet packages
sdks/csharp/unity-meta-skeleton~/spacetimedb.bsatn.runtime/lib/net8.0.meta
Show resolved
Hide resolved
bfops
left a comment
There was a problem hiding this comment.
This looks pretty great to me. I left some nits, and I think there may be some remaining meta dance to do.
also, I see more files getting restored such as LICENSE and logo.png, so I think we should possibly do what #3648 did and add a gitignore for those files as well.
Updated |
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com> Signed-off-by: Ryan <r.ekhoff@clockworklabs.io>
bfops
left a comment
There was a problem hiding this comment.
I thought I had already approved. LGTM! Thanks @rekhoff .
Someday it would be nice to add tests for some of the behavior, like the skeleton directory overlaying, or that dotnet restore has meta files on all platforms, but that seems out of scope for now since they're pretty easy to hand-test.
# Description of Changes This patches a regression introduced in [#4033](#4033) where cargo ci dlls stopped copying the Unity .meta files that live outside the package skeleton tree: 1. `overlay_unity_meta_skeleton` now copies any `sdks/csharp/unity-meta-skeleton~/spacetimedb.<pkg>.meta` file into `sdks/csharp/packages/` before overlaying nested content. 2. Added support for a `version.meta` template inside each skeleton package; it’s renamed to match the single restored version directory (e.g. `1.11.2.meta`). 3. Added the missing `version.meta` templates for both `spacetimedb.bsatn.runtime` and `spacetimedb.runtime`, based on the historical GUIDs Unity already knows about. Together this restores the `spacetimedb.bsatn.runtime.meta` and `<version>.meta` files that Unity requires to keep those folders visible when developers run `cargo ci dlls` on a clean checkout. # API and ABI breaking changes None. This only affects the CI helper responsible for syncing Unity metadata. # Expected complexity level and risk 2 — localized changes to the CI helper and skeleton assets. Primary risk is forgetting a template or mis-copying a GUID; the code paths themselves are straightforward. # Testing - [X] Ran `cargo check -p ci` - [X] Ran `cargo ci dlls` on a clean tree, verifying that: * `sdks/csharp/packages/spacetimedb.bsatn.runtime.meta` exists * The restored version directory (e.g. `sdks/csharp/packages/spacetimedb.bsatn.runtime/1.11.2.meta`) exists - [X] Locally launched Unity with a SpacetimeDB project and had no errors/issues.
# Description of Changes This patches a regression introduced in [#4033](#4033) where cargo ci dlls stopped copying the Unity .meta files that live outside the package skeleton tree: 1. `overlay_unity_meta_skeleton` now copies any `sdks/csharp/unity-meta-skeleton~/spacetimedb.<pkg>.meta` file into `sdks/csharp/packages/` before overlaying nested content. 2. Added support for a `version.meta` template inside each skeleton package; it’s renamed to match the single restored version directory (e.g. `1.11.2.meta`). 3. Added the missing `version.meta` templates for both `spacetimedb.bsatn.runtime` and `spacetimedb.runtime`, based on the historical GUIDs Unity already knows about. Together this restores the `spacetimedb.bsatn.runtime.meta` and `<version>.meta` files that Unity requires to keep those folders visible when developers run `cargo ci dlls` on a clean checkout. # API and ABI breaking changes None. This only affects the CI helper responsible for syncing Unity metadata. # Expected complexity level and risk 2 — localized changes to the CI helper and skeleton assets. Primary risk is forgetting a template or mis-copying a GUID; the code paths themselves are straightforward. # Testing - [X] Ran `cargo check -p ci` - [X] Ran `cargo ci dlls` on a clean tree, verifying that: * `sdks/csharp/packages/spacetimedb.bsatn.runtime.meta` exists * The restored version directory (e.g. `sdks/csharp/packages/spacetimedb.bsatn.runtime/1.11.2.meta`) exists - [X] Locally launched Unity with a SpacetimeDB project and had no errors/issues.
# Description of Changes This patches a regression introduced in [#4033](#4033) where cargo ci dlls stopped copying the Unity .meta files that live outside the package skeleton tree: 1. `overlay_unity_meta_skeleton` now copies any `sdks/csharp/unity-meta-skeleton~/spacetimedb.<pkg>.meta` file into `sdks/csharp/packages/` before overlaying nested content. 2. Added support for a `version.meta` template inside each skeleton package; it’s renamed to match the single restored version directory (e.g. `1.11.2.meta`). 3. Added the missing `version.meta` templates for both `spacetimedb.bsatn.runtime` and `spacetimedb.runtime`, based on the historical GUIDs Unity already knows about. Together this restores the `spacetimedb.bsatn.runtime.meta` and `<version>.meta` files that Unity requires to keep those folders visible when developers run `cargo ci dlls` on a clean checkout. # API and ABI breaking changes None. This only affects the CI helper responsible for syncing Unity metadata. # Expected complexity level and risk 2 — localized changes to the CI helper and skeleton assets. Primary risk is forgetting a template or mis-copying a GUID; the code paths themselves are straightforward. # Testing - [X] Ran `cargo check -p ci` - [X] Ran `cargo ci dlls` on a clean tree, verifying that: * `sdks/csharp/packages/spacetimedb.bsatn.runtime.meta` exists * The restored version directory (e.g. `sdks/csharp/packages/spacetimedb.bsatn.runtime/1.11.2.meta`) exists - [X] Locally launched Unity with a SpacetimeDB project and had no errors/issues.
# Description of Changes This patches a regression introduced in [#4033](clockworklabs/SpacetimeDB#4033) where cargo ci dlls stopped copying the Unity .meta files that live outside the package skeleton tree: 1. `overlay_unity_meta_skeleton` now copies any `sdks/csharp/unity-meta-skeleton~/spacetimedb.<pkg>.meta` file into `sdks/csharp/packages/` before overlaying nested content. 2. Added support for a `version.meta` template inside each skeleton package; it’s renamed to match the single restored version directory (e.g. `1.11.2.meta`). 3. Added the missing `version.meta` templates for both `spacetimedb.bsatn.runtime` and `spacetimedb.runtime`, based on the historical GUIDs Unity already knows about. Together this restores the `spacetimedb.bsatn.runtime.meta` and `<version>.meta` files that Unity requires to keep those folders visible when developers run `cargo ci dlls` on a clean checkout. # API and ABI breaking changes None. This only affects the CI helper responsible for syncing Unity metadata. # Expected complexity level and risk 2 — localized changes to the CI helper and skeleton assets. Primary risk is forgetting a template or mis-copying a GUID; the code paths themselves are straightforward. # Testing - [X] Ran `cargo check -p ci` - [X] Ran `cargo ci dlls` on a clean tree, verifying that: * `sdks/csharp/packages/spacetimedb.bsatn.runtime.meta` exists * The restored version directory (e.g. `sdks/csharp/packages/spacetimedb.bsatn.runtime/1.11.2.meta`) exists - [X] Locally launched Unity with a SpacetimeDB project and had no errors/issues.
Description of Changes
cargo ci dllssubcommand to build/pack the in-repo C# NuGet packages and the C# SDK.cargo ci dllsrestoressdks/csharp/SpacetimeDB.ClientSDK.csprojusing the freshly built local package outputs as to populatesdks/csharp/packages/**..metaskeleton undersdks/csharp/unity-meta-skeleton~/**and overlays those.metafiles onto the latest restored versioned package directory to keep Unity GUIDs stable and import settings consistent.net8.0, and marking analyzer DLLs with theRoslynAnalyzerlabel so Unity can recognize them).How to use (local)
# Build/pack + restore local packages into sdks/csharp/packages/** cargo ci dllsAPI and ABI breaking changes
N/A
Expected complexity level and risk
2 - Local developer tooling + file overlay into restore output; no runtime/SDK API behavior changes.
Testing
cargo check -p cicargo ci dllsand verified the output undersdks/csharp/packages/**and the various NuGet package locations.