diff --git a/scripts/build-unity-package.ps1 b/scripts/build-unity-package.ps1 index 329cedb..f5fcacc 100644 --- a/scripts/build-unity-package.ps1 +++ b/scripts/build-unity-package.ps1 @@ -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)" diff --git a/unity/org.gamecult.cultmath/LICENSE.md.meta b/unity/org.gamecult.cultmath/LICENSE.md.meta new file mode 100644 index 0000000..c234cd2 --- /dev/null +++ b/unity/org.gamecult.cultmath/LICENSE.md.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7172bce28532878409e57f5fbbb12719 \ No newline at end of file diff --git a/unity/org.gamecult.cultmath/README.md b/unity/org.gamecult.cultmath/README.md index 1802ae9..223e16c 100644 --- a/unity/org.gamecult.cultmath/README.md +++ b/unity/org.gamecult.cultmath/README.md @@ -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: diff --git a/unity/org.gamecult.cultmath/README.md.meta b/unity/org.gamecult.cultmath/README.md.meta new file mode 100644 index 0000000..0ea270c --- /dev/null +++ b/unity/org.gamecult.cultmath/README.md.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b7429934026d747489a3876fd15576e5 \ No newline at end of file diff --git a/unity/org.gamecult.cultmath/Runtime/CultMath.asmdef b/unity/org.gamecult.cultmath/Runtime/CultMath.asmdef deleted file mode 100644 index 72c968e..0000000 --- a/unity/org.gamecult.cultmath/Runtime/CultMath.asmdef +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "CultMath", - "rootNamespace": "CultMath", - "references": [], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": true, - "overrideReferences": true, - "precompiledReferences": [ - "CultMath.dll" - ], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": true -} diff --git a/unity/org.gamecult.cultmath/Runtime/CultMath.asmdef.meta b/unity/org.gamecult.cultmath/Runtime/CultMath.asmdef.meta deleted file mode 100644 index 0ec09c2..0000000 --- a/unity/org.gamecult.cultmath/Runtime/CultMath.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 4b5c49d478124399a5310d7a9d8ed166 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll b/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll index 8cdb670..91b51d8 100644 Binary files a/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll and b/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll differ diff --git a/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll.meta b/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll.meta index d9935b3..917e384 100644 --- a/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll.meta +++ b/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll.meta @@ -8,7 +8,7 @@ PluginImporter: defineConstraints: [] isPreloaded: 0 isOverridable: 0 - isExplicitlyReferenced: 1 + isExplicitlyReferenced: 0 validateReferences: 1 platformData: - first: diff --git a/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.pdb b/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.pdb index ed00f36..711cf76 100644 Binary files a/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.pdb and b/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.pdb differ diff --git a/unity/org.gamecult.cultmath/THIRD-PARTY-NOTICES.md.meta b/unity/org.gamecult.cultmath/THIRD-PARTY-NOTICES.md.meta new file mode 100644 index 0000000..a53f08d --- /dev/null +++ b/unity/org.gamecult.cultmath/THIRD-PARTY-NOTICES.md.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0c88669e4d1db604588be2a726b7d231 \ No newline at end of file diff --git a/unity/org.gamecult.cultmath/package.json.meta b/unity/org.gamecult.cultmath/package.json.meta new file mode 100644 index 0000000..337ba71 --- /dev/null +++ b/unity/org.gamecult.cultmath/package.json.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 33d8d4af49bf0f946ad00a375f26b1d1 \ No newline at end of file