2 Commits
Author SHA1 Message Date
cneicy c5a0762916 fix: download release SDK directly from Microsoft Blob
Publish UPM package / publish (push) Successful in 3s
Publish NuGet packages / publish (push) Canceled after 12s
2026-11-06 19:26:41 +08:00
cneicy 80cd594ac5 feat: update Godot integration and coordinated package dependencies 2026-11-06 19:13:14 +08:00
4 changed files with 97 additions and 91 deletions

No files matched your search

+2 -1
View File
@@ -63,7 +63,8 @@ jobs:
const release = metadata.releases.find(item => item.sdk?.version === sdkVersion);
const file = release?.sdk?.files?.find(item => item.rid === 'linux-x64' && item.name.endsWith('.tar.gz'));
if (!file) throw new Error(`Linux x64 SDK archive not found for ${sdkVersion}`);
const archiveResponse = await fetch(file.url);
const archiveUrl = `https://dotnetcli.blob.core.windows.net/dotnet/Sdk/${sdkVersion}/dotnet-sdk-${sdkVersion}-linux-x64.tar.gz`;
const archiveResponse = await fetch(archiveUrl);
if (!archiveResponse.ok) throw new Error(`SDK download failed: ${archiveResponse.status}`);
await writeFile('/tmp/dotnet-sdk.tar.gz', new Uint8Array(await archiveResponse.arrayBuffer()));
+3 -3
View File
@@ -5,13 +5,13 @@
<AssemblyName>ShrinkContext.AppAdapter</AssemblyName>
<RootNamespace>ShrinkContext.AppAdapter</RootNamespace>
<PackageId>ShrinkSDK.Context.AppAdapter</PackageId>
<Version>0.2.4</Version>
<Version>0.2.5</Version>
<Description>Engine-neutral ShrinkContext composition host for ShrinkApp.</Description>
<ShrinkCodeGenEnabled>false</ShrinkCodeGenEnabled>
</PropertyGroup>
<ItemGroup>
<Compile Include="Runtime\*.cs" />
<PackageReference Include="ShrinkSDK.Context.Core" Version="0.3.0" />
<PackageReference Include="ShrinkSDK.App.Core" Version="0.2.3" />
<PackageReference Include="ShrinkSDK.Context.Core" Version="0.3.1" />
<PackageReference Include="ShrinkSDK.App.Core" Version="0.2.4" />
</ItemGroup>
</Project>
+88 -83
View File
@@ -1,6 +1,8 @@
#nullable enable
using System;
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using NUnit.Framework;
using ShrinkApp.Starter.Basic;
using ShrinkCommand.Integration.App;
@@ -10,6 +12,7 @@ using ShrinkNetwork;
using ShrinkNetwork.Integration.App;
using ShrinkApp;
using UnityEngine;
using UnityEngine.TestTools;
using Object = UnityEngine.Object;
namespace ShrinkContext.AppAdapter.Tests
@@ -21,92 +24,94 @@ namespace ShrinkContext.AppAdapter.Tests
/// </summary>
public class NativeWiringTests
{
[Test]
public void BasicComposition_UsesNativeComponents_AndRetiresDependentsReversibly()
private ShrinkAppSettings? _settings;
private ShrinkAppLoaderHost? _host;
[UnityTearDown]
public IEnumerator TearDown()
{
var settings = ScriptableObject.CreateInstance<ShrinkAppSettings>();
ShrinkAppLoaderHost? host = null;
try
if (_host?.IsRunning == true)
yield return _host.ShutdownAsync().ToCoroutine();
if (_settings != null)
Object.DestroyImmediate(_settings);
}
[UnityTest]
public IEnumerator BasicComposition_UsesNativeComponents_AndRetiresDependentsReversibly()
{
_settings = ScriptableObject.CreateInstance<ShrinkAppSettings>();
var coreInstallers = new List<IShrinkAppModuleInstaller>();
foreach (var installerType in ShrinkAppInstallers.GetDiscoveredInstallerTypes())
{
var coreInstallers = new List<IShrinkAppModuleInstaller>();
foreach (var installerType in ShrinkAppInstallers.GetDiscoveredInstallerTypes())
{
if (Activator.CreateInstance(installerType) is not IShrinkAppModuleInstaller installer)
continue;
if (installer.ModuleId is "shrink.network" or "shrink.command" or "shrink.datasaver")
coreInstallers.Add(installer);
}
host = new ShrinkAppLoaderHost(settings, coreInstallers);
ShrinkAppBasicContextComposition.Configure(host);
host.ApplyComposition(ShrinkAppBasicContextComposition.CreateDefaultDocument());
TestAwait.Run(host.StartAsync());
Assert.AreEqual(7, host.ModuleIds.Count);
Assert.AreEqual(7, host.ActiveModuleIds.Count);
Assert.IsTrue(host.IsModuleActive("shrink.network"));
Assert.IsTrue(host.IsModuleActive("shrink.command"));
Assert.IsTrue(host.IsModuleActive("shrink.datasaver"));
Assert.IsTrue(host.IsModuleActive("shrink.integration.command-network"));
Assert.IsTrue(host.IsModuleActive("shrink.integration.command-eventbus"));
Assert.IsTrue(host.IsModuleActive("shrink.integration.datasaver-eventbus"));
Assert.IsTrue(host.IsModuleActive("shrink.integration.network-eventbus"));
var root = host.Context.RootContext;
Assert.IsTrue(host.Context.TryGetRaw<ShrinkNetworkService>(root,
ShrinkNetworkAppComponent.ServiceKey, out _), "网络服务键由原生组件提供");
Assert.IsTrue(host.Context.TryGetRaw<ShrinkCommand.ShrinkCommandService>(root,
ShrinkCommandAppComponent.ServiceKey, out _), "命令服务键由原生组件提供");
Assert.IsTrue(host.Context.TryGetRaw<object>(root,
ShrinkDataSaverAppComponent.ServiceKey, out _), "存档服务键由原生组件提供");
Assert.IsTrue(host.Context.TryGetRaw<object>(root,
"shrink.integration.command-network", out _));
Assert.IsTrue(host.Context.TryGetRaw<object>(root,
"shrink.integration.command-eventbus", out _));
Assert.IsTrue(host.Context.TryGetRaw<object>(root,
"shrink.integration.datasaver-eventbus", out _));
Assert.IsTrue(host.Context.TryGetRaw<object>(root,
"shrink.integration.network-eventbus", out _));
Assert.IsTrue(host.Services.TryGet<ShrinkNetworkAppService>(out _));
Assert.IsTrue(host.Services.TryGet<ShrinkCommandAppService>(out _));
Assert.IsTrue(host.Services.TryGet<ShrinkDataSaverService>(out _));
TestAwait.Run(host.SetModuleDisabledAsync("shrink.command", true));
Assert.IsFalse(host.IsModuleActive("shrink.command"));
Assert.IsFalse(host.IsModuleActive("shrink.integration.command-network"));
Assert.IsFalse(host.IsModuleActive("shrink.integration.command-eventbus"));
Assert.IsTrue(host.IsModuleActive("shrink.network"), "无关提供者不得重载");
Assert.IsTrue(host.IsModuleActive("shrink.datasaver"), "无关提供者不得重载");
Assert.IsTrue(host.IsModuleActive("shrink.integration.network-eventbus"));
Assert.IsTrue(host.IsModuleActive("shrink.integration.datasaver-eventbus"));
Assert.IsFalse(host.Context.TryGetRaw<object>(root,
ShrinkCommandAppComponent.ServiceKey, out _));
Assert.IsFalse(host.Context.TryGetRaw<object>(root,
"shrink.integration.command-network", out _));
Assert.IsFalse(host.Context.TryGetRaw<object>(root,
"shrink.integration.command-eventbus", out _));
Assert.IsFalse(host.Services.TryGet<ShrinkCommandAppService>(out _),
"兼容门面应随组件退役注销");
TestAwait.Run(host.SetModuleDisabledAsync("shrink.command", false));
Assert.AreEqual(7, host.ActiveModuleIds.Count);
Assert.IsTrue(host.Services.TryGet<ShrinkCommandAppService>(out _));
TestAwait.Run(host.ShutdownAsync());
Assert.AreEqual(0, host.ActiveModuleIds.Count);
Assert.IsFalse(host.Services.TryGet<ShrinkNetworkAppService>(out _));
Assert.IsFalse(host.Services.TryGet<ShrinkCommandAppService>(out _));
Assert.IsFalse(host.Services.TryGet<ShrinkDataSaverService>(out _));
}
finally
{
if (host?.IsRunning == true)
TestAwait.Run(host.ShutdownAsync());
Object.DestroyImmediate(settings);
if (Activator.CreateInstance(installerType) is not IShrinkAppModuleInstaller installer)
continue;
if (installer.ModuleId is "shrink.network" or "shrink.command" or "shrink.datasaver")
coreInstallers.Add(installer);
}
_host = new ShrinkAppLoaderHost(_settings, coreInstallers);
ShrinkAppBasicContextComposition.Configure(_host);
_host.ApplyComposition(ShrinkAppBasicContextComposition.CreateDefaultDocument());
yield return _host.StartAsync().ToCoroutine();
Assert.AreEqual(7, _host.ModuleIds.Count);
Assert.AreEqual(7, _host.ActiveModuleIds.Count);
Assert.IsTrue(_host.IsModuleActive("shrink.network"));
Assert.IsTrue(_host.IsModuleActive("shrink.command"));
Assert.IsTrue(_host.IsModuleActive("shrink.datasaver"));
Assert.IsTrue(_host.IsModuleActive("shrink.integration.command-network"));
Assert.IsTrue(_host.IsModuleActive("shrink.integration.command-eventbus"));
Assert.IsTrue(_host.IsModuleActive("shrink.integration.datasaver-eventbus"));
Assert.IsTrue(_host.IsModuleActive("shrink.integration.network-eventbus"));
var root = _host.Context.RootContext;
Assert.IsTrue(_host.Context.TryGetRaw<ShrinkNetworkService>(root,
ShrinkNetworkAppComponent.ServiceKey, out _), "网络服务键由原生组件提供");
Assert.IsTrue(_host.Context.TryGetRaw<ShrinkCommand.ShrinkCommandService>(root,
ShrinkCommandAppComponent.ServiceKey, out _), "命令服务键由原生组件提供");
Assert.IsTrue(_host.Context.TryGetRaw<object>(root,
ShrinkDataSaverAppComponent.ServiceKey, out _), "存档服务键由原生组件提供");
Assert.IsTrue(_host.Context.TryGetRaw<object>(root,
"shrink.integration.command-network", out _));
Assert.IsTrue(_host.Context.TryGetRaw<object>(root,
"shrink.integration.command-eventbus", out _));
Assert.IsTrue(_host.Context.TryGetRaw<object>(root,
"shrink.integration.datasaver-eventbus", out _));
Assert.IsTrue(_host.Context.TryGetRaw<object>(root,
"shrink.integration.network-eventbus", out _));
Assert.IsTrue(_host.Services.TryGet<ShrinkNetworkAppService>(out _));
Assert.IsTrue(_host.Services.TryGet<ShrinkCommandAppService>(out _));
Assert.IsTrue(_host.Services.TryGet<ShrinkDataSaverService>(out _));
yield return _host.SetModuleDisabledAsync("shrink.command", true).ToCoroutine();
Assert.IsFalse(_host.IsModuleActive("shrink.command"));
Assert.IsFalse(_host.IsModuleActive("shrink.integration.command-network"));
Assert.IsFalse(_host.IsModuleActive("shrink.integration.command-eventbus"));
Assert.IsTrue(_host.IsModuleActive("shrink.network"), "无关提供者不得重载");
Assert.IsTrue(_host.IsModuleActive("shrink.datasaver"), "无关提供者不得重载");
Assert.IsTrue(_host.IsModuleActive("shrink.integration.network-eventbus"));
Assert.IsTrue(_host.IsModuleActive("shrink.integration.datasaver-eventbus"));
Assert.IsFalse(_host.Context.TryGetRaw<object>(root,
ShrinkCommandAppComponent.ServiceKey, out _));
Assert.IsFalse(_host.Context.TryGetRaw<object>(root,
"shrink.integration.command-network", out _));
Assert.IsFalse(_host.Context.TryGetRaw<object>(root,
"shrink.integration.command-eventbus", out _));
Assert.IsFalse(_host.Services.TryGet<ShrinkCommandAppService>(out _),
"兼容门面应随组件退役注销");
yield return _host.SetModuleDisabledAsync("shrink.command", false).ToCoroutine();
Assert.AreEqual(7, _host.ActiveModuleIds.Count);
Assert.IsTrue(_host.Services.TryGet<ShrinkCommandAppService>(out _));
yield return _host.ShutdownAsync().ToCoroutine();
Assert.AreEqual(0, _host.ActiveModuleIds.Count);
Assert.IsFalse(_host.Services.TryGet<ShrinkNetworkAppService>(out _));
Assert.IsFalse(_host.Services.TryGet<ShrinkCommandAppService>(out _));
Assert.IsFalse(_host.Services.TryGet<ShrinkDataSaverService>(out _));
}
}
}
+4 -4
View File
@@ -1,13 +1,13 @@
{
"name": "com.cneicy.shrink-context-app-adapter",
"version": "0.2.4",
"version": "0.2.5",
"displayName": "ShrinkContext - ShrinkApp Adapter",
"description": "把现有 IShrinkAppModuleInstaller 包装为 ShrinkContext 组件:依赖缺失改为等待而非抛错,模块激活由响应式余效应驱动。",
"unity": "2022.3",
"dependencies": {
"com.cneicy.shrink-context-core": "0.3.0",
"com.cneicy.shrink-app-core": "0.2.3",
"com.cneicy.shrink-eventbus": "2.2.2",
"com.cneicy.shrink-context-core": "0.3.1",
"com.cneicy.shrink-app-core": "0.2.4",
"com.cneicy.shrink-eventbus": "2.3.1",
"com.cysharp.unitask": "2.5.10",
"com.unity.modules.jsonserialize": "1.0.0"
},