-
Notifications
You must be signed in to change notification settings - Fork 7
Contributing
How to build NKit from source, run the tests, and submit changes.
Note: This documentation is a first draft and will be improved over time.
The source is at github.com/Nanook/NKit.
Bug reports and feature requests: open a GitHub Issue.
Code contributions: open a Pull Request against the main branch.
| Tool | Version | Notes |
|---|---|---|
| .NET SDK | 10.0+ | dot.net/download |
| Visual Studio 2022+ or Rider | — | Or any editor that supports .slnx
|
| Docker (optional) | — | Required for legacy Linux builds only |
dotnet build NKit.slnxNote:
NKit.UIandNKDS.UImay show Avalonia NuGet warnings — this is a pre-existing issue that does not affect the core libraries or CLI apps.
Release builds produce native single-file executables. Use the build scripts:
Windows:
.\build\build.ps1 -Runtime win-x64 -Version 3.0.0 -Apps "console,nkds"Linux (via WSL + Docker):
wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/path/to/NKit && VERSION=3.0.0 ./build/wsl-docker-build.sh"Output lands in build-output/. See Architecture for the full build documentation.
Runs ~14,900 unit tests. Excludes the heavy end-to-end suites that need real disc images.
Windows:
$exe = "NKit.Tests/bin/Debug/net10.0/NKit.Tests.exe"
dotnet build NKit.Tests/NKit.Tests.csproj -f net10.0 -c Debug --nologo
& $exe -notrait "Area=Full" -notrait "Speed=Slow"Linux (via Docker — same container as builds):
wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/path/to/NKit && bash build/test.sh"Requires real disc image fixtures in ../WipedImages and ../NKitExternalTestFiles.
bash build/test.sh --full# Windows — run one class
$exe = "NKit.Tests/bin/Debug/net10.0/NKit.Tests.exe"
& $exe -method "*CliParserTests*"# Linux
bash build/test.sh --trait "Group=ImageReading"| Project | Scope |
|---|---|
NKit.Tests |
CLI parser, configuration, engine unit tests, DataStore tests |
NKitDataStore.Tests |
DataStore storage, compaction, crash recovery, VFS |
NKDS.Tests |
NKDS operations, dat verification |
NKitCore.Tests |
Pipeline section engine |
NKitStream.Tests |
BufferStream, file scanning |
- No reflection in any format I/O or processing path — all code must be AOT-safe
-
Explicit endianness — use
ReadUInt32B/Lhelpers, never rawBitConverter - Forward-reading streams — format readers must not seek backwards in sources
-
#nullable disablein test projects;enablein library code - Match surrounding style; avoid reformatting unrelated code in a PR
- Keep PRs focused — one logical change per PR
- Add tests for new behaviour; regression tests for bug fixes
- Run the fast unit-test gate before submitting — PRs with failing tests won't be merged
- Describe what the change does and why in the PR description
- Reference the relevant GitHub Issue if applicable
NKit/ ← Core processing engine (disc images)
NKitDataStore/ ← Block storage engine (shards, index, compaction)
NKitCore/ ← Generic async section pipeline (StreamBlockCore)
NKitStream/ ← BufferStream and streaming primitives
NKDS/ ← DataStore product (sets, VFS, session management)
Shared/ ← Shared CLI utilities (SpectrePrompter)
NKitApp/ ← nkit CLI
NKDSApp/ ← nkds CLI
NKit.UI/ ← nkit-ui (Avalonia GUI)
NKDS.UI/ ← nkds-ui (Avalonia GUI)
NKit.SampleProcessingApp/ ← Embedding example
Tmds.Fuse/ ← FUSE mount support (Linux)
build/ ← Build scripts
See Architecture for how the libraries fit together.
- Architecture — design principles and library structure
- Developer Guide — embedding NKit/NKDS in your own project