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 <noreply@anthropic.com>
This commit is contained in:
parent
20ac3b0b6c
commit
5687d8c355
4 changed files with 31 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"ConcurrentCollections.dll",
|
||||
"CultMath.dll",
|
||||
"GameCult.Caching.dll",
|
||||
"GameCult.Caching.MessagePack.dll",
|
||||
"GameCult.Logging.dll",
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue