Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ccb2ad59c1
|
||
|
|
c522594520
|
No files matched your search
@@ -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()));
|
||||
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
本文件记录 `ShrinkDataSaver.Integration.App` 的包内变更。
|
||||
|
||||
## [0.3.0] - 2026-11-06
|
||||
|
||||
### Added
|
||||
|
||||
- 新增 `ShrinkDataSaverAppModuleConfig`,可同时传入 `ShrinkAppServices` 和自定义 `ShrinkDataSaverRuntimeConfig`。
|
||||
- `ShrinkDataSaverAppComponent` 新增接收运行时配置的构造函数。
|
||||
|
||||
### Changed
|
||||
|
||||
- App 停止时等待 `ShrinkSettings.SaveAsync()` 完成,并把写入失败传播到停用链,不再 fire-and-forget。
|
||||
- 精确依赖 `ShrinkDataSaver 2.5.0`、`ShrinkSDK.Runtime.Abstractions 0.2.0`。
|
||||
|
||||
## [0.1.3] - 2026-08-28
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
<AssemblyName>ShrinkDataSaver.Integration.App</AssemblyName>
|
||||
<RootNamespace>ShrinkDataSaver.Integration.App</RootNamespace>
|
||||
<PackageId>ShrinkSDK.DataSaver.Integration.App</PackageId>
|
||||
<Version>0.2.5</Version>
|
||||
<Version>0.3.1</Version>
|
||||
<Description>ShrinkDataSaver and App host integration.</Description>
|
||||
<ShrinkCodeGenEnabled>true</ShrinkCodeGenEnabled>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Runtime\*.cs" />
|
||||
<PackageReference Include="ShrinkSDK.Runtime.Abstractions" Version="0.1.0" />
|
||||
<PackageReference Include="ShrinkSDK.Context.Core" Version="0.3.0" />
|
||||
<PackageReference Include="ShrinkSDK.App.Core" Version="0.2.3" />
|
||||
<PackageReference Include="ShrinkSDK.DataSaver" Version="2.4.0" />
|
||||
<PackageReference Include="ShrinkSDK.Runtime.Abstractions" Version="0.2.0" />
|
||||
<PackageReference Include="ShrinkSDK.Context.Core" Version="0.3.1" />
|
||||
<PackageReference Include="ShrinkSDK.App.Core" Version="0.2.4" />
|
||||
<PackageReference Include="ShrinkSDK.DataSaver" Version="2.5.0" />
|
||||
<PackageReference Include="ShrinkSDK.CodeGen" Version="0.2.0" PrivateAssets="compile;runtime;contentfiles;native" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -21,6 +21,16 @@ namespace ShrinkDataSaver.Integration.App
|
||||
public const string ModuleKey = "app.module.shrink.datasaver";
|
||||
|
||||
private static readonly string[] ProvideKeys = { ModuleKey, ServiceKey };
|
||||
private readonly ShrinkDataSaverRuntimeConfig? _runtimeConfig;
|
||||
|
||||
public ShrinkDataSaverAppComponent()
|
||||
{
|
||||
}
|
||||
|
||||
public ShrinkDataSaverAppComponent(ShrinkDataSaverRuntimeConfig? runtimeConfig)
|
||||
{
|
||||
_runtimeConfig = runtimeConfig;
|
||||
}
|
||||
|
||||
public string Name => "shrink.datasaver";
|
||||
|
||||
@@ -28,22 +38,27 @@ namespace ShrinkDataSaver.Integration.App
|
||||
|
||||
public IReadOnlyList<string> Provide => ProvideKeys;
|
||||
|
||||
public async UniTask ApplyAsync(ShrinkCtx ctx, object? config)
|
||||
public UniTask ApplyAsync(ShrinkCtx ctx, object? config)
|
||||
{
|
||||
// 编辑器/EditMode 环境下 DontDestroyOnLoad 会抛异常,驱动只在播放模式常驻
|
||||
ShrinkDataSaverRuntime.Initialize(new ShrinkDataSaverRuntimeConfig
|
||||
ShrinkAppServices? appServices = null;
|
||||
var runtimeConfig = _runtimeConfig ?? CreateDefaultRuntimeConfig();
|
||||
if (config is ShrinkDataSaverAppModuleConfig moduleConfig)
|
||||
{
|
||||
#if UNITY_5_3_OR_NEWER
|
||||
DontDestroyOnLoadDriver = UnityEngine.Application.isPlaying
|
||||
#else
|
||||
DontDestroyOnLoadDriver = false
|
||||
#endif
|
||||
});
|
||||
appServices = moduleConfig.Services;
|
||||
if (moduleConfig.RuntimeConfig != null)
|
||||
runtimeConfig = moduleConfig.RuntimeConfig;
|
||||
}
|
||||
else if (config is ShrinkAppServices services)
|
||||
{
|
||||
appServices = services;
|
||||
}
|
||||
|
||||
ShrinkDataSaverRuntime.Initialize(runtimeConfig);
|
||||
var facade = new ShrinkDataSaverService();
|
||||
ctx.Set(ServiceKey, facade, new ShrinkDataSaverAccessPolicy(facade));
|
||||
ctx.Set(ModuleKey, Name);
|
||||
|
||||
if (config is ShrinkAppServices appServices)
|
||||
if (appServices != null)
|
||||
{
|
||||
appServices.Register(facade);
|
||||
ctx.EffectInverse(() =>
|
||||
@@ -53,17 +68,24 @@ namespace ShrinkDataSaver.Integration.App
|
||||
});
|
||||
}
|
||||
|
||||
await ctx.EffectAsync(async () =>
|
||||
ctx.EffectInverse(async () =>
|
||||
{
|
||||
await UniTask.CompletedTask;
|
||||
return () =>
|
||||
{
|
||||
// 终止动作(触发式):停用时把防抖中的设置写盘。
|
||||
// 磁盘 IO 在线程池完成,不阻塞停用链;未初始化环境安全跳过(SaveAsync 守卫)。
|
||||
ShrinkSettings.SaveAsync().Forget();
|
||||
return UniTask.CompletedTask;
|
||||
};
|
||||
await ShrinkSettings.SaveAsync();
|
||||
});
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
private static ShrinkDataSaverRuntimeConfig CreateDefaultRuntimeConfig()
|
||||
{
|
||||
// 编辑器/EditMode 环境下 DontDestroyOnLoad 会抛异常,驱动只在播放模式常驻
|
||||
return new ShrinkDataSaverRuntimeConfig
|
||||
{
|
||||
#if UNITY_5_3_OR_NEWER
|
||||
DontDestroyOnLoadDriver = UnityEngine.Application.isPlaying
|
||||
#else
|
||||
DontDestroyOnLoadDriver = false
|
||||
#endif
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#nullable enable
|
||||
|
||||
using ShrinkApp;
|
||||
|
||||
namespace ShrinkDataSaver.Integration.App
|
||||
{
|
||||
public sealed class ShrinkDataSaverAppModuleConfig
|
||||
{
|
||||
public ShrinkDataSaverAppModuleConfig()
|
||||
{
|
||||
}
|
||||
|
||||
public ShrinkDataSaverAppModuleConfig(ShrinkAppServices? services,
|
||||
ShrinkDataSaverRuntimeConfig? runtimeConfig = null)
|
||||
{
|
||||
Services = services;
|
||||
RuntimeConfig = runtimeConfig;
|
||||
}
|
||||
|
||||
public ShrinkAppServices? Services { get; set; }
|
||||
public ShrinkDataSaverRuntimeConfig? RuntimeConfig { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd27f288ce72493889806887d825b37d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "com.cneicy.shrink-datasaver-integration-app",
|
||||
"version": "0.2.5",
|
||||
"version": "0.3.1",
|
||||
"displayName": "ShrinkDataSaver - App Integration",
|
||||
"description": "ShrinkDataSaver 与 ShrinkApp 的桥接层,提供宿主接管初始化与服务注册。",
|
||||
"unity": "2022.3",
|
||||
"dependencies": {
|
||||
"com.cneicy.shrink-datasaver": "2.4.0",
|
||||
"com.cneicy.shrink-app-core": "0.2.3",
|
||||
"com.cneicy.shrink-datasaver": "2.5.0",
|
||||
"com.cneicy.shrink-app-core": "0.2.4",
|
||||
"com.cysharp.unitask": "2.5.10",
|
||||
"com.cneicy.shrink-context-core": "0.3.0"
|
||||
"com.cneicy.shrink-context-core": "0.3.1"
|
||||
},
|
||||
"keywords": [
|
||||
"save",
|
||||
|
||||
Reference in new issue
Block a user