1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00

Added a C# binding, packaged as NibblePoker.BakaShrot.Client on NuGet

- bindings/csharp/NibblePoker.BakaShrot.Client: P/Invoke over the DLL's
  UTF-16 exports, one Client per handle (namespace NibblePoker.BakaShrot).
  C# 2 and the .NET 2.0 BCL only: net35 (.NET Framework 2.0 and up) and
  netstandard2.0 (.NET Core 2.0 and up, .NET 5 and up)
- No JSON or TOML parsing: ListTopics, ListNodes and Query return the raw
  JSON string for the caller to parse; settings go to the constructor
- The package: the four native libraries under runtimes/<rid>/native/,
  their THIRD-PARTY.txt under licenses/<rid>/, and a build/net35 .targets
  copying the right one next to .NET Framework apps (which ignore
  runtimes/)
- CI: a nuget job after the four release builds packs it with the
  release's version and libraries, checks the listing and keeps it as
  the bakashrot-nuget artifact
- Tests: an NUnit project (net48 and net8.0) against a real server with
  certificates from `bakashrot cert`, 13 tests
- release.py ships BakaShrot.cs in csharp/; docs/client.md, building.md,
  readme.md, revamp.md (step 14) updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 16:50:05 +01:00
parent d061ff6f80
commit 1a1603f3f3
13 changed files with 1075 additions and 5 deletions
+6 -1
View File
@@ -11,6 +11,7 @@ Into target/dist/:
purebasic/*.pbi its PureBasic prototypes
python/bakashrot.py the Python client, over it
python/bakashrot-<version>-*.whl the same with the library in it
csharp/BakaShrot.cs the C# client, over it
server.example.toml, client.example.toml the configs, documented
docs/ docs/
README.txt what's where, how to start
@@ -208,7 +209,9 @@ docs/client.md), --help on each command:
The client library ({LIBRARY}): the BakaShrot_* exports, include/bakashrot.h
for C, purebasic/ for PureBasic, python/bakashrot.py for Python (no
dependencies; it looks for the library next to itself or in BAKASHROT_DLL).
dependencies; it looks for the library next to itself or in BAKASHROT_DLL),
csharp/BakaShrot.cs for C# (.NET Framework 2.0 and up, .NET Core and .NET;
the library next to the app, which runs 64-bit).
Or: pip install python/bakashrot-*.whl, the library inside.
Compatibility: protocol 7. Servers and clients must come from the same
@@ -242,6 +245,8 @@ def package(built, version, name, out, hybrid):
shutil.copytree(os.path.join(bindings, "purebasic"), os.path.join(out, "purebasic"))
os.makedirs(os.path.join(out, "python"))
shutil.copy2(os.path.join(bindings, "python", "bakashrot.py"), os.path.join(out, "python"))
os.makedirs(os.path.join(out, "csharp"))
shutil.copy2(os.path.join(bindings, "csharp", "NibblePoker.BakaShrot.Client", "BakaShrot.cs"), os.path.join(out, "csharp"))
shutil.copytree(os.path.join(HERE, "docs"), os.path.join(out, "docs"))
shutil.copy2(os.path.join(HERE, "crates", "bakashrot-config", "example.toml"),
os.path.join(out, "server.example.toml"))