Skip to content

Commit f5b191d

Browse files
paulirwinclaude
andcommitted
Leave mobile ONNX runtimes out of the tool package
The tool package grew from 4.8 MB at 1.0.0-beta.4 to 168 MB at 1.0.0-rc.1. ONNX Runtime, added for the semantic reranker (#110), ships native binaries for iOS and Android next to the desktop and server ones, and a framework-dependent publish copies them all. Those two files alone were 114 MB, and the emulator can't run on either platform. Remove runtimes/ios and runtimes/android from the publish output, which is what `dotnet pack` packs for a tool. The package is now 55 MB. The container image loses the same files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 081985e commit f5b191d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎AzureSearchEmulator/AzureSearchEmulator.csproj‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,16 @@
5050
<None Include="README.md" Pack="true" PackagePath="\" />
5151
</ItemGroup>
5252

53+
<!-- ONNX Runtime ships native binaries for iOS and Android alongside the desktop and server ones,
54+
and a framework-dependent publish copies every one of them. The emulator cannot run on either
55+
mobile platform, and those two files alone added over 110 MB to the tool package. Dropped
56+
from the publish output, which is also what `dotnet pack` packs for a tool. -->
57+
<Target Name="ExcludeMobileNativeRuntimes" AfterTargets="ComputeResolvedFilesToPublishList">
58+
<ItemGroup>
59+
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)"
60+
Condition="$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\', '/').StartsWith('runtimes/ios/'))
61+
Or $([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\', '/').StartsWith('runtimes/android/'))" />
62+
</ItemGroup>
63+
</Target>
64+
5365
</Project>

0 commit comments

Comments
 (0)