Repository navigation
Conversation
…Get packages A project whose metaplay-project.yaml has no 'sdkRootDir' references the SDK as NuGet packages instead of having it in a directory. - The SDK version is the MetaplaySDKVersion property in the project's Directory.Build.props, read as a literal without evaluating MSBuild. - The SDK files the CLI reads (version.yaml, Dockerfile.server and the files the image build copies, the web client presets) come from the sdk/ directory of the Metaplay.Server package at that version: from the project's NuGetPackages/ local package source, unpacked into the CLI's cache, or else from NuGet's package cache. No step needs .NET. - 'build image' passes the package's Dockerfile.server with -f, and its sdk/ directory as the build context 'sdk'. - When MetaplaySDK/ also has the SDK's sources, package mode fails, because the build would use those sources while the CLI and the image use the packages. - 'update sdk', 'test system', 'test dotnet-unit', 'init dashboard' and 'dev clean-dashboard-artifacts' need the SDK's sources, and refuse in package mode. - 'sdkRootDir' is no longer required in metaplay-project.yaml.
…rgets A project builds against the SDK's sources when its Directory.Build.targets imports MetaplaySDK/Backend/Metaplay.SourceReferences.targets, which only the sources have. Check for that file instead of Metaplay.Cloud.csproj, so that the CLI and the build agree on the mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a package mode: a project whose
metaplay-project.yamlhas nosdkRootDirreferences the Metaplay SDK as NuGet packages instead of having it in aMetaplaySDK/directory. The CLI then reads the SDK version from the project, and takes the SDK files it needs from theMetaplay.Serverpackage. No step needs .NET on the host.The rationale, the design and the plan are on the SDK side, in metaplay/sdk#8872 and its
docs/plans/2026-10-29-sdk-binary-delivery.md. That PR adds the packages, which this mode reads.Draft: it goes together with metaplay/sdk#8872.
Changes
metaplay-project.yaml:sdkRootDiris optional. Without it, the project uses package mode (MetaplayProject.UsesSdkPackages()).MetaplaySDKVersionproperty in the project root'sDirectory.Build.props.sdk/directory of theMetaplay.Serverpackage at that version (pkg/metaproj/sdk_package.go). It containsversion.yaml,Dockerfile.serverand the files the image build copies, and the web client presets. The CLI looks in two places, in order:NuGetPackages/Metaplay.Server.<version>.nupkg. The CLI unpacks onlysdk/into its cache (<user cache>/metaplay/sdk-packages/), and unpacks again when the package file's size or modification time changes.$NUGET_PACKAGESor~/.nuget/packages), once NuGet's.nupkg.metadatamarker shows it has finished extracting the package.ResolveSdkDir()returns that directory, orsdkRootDirfor a project with one.SdkMetadata(),build imageanddeploy webclientuse it, so a failure to find the SDK is reported as an error.build imagein package mode passes the package'sDockerfile.serverwith-f, and itssdk/directory with--build-context sdk=<dir>, which replaces the Dockerfile'ssdkstage. Projects withsdkRootDirbuild as before.MetaplaySDK/Backend/Metaplay.SourceReferences.targets, package mode fails. That file comes only with the SDK's sources, and a project'sDirectory.Build.targetsimports it to build against them, so the build would use those sources while the CLI and the image use the packages. The error suggests settingsdkRootDir: MetaplaySDKor removingMetaplaySDK/.update sdk,test system,test dotnet-unit,init dashboardanddev clean-dashboard-artifacts.Not in this PR:
Testing
pkg/metaproj:RequireSdkSources;sdkRootDir.go test ./...passes, andmakereports 0 lint issues.metaplay build imagewith nodotnetonPATH: built in 1 m 43 s, of which unpackingsdk/took 37 ms.metaplay test integration: passed.metaplay dev server: read the version metadata from the package and served the LiveOps Dashboard.metaplay test systemandmetaplay update sdk: refused with the new error.MetaplaySDK/Backend/Metaplay.SourceReferences.targetsadded,metaplay build imagefailed with the conflicting-SDK error. With onlyMetaplaySDK/Backend/Cloud/Metaplay.Cloud.csprojadded, it did not fail.NuGetPackages/moved aside,metaplay build imagefound the SDK files in NuGet's package cache.sdkRootDirbuilt its server image as before, in 2 m 16 s.