chore: initialize standalone UPM package
Publish UPM package / publish (push) Failing after 1s

This commit is contained in:
2026-08-26 02:50:31 +08:00
commit 78ccae3e07
142 changed files with 6572 additions and 0 deletions
@@ -0,0 +1,25 @@
using ShrinkModFramework;
namespace ExternalFixture
{
[ShrinkMod("external.fixture", "External Fixture", "1.0.0")]
public sealed class ExternalFixtureMod : IShrinkMod
{
public void OnConstruct(ShrinkModContext context)
{
}
public void OnRegisterContent(ShrinkModContext context)
{
context.RegisterContent("external.fixture", "version", "v1");
}
public void OnInitialize(ShrinkModContext context)
{
}
public void OnReady(ShrinkModContext context)
{
}
}
}
@@ -0,0 +1,27 @@
using System;
using ShrinkModFramework;
namespace ExternalFixture
{
[ShrinkMod("external.fixture", "External Fixture", "2.0.0")]
public sealed class ExternalFixtureMod : IShrinkMod
{
public void OnConstruct(ShrinkModContext context)
{
}
public void OnRegisterContent(ShrinkModContext context)
{
context.RegisterContent("external.fixture", "version", "v2");
}
public void OnInitialize(ShrinkModContext context)
{
throw new InvalidOperationException("fixture replacement failure");
}
public void OnReady(ShrinkModContext context)
{
}
}
}
@@ -0,0 +1,25 @@
using ShrinkModFramework;
namespace ExternalFixture
{
[ShrinkMod("external.fixture", "External Fixture", "3.0.0")]
public sealed class ExternalFixtureMod : IShrinkMod
{
public void OnConstruct(ShrinkModContext context)
{
}
public void OnRegisterContent(ShrinkModContext context)
{
context.RegisterContent("external.fixture", "version", "v3");
}
public void OnInitialize(ShrinkModContext context)
{
}
public void OnReady(ShrinkModContext context)
{
}
}
}
@@ -0,0 +1,44 @@
[CmdletBinding()]
param(
[string]$UnityProjectRoot
)
$ErrorActionPreference = 'Stop'
$packageRoot = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '../..')).Path
if (-not $UnityProjectRoot) {
$UnityProjectRoot = Join-Path $packageRoot 'Development~/UnityProject'
}
$resolvedUnityProjectRoot = (Resolve-Path -LiteralPath $UnityProjectRoot).Path
$fixtureProject = Join-Path $PSScriptRoot 'ShrinkModFixtureBuilder.csproj'
$fixtureOutputRoot = Join-Path $resolvedUnityProjectRoot 'Temp/ShrinkModFixtureBuilder'
$fixtureTargetRoot = Join-Path $packageRoot 'Tests/Fixtures'
$runtimeAssemblyPath = Join-Path $resolvedUnityProjectRoot 'Temp/Bin/Debug/ShrinkModFramework.Runtime/ShrinkModFramework.Runtime.dll'
if (-not (Test-Path -LiteralPath $runtimeAssemblyPath)) {
throw "ShrinkModFramework.Runtime.dll was not found. Compile the Unity development host first: $resolvedUnityProjectRoot"
}
foreach ($variant in 'V1', 'V2', 'V3') {
$outputDirectory = Join-Path $fixtureOutputRoot $variant
$intermediateDirectory = Join-Path $fixtureOutputRoot "obj/$variant/"
dotnet build $fixtureProject /m:1 --nologo `
-p:FixtureVariant=$variant `
-p:RuntimeAssemblyPath=$runtimeAssemblyPath `
-p:BaseIntermediateOutputPath=$intermediateDirectory `
-p:OutputPath=$outputDirectory
if ($LASTEXITCODE -ne 0) {
throw "External fixture $variant build failed with exit code $LASTEXITCODE."
}
$source = Join-Path $outputDirectory 'ExternalFixture.Mod.dll'
$targetName = switch ($variant) {
'V1' { 'ExternalFixture.Mod.V1.dll.bytes' }
'V2' { 'ExternalFixture.Mod.V2.Failing.dll.bytes' }
'V3' { 'ExternalFixture.Mod.V3.dll.bytes' }
}
Copy-Item -LiteralPath $source -Destination (Join-Path $fixtureTargetRoot $targetName) -Force
}
Write-Host 'ShrinkModFramework external fixture DLLs rebuilt.'
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<AssemblyName>ExternalFixture.Mod</AssemblyName>
<RootNamespace>ExternalFixture</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="ExternalFixture.Mod.$(FixtureVariant).cs" />
<Reference Include="ShrinkModFramework.Runtime">
<HintPath>$(RuntimeAssemblyPath)</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
</Project>