Skip to content

feat(audience): Json — IL2CPP-safe manual JSON serialiser (SDK-128)#687

Merged
nattb8 merged 3 commits into
mainfrom
feat/sdk-128-json-serialiser
Apr 16, 2026
Merged

feat(audience): Json — IL2CPP-safe manual JSON serialiser (SDK-128)#687
nattb8 merged 3 commits into
mainfrom
feat/sdk-128-json-serialiser

Conversation

@nattb8
Copy link
Copy Markdown
Collaborator

@nattb8 nattb8 commented Apr 15, 2026

Summary

  • Adds Json.cs — IL2CPP-safe manual JSON serialiser with no reflection, handling all SDK-required types with correct string escaping
  • Adds dotnet test harness (Audience.Runtime.csproj + Audience.Tests.csproj) and AssemblyInfo.cs (InternalsVisibleTo) so internal types are accessible from the test assembly in both Unity and dotnet
  • Adds test-audience-sdk.yml GitHub Actions workflow — triggers on PRs touching src/Packages/Audience/**, no Unity license needed (pure C# modules)

Why manual JSON, not a library: JsonUtility can't handle Dictionary<string, object>; Json.NET adds ~500KB and needs AOT config for IL2CPP; System.Text.Json isn't bundled in Unity 2021's Mono runtime. The serialiser is ~80 lines with full test coverage and zero IL2CPP risk.

Linear: SDK-128

🤖 Generated with Claude Code

@nattb8 nattb8 requested review from a team as code owners April 15, 2026 00:18
@nattb8 nattb8 force-pushed the feat/sdk-128-json-serialiser branch 3 times, most recently from aeabfe5 to ba77249 Compare April 15, 2026 03:36
…K-128)

- Audience.Runtime.csproj + Audience.Tests.csproj: dotnet test harness for
  pure-C# modules (no Unity license needed in CI)
- AssemblyInfo.cs: InternalsVisibleTo for test assembly, fixes internal
  visibility for both Unity test runner and dotnet
- test-audience-sdk.yml: workflow triggers on PRs/pushes touching
  src/Packages/Audience/**
- Fix Identity.Reset() to swallow DirectoryNotFoundException (not just
  FileNotFoundException) when consent=None left no directory on disk
@nattb8 nattb8 force-pushed the feat/sdk-128-json-serialiser branch from ba77249 to 726126e Compare April 15, 2026 03:41
@nattb8 nattb8 merged commit 7f7f531 into main Apr 16, 2026
18 checks passed
@nattb8 nattb8 deleted the feat/sdk-128-json-serialiser branch April 16, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants