Repository navigation
Build in the ksp-ci container, with SDK-style projects - #197
Merged
Merged
Conversation
Contributor
Build ArtifactModuleManager-90f61c2.zip (built from a667088) |
The four csprojs were legacy (non-SDK) projects with packages.config, which the .NET SDK can not restore. As SDK-style net471 projects, dotnet restore fetches their packages, and Directory.Build.targets adds the net471 reference assemblies package (Microsoft.NETFramework.ReferenceAssemblies.net471), as in MechJeb2, so they build with the .NET SDK on any OS. Kept as before: the sources (the SDK picks up the same files the Compile lists had), LangVersion 8.0, the hand-written AssemblyInfo.cs (GenerateAssemblyInfo false), bin/<Configuration>/ output paths, DebugType, and the bare KSP references, which Directory.Build.targets resolves through ReferencePath (from .csproj.user locally, from the command line in CI). The post-build copy into KSP (copy_build.sh) is now a target, turned off with -p:CopyBuild=false. CopyLocalFalse is gone: its targets were never imported, so it did nothing. The built ModuleManager.dll has the same assembly references, resources, types and methods as the v4.3.0 release's.
The build job runs in ghcr.io/sarbian/ksp-ci (pinned by digest), which has Mono and the .NET SDK 10.0, instead of installing Mono from the mono-project repository on every run. That repository only had focal packages, which kept the job pinned to ubuntu-24.04. With SDK-style projects, the build is dotnet restore and dotnet msbuild, as in MechJeb2: the only download left is KSPLibs.
sarbian
force-pushed
the
ci/ksp-ci-image
branch
from
November 29, 2026 11:25
a944c4f to
a667088
Compare
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.
The build job now runs in the
ghcr.io/sarbian/ksp-cicontainer (from sarbian/KSP_CI), which has Mono and the .NET SDK 10.0, instead of installing Mono from the mono-project repository on every run. That repository only had focal packages, which kept the job pinned toubuntu-24.04; it is back onubuntu-latest.To build with the SDK the way MechJeb2 does, the four projects are converted to SDK style.
Projects
ModuleManager,TestUtils,ModuleManagerTestsandTestUtilsTestsare SDK-stylenet471projects. Thepackages.configfiles are replaced byPackageReference, at the same versions.Directory.Build.targets(modelled on MechJeb2's) addsMicrosoft.NETFramework.ReferenceAssemblies.net471, so the projects build with the .NET SDK on any OS, and makesReferencePathan assembly search path for the bare KSP/Unity references. LocallyReferencePathstill comes from each.csproj.user.Compilelists had),LangVersion8.0, the hand-writtenAssemblyInfo.cs(GenerateAssemblyInfofalse, socreate-release.yml's version stamping is unchanged),bin/<Configuration>/output paths andDebugType.copy_build.sh) is now aCopyBuildtarget, turned off with-p:CopyBuild=false(CI used to pass-p:PostBuildEvent=).CopyLocalFalseis gone: its targets were never imported, so it did nothing.Workflow
build.ymlisdotnet restoreanddotnet msbuildin the container, as in MechJeb2. The only download left is KSPLibs.For review
ModuleManager.dllhas the same assembly references, embedded resource, types (130), methods (606) and assembly attributes as the v4.3.0 release DLL. It is 512 bytes larger: a deterministic-build debug directory entry and the newer compiler's code layout.