feat: AOT 单文件静态链接 + Release 引导脚本

- csproj 静态链接 Skia/HarfBuzz/ANGLE(CoreUtils.*.Static),AOT 产出真单文件
- 发布后清理 .dll/.lib/.pdb,只留 notify.exe
- bin/notify.cmd 与 notify.sh:首次运行从 Release 下载 notify.exe
  原子下载(临时文件+改名)+ mkdir 锁,并发不重复下载,带陈旧锁恢复
- 修复 cmd 引导脚本管道 stdin 丢失:避免调 exe 前向前 goto,改用 call 子程序
- hooks.json 指向 notify.cmd,超时放宽以容纳首次下载
- .gitignore 放行两个脚本但忽略 notify.exe;.gitattributes 固定脚本换行符
This commit is contained in:
2026-06-22 17:35:57 +08:00
Unverified
parent 79992680c9
commit 0de6fe4064
6 changed files with 133 additions and 10 deletions
+34
View File
@@ -44,4 +44,38 @@
<PackageReference Include="Irihi.Ursa.Themes.Semi" Version="2.0.1" />
</ItemGroup>
<!--
AOT 单文件:把 Skia / HarfBuzz / ANGLE 三个原生库静态链接进 exe
CoreUtils.SkiaSharp.Static 含 skia + libHarfBuzzSharp 的 .libCoreUtils.ANGLE.Static 含 ANGLE
两包各自的 .targets 会在 PublishAot 时自动追加 NativeLibrary,这里只补 DirectPInvoke 与系统 lib
版本对应:Avalonia 12 → SkiaSharp 3.119
-->
<ItemGroup>
<PackageReference Include="CoreUtils.SkiaSharp.Static" Version="3.119.0.1" />
<PackageReference Include="CoreUtils.ANGLE.Static" Version="7151.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(PublishAot)' == 'true'">
<DirectPInvoke Include="libSkiaSharp" />
<DirectPInvoke Include="libHarfBuzzSharp" />
<DirectPInvoke Include="av_libglesv2" />
<!-- ANGLE 静态库需要的系统库 -->
<LinkerArg Include="gdi32.lib" />
<LinkerArg Include="user32.lib" />
<LinkerArg Include="d3d9.lib" />
<LinkerArg Include="dxgi.lib" />
<LinkerArg Include="dxguid.lib" />
<LinkerArg Include="synchronization.lib" />
</ItemGroup>
<!-- 静态链接后清理发布目录:动态原生 DLL、链接期 .lib、调试 .pdb 都不需要,只留 notify.exe -->
<Target Name="CleanAotSingleFileOutput" AfterTargets="Publish" Condition="'$(PublishAot)' == 'true'">
<ItemGroup>
<_AotJunk Include="$(PublishDir)*.dll" />
<_AotJunk Include="$(PublishDir)*.lib" />
<_AotJunk Include="$(PublishDir)*.pdb" />
</ItemGroup>
<Delete Files="@(_AotJunk)" />
</Target>
</Project>