Skip to content

Commit c20e1c6

Browse files
committed
build(mobile): 在移动构建中排除 SoundFlow 原生资产
为避免将 SoundFlow 的本机运行时资产打包到移动分支,调整 SecRandom.csproj:在非移动构建下正常引用 SoundFlow,移动构建下保留其托管程序集但通过 ExcludeAssets="native" 排除原生资产。并在 AGENTS.md 中补充说明:移动构建保留 SoundFlow 的托管依赖以兼容共享代码,但 Android/iOS 的实际播放由 IMobileMediaPlayer 提供,从而避免引入不必要的原生资源。
1 parent 6d9f7f1 commit c20e1c6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

SecRandom/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ SecRandom/
116116
- Plugin logs are not separate files. They write through the existing `ILogger` pipeline with category prefix `SecRandom.Plugin[<plugin-id>].`; plugin detail UI must only show entries for the selected plugin.
117117
- Plugin draw access is invocation-only through `IPluginDrawInvoker`; do not pass `DrawEngine`, mutable profile history, draw config, or random sources into plugin contexts.
118118
- Picking `ClearRecord` is about app-layer temporary draw records, not persistent profile histories. RollCall and QuickDraw share student temporary records; Lottery uses prize temporary records.
119-
- `MusicLibraryService` owns `data/audio/music` and new selection IDs. Student/prize attached music settings can override only animation/result selections; a multi-record draw uses the first drawn record as the music source. Deleting a track clears global and per-record references. Keep SoundFlow types private to `DrawAudioService`; each resolved draw music setting owns `AnimationMusicLoop`, process playback must stop immediately on cancellation/disposal, and transitions to result music without delaying draw results. Legacy absolute paths are read-only compatibility entries; do not create new external-path selections.
119+
- `MusicLibraryService` owns `data/audio/music` and new selection IDs. Student/prize attached music settings can override only animation/result selections; a multi-record draw uses the first drawn record as the music source. Deleting a track clears global and per-record references. Keep SoundFlow types private to `DrawAudioService`; each resolved draw music setting owns `AnimationMusicLoop`, process playback must stop immediately on cancellation/disposal, and transitions to result music without delaying draw results. Mobile builds retain SoundFlow's managed assembly for the shared app but exclude its unused native assets; `IMobileMediaPlayer` owns Android/iOS playback. Legacy absolute paths are read-only compatibility entries; do not create new external-path selections.
120120
- ViewModels must be registered in Host and inherit `ViewModelBase`; `ViewModelBase` exposes `Config`.
121121
- Keep shell/profile/base ViewModels in `ViewModels/`; page-specific main ViewModels belong in `ViewModels/MainPages/`, and history settings page ViewModels belong in `ViewModels/SettingsPages/History/`.
122122
- Use `IAppHost.GetService<T>()` for existing service resolution patterns in views and services.

SecRandom/SecRandom.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@
430430
<PackageReference Include="Sentry.Extensions.Logging" Version="6.6.0" />
431431
<PackageReference Include="Sentry.Profiling" Version="6.6.0" Condition="'$(BuildMobile)' != 'true'" />
432432
<PackageReference Include="QRCoder" Version="1.7.0" />
433-
<PackageReference Include="SoundFlow" Version="[1.2.1.3]" />
433+
<PackageReference Include="SoundFlow" Version="[1.2.1.3]" Condition="'$(BuildMobile)' != 'true'" />
434+
<!-- Android/iOS playback uses IMobileMediaPlayer; retain the managed dependency but omit SoundFlow's unused native runtime asset. -->
435+
<PackageReference Include="SoundFlow" Version="[1.2.1.3]" Condition="'$(BuildMobile)' == 'true'" ExcludeAssets="native" />
434436
<PackageReference Include="ClassIsland.Shared.IPC" Version="2.1.0.1" />
435437
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="10.0.0" />
436438
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.3" />

0 commit comments

Comments
 (0)