-
Notifications
You must be signed in to change notification settings - Fork 0
building
How to build, test, pack, and publish every component of the repository.
-
.NET SDK 8.0 or later (the solution targets
net8.0,net9.0, andnet10.0; the SDK'srollForwardis set tolatestMajorwith prereleases allowed). - Works on Windows, Linux, and macOS.
- No native toolchains are required — the library is 100% managed.
CSharp_CHDSharp.sln
├── CHDSharpLib/ The library (NuGet package: CHDSharp)
├── CHDSharpCli/ Command-line verification + CHD creation tool
├── CHDSharpEncoder/ Companion encoder library (V5 CHD creation; see [Encoder](encoder.md))
├── CHDSharpTest/ xUnit unit + corpus tests
├── CHDSharpTestGen/ Deterministic corpus generator
├── CHDSharpTester/ WPF interactive tester
├── References/ libchdr-0.3.0 (C) + mame-mame0288 sources + format notes
└── Directory.Build.props Centralized versioning (1.3.0) and analyzer setup
# Everything (Debug)
dotnet build
# Release
dotnet build -c Release
# A single project
dotnet build CHDSharpLib/CHDSharpLib.csproj -c ReleaseDirectory.Build.props defines a single <Version> (currently 1.3.0) that all projects inherit, so AssemblyVersion, FileVersion, and the NuGet package version stay in sync automatically.
All projects enable:
-
Nullable+ImplicitUsings. -
LangVersion 14. -
Meziantou.Analyzer (build-time analyzer,
PrivateAssets=all). -
CHDSharpLibadditionally treats missing XML documentation (CS1591) as an error, so all public API members must carry XML doc comments.
# Run the full suite (all target frameworks)
dotnet test
# A single framework
dotnet test -f net10.0
# A specific test class
dotnet test --filter "FullyQualifiedName~CorpusTests"
# Verbose console output
dotnet test -v detailedThe suite contains 468 tests (unit + corpus) that run against 30 deterministic CHD fixtures covering V1–V5 and every codec. See Testing.
The companion encoder suite (CHDSharpEncoderTest, 258 tests) validates CHD creation against chdman.exe — including 100 MB+ raw/CD round-trips:
dotnet test CHDSharpEncoderTest/ --filter "FullyQualifiedName~LargeFileValidationTests"Regenerating the corpus requires the vintage
chdman/hdcompbinaries inCHDSharpTest/chdman/:dotnet run --project CHDSharpTestGenThe generator is deterministic: regenerating produces byte-identical fixtures.
dotnet pack CHDSharpLib/CHDSharpLib.csproj -c ReleaseThe package (CHDSharp.<version>.nupkg) is written to CHDSharpLib/bin/Release/. It includes:
- The library DLL for
net8.0,net9.0, andnet10.0. - The README (this wiki's sibling pages are referenced from it), the MIT license, and the package icon.
- Embedded PDBs (
DebugType=embedded) and embedded SourceLink for debugging. - Deterministic, reproducible builds (
Deterministic=true,ContinuousIntegrationBuildon GitHub Actions).
| Package | Version | Purpose |
|---|---|---|
| ZstdSharp.Port | 0.8.8 | Pure C# Zstd decompression |
| Microsoft.Extensions.Logging.Abstractions | 10.0.11 (all TFMs) | Pluggable logging (optional) |
| Microsoft.SourceLink.GitHub | 10.0.400 | SourceLink (build-time, PrivateAssets=all) |
CHDSharpLib also declares InternalsVisibleTo for CHDSharpTest and CHDSharpTestGen so the test projects can exercise internal members directly.
# Framework-dependent
dotnet publish CHDSharpCli/CHDSharpCli.csproj -c Release -r win-x64 --self-contained false
# Self-contained single-file
dotnet publish CHDSharpCli/CHDSharpCli.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=trueThe repository ships ready-made zip bundles under CHDSharpLib/bin/Release/ (e.g. CHDSharpCli_win-x64_v1.2.0.zip).
The repository is set up for GitHub Actions (ContinuousIntegrationBuild=true), producing deterministic builds and SourceLink-enabled symbols. The test suite is the gatekeeper: all 468 tests must pass on all three target frameworks before a release.
CHDSharp
Format & internals
API & usage
Operations
Writing CHDs
Reference