From 5687d8c3558495ac285126e7af90204c859fddae Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 16:52:44 +0200 Subject: [PATCH] Make the CultLib Unity package depend on org.gamecult.cultmath GameCult.Caching.MessagePack now references CultMath, so the Unity package declares org.gamecult.cultmath in package.json, references CultMath.dll from the asmdef, and the package build refuses to ship a second CultMath.dll and checks the asmdef against the shipped plus external assembly lists. Co-Authored-By: Claude Sonnet 5 --- scripts/build-unity-package.ps1 | 18 ++++++++++++++++++ unity/org.gamecult.cultlib/README.md | 9 +++++++++ .../Runtime/GameCult.CultLib.asmdef | 1 + unity/org.gamecult.cultlib/package.json | 3 +++ 4 files changed, 31 insertions(+) diff --git a/scripts/build-unity-package.ps1 b/scripts/build-unity-package.ps1 index bdd9fff6..3258155f 100644 --- a/scripts/build-unity-package.ps1 +++ b/scripts/build-unity-package.ps1 @@ -128,6 +128,19 @@ $expectedAssemblies = @( "System.Text.Json.dll", "System.Threading.Channels.dll" ) +# Assemblies the package references but never ships: org.gamecult.cultmath owns CultMath.dll, and the +# package.json dependency delivers it. A second copy in Runtime\Plugins would be a duplicate assembly. +$externalAssemblies = @("CultMath.dll") +$asmdef = Get-Content -LiteralPath (Join-Path $templateRoot "Runtime\GameCult.CultLib.asmdef") -Raw | ConvertFrom-Json +$referencedAssemblies = @($asmdef.precompiledReferences | Sort-Object) +$declaredAssemblies = @($expectedAssemblies + $externalAssemblies | Sort-Object) +if (($referencedAssemblies -join "|") -ne ($declaredAssemblies -join "|")) { + throw "GameCult.CultLib.asmdef precompiledReferences differ from the shipped plus external assembly lists." +} +$cultMathDependency = (Get-Content -LiteralPath (Join-Path $templateRoot "package.json") -Raw | ConvertFrom-Json).dependencies.'org.gamecult.cultmath' +if ([string]::IsNullOrWhiteSpace($cultMathDependency)) { + throw "package.json must declare org.gamecult.cultmath, which supplies CultMath.dll." +} $publishedByName = @{} foreach ($assembly in Get-ChildItem -LiteralPath $publishRoot -Filter "*.dll") { $publishedByName[$assembly.Name] = $assembly @@ -154,6 +167,11 @@ foreach ($assemblyName in $expectedAssemblies) { Copy-Item -LiteralPath $pdb -Destination $pluginRoot } } +foreach ($external in $externalAssemblies) { + if (Test-Path -LiteralPath (Join-Path $pluginRoot $external)) { + throw "CultLib Unity package must not ship $external; org.gamecult.cultmath owns it." + } +} $nativePluginRoot = Join-Path $pluginRoot "x86_64" New-Item -ItemType Directory -Force -Path $nativePluginRoot | Out-Null Copy-Item -LiteralPath (Join-Path $quicNativeRoot "gamecult_mesh_quic_native.dll") -Destination $nativePluginRoot diff --git a/unity/org.gamecult.cultlib/README.md b/unity/org.gamecult.cultlib/README.md index 88a083e1..8716d7e4 100644 --- a/unity/org.gamecult.cultlib/README.md +++ b/unity/org.gamecult.cultlib/README.md @@ -17,6 +17,15 @@ Install version `1.0.57` through Unity Package Manager with: https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.57 ``` +The package depends on `org.gamecult.cultmath` (0.3.0 or later) and does not +carry its own `CultMath.dll`. Unity Package Manager resolves git packages only +from the project manifest, so add CultMath beside CultLib in +`Packages/manifest.json`: + +```text +"org.gamecult.cultmath": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.3.0" +``` + CultMesh chooses mapped memory for reachable same-machine bodies and advertised QUIC for remote realtime state. Applications register the packaged `CultMeshNativeQuicRealtimeTransportConnector`; they do not load or configure diff --git a/unity/org.gamecult.cultlib/Runtime/GameCult.CultLib.asmdef b/unity/org.gamecult.cultlib/Runtime/GameCult.CultLib.asmdef index bd13cb38..0ddbb9a6 100644 --- a/unity/org.gamecult.cultlib/Runtime/GameCult.CultLib.asmdef +++ b/unity/org.gamecult.cultlib/Runtime/GameCult.CultLib.asmdef @@ -8,6 +8,7 @@ "overrideReferences": true, "precompiledReferences": [ "ConcurrentCollections.dll", + "CultMath.dll", "GameCult.Caching.dll", "GameCult.Caching.MessagePack.dll", "GameCult.Logging.dll", diff --git a/unity/org.gamecult.cultlib/package.json b/unity/org.gamecult.cultlib/package.json index 722190cf..6545bed1 100644 --- a/unity/org.gamecult.cultlib/package.json +++ b/unity/org.gamecult.cultlib/package.json @@ -3,6 +3,9 @@ "displayName": "CultLib", "version": "1.0.60", "unity": "2021.3", + "dependencies": { + "org.gamecult.cultmath": "0.3.0" + }, "description": "CultCache, CultNet, and CultMesh managed runtime assemblies for Unity.", "license": "MIT", "author": {