Fix CultMath Unity plugin references

This commit is contained in:
Meta Vens 2026-07-22 05:07:32 +01:00
commit b43cf4904f
11 changed files with 27 additions and 30 deletions

View file

@ -41,11 +41,13 @@ foreach ($path in @($freshAssembly, $freshSymbols)) {
$requiredTemplateFiles = @(
"LICENSE.md",
"LICENSE.md.meta",
"README.md",
"README.md.meta",
"THIRD-PARTY-NOTICES.md",
"THIRD-PARTY-NOTICES.md.meta",
"package.json",
"Runtime\CultMath.asmdef",
"Runtime\CultMath.asmdef.meta",
"package.json.meta",
"Runtime\Plugins\CultMath.dll",
"Runtime\Plugins\CultMath.dll.meta",
"Runtime\Plugins\CultMath.pdb",
@ -72,6 +74,14 @@ if ($missingAssetMetas.Count -ne 0 -or $missingDirectoryMetas.Count -ne 0) {
}
$manifest = Get-Content -LiteralPath (Join-Path $templateRoot "package.json") -Raw | ConvertFrom-Json
$pluginMeta = Get-Content -LiteralPath ($trackedAssembly + ".meta") -Raw
if ($pluginMeta -notmatch '(?m)^\s*isExplicitlyReferenced:\s*0\s*$') {
throw "CultMath.dll must be auto-referenced; explicit-only plugins do not reach dependent Unity asmdefs"
}
$facadeDefinitions = @(Get-ChildItem -LiteralPath $templateRoot -Recurse -File -Filter "*.asmdef")
if ($facadeDefinitions.Count -ne 0) {
throw "CultMath's precompiled DLL is the Unity assembly authority; empty asmdef facades are forbidden"
}
$expectedFileVersion = "$($manifest.version).0"
$trackedFileVersion = [Diagnostics.FileVersionInfo]::GetVersionInfo($trackedAssembly).FileVersion
$freshFileVersion = [Diagnostics.FileVersionInfo]::GetVersionInfo($freshAssembly).FileVersion
@ -97,11 +107,13 @@ Copy-Item -Path (Join-Path $templateRoot "*") -Destination $outputRoot -Recurse
$stagedAssemblies = @(Get-ChildItem -LiteralPath (Join-Path $outputRoot "Runtime\Plugins") -Filter "*.dll")
$stagedSources = @(Get-ChildItem -LiteralPath $outputRoot -Recurse -File -Filter "*.cs")
if ($stagedAssemblies.Count -ne 1 -or $stagedAssemblies[0].Name -ne "CultMath.dll" -or $stagedSources.Count -ne 0) {
throw "CultMath package must contain one owned DLL and no C# source files"
$stagedFacades = @(Get-ChildItem -LiteralPath $outputRoot -Recurse -File -Filter "*.asmdef")
if ($stagedAssemblies.Count -ne 1 -or $stagedAssemblies[0].Name -ne "CultMath.dll" -or $stagedSources.Count -ne 0 -or $stagedFacades.Count -ne 0) {
throw "CultMath package must contain one owned auto-referenced DLL, no C# source files, and no asmdef facade"
}
Write-Host "CultMath Unity package: $outputRoot"
Write-Host "Package: $($manifest.name)@$($manifest.version)"
Write-Host "Managed assemblies: $($stagedAssemblies.Count)"
Write-Host "C# source files: $($stagedSources.Count)"
Write-Host "Asmdef facades: $($stagedFacades.Count)"

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7172bce28532878409e57f5fbbb12719

View file

@ -6,8 +6,8 @@ precompiled `CultMath.dll`, portable symbols, and the numeric
Unity does not compile CultMath's repository source tree. That source uses the
current C# language and remains owned by the normal .NET project. The package
facade references only the tracked precompiled assembly, so consumers do not
need `csc.rsp` language overrides.
imports only the tracked auto-referenced precompiled assembly, so consumers do
not need `csc.rsp` language overrides or an asmdef propagation shim.
Build and inspect the package from the repository root:

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b7429934026d747489a3876fd15576e5

View file

@ -1,16 +0,0 @@
{
"name": "CultMath",
"rootNamespace": "CultMath",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": true,
"precompiledReferences": [
"CultMath.dll"
],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": true
}

View file

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 4b5c49d478124399a5310d7a9d8ed166
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -8,7 +8,7 @@ PluginImporter:
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0c88669e4d1db604588be2a726b7d231

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 33d8d4af49bf0f946ad00a375f26b1d1