-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShipOnePlugin.targets
More file actions
42 lines (38 loc) · 2.99 KB
/
Copy pathShipOnePlugin.targets
File metadata and controls
42 lines (38 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Helper for the dynamic plugin shipping (BuildToolPlugins/ShipToolPlugins): runs once per
discovered plugin, invoked by the host csproj through the MSBuild task with
PluginDir / PluginName / Configuration / OutputPath properties.
The plugin's OWN files (assembly, pdb, xml, deps.json) are ALWAYS refreshed; the extra
dependencies are copied ONLY when the host bin does not already provide them
(NON-HOST DEPENDENCIES RULE, AGENT_TOOLS_GUIDE §8). ONNX Runtime is ALWAYS a host
dependency (per-RID GPU build ships with the host archive) — the plugin's transitive
CPU onnxruntime natives must never shadow it (version conflicts, CPU-only QwenTTS), so
they are excluded here unconditionally. -->
<Target Name="Ship">
<ItemGroup>
<_MainFiles Include="$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).dll" />
<_MainFiles Include="$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).pdb" />
<_MainFiles Include="$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).deps.json" />
<_MainFiles Include="$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).xml" />
<_DepsFiles Include="$(PluginDir)bin\$(Configuration)\net10.0\**\*"
Exclude="$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).dll;$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).pdb;$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).deps.json;$(PluginDir)bin\$(Configuration)\net10.0\$(PluginName).xml;$(PluginDir)bin\$(Configuration)\net10.0\assets\**\*;$(PluginDir)bin\$(Configuration)\net10.0\Microsoft.ML.OnnxRuntime*.dll;$(PluginDir)bin\$(Configuration)\net10.0\onnxruntime*;$(PluginDir)bin\$(Configuration)\net10.0\libonnxruntime*" />
</ItemGroup>
<Copy SourceFiles="@(_MainFiles)" DestinationFolder="$(OutputPath)Tools\$(PluginName)\" />
<Copy SourceFiles="@(_DepsFiles)" DestinationFolder="$(OutputPath)Tools\$(PluginName)\" Condition="!Exists('$(OutputPath)%(Filename)%(Extension)')" />
<!-- Remove ORT files that older builds may have already copied into the plugin folder:
Copy never deletes, so the exclusion above alone would leave stale CPU natives that
shadow the host's GPU ORT. Delete is a no-op for absent files. -->
<ItemGroup>
<_StaleOrtFiles Include="$(OutputPath)Tools\$(PluginName)\onnxruntime*;$(OutputPath)Tools\$(PluginName)\libonnxruntime*;$(OutputPath)Tools\$(PluginName)\Microsoft.ML.OnnxRuntime*.dll" />
</ItemGroup>
<Delete Files="@(_StaleOrtFiles)" />
</Target>
<!-- Same as Ship plus the host-level assets (PresentationTool bg/js, OfficeSupportTool
templates) copied at the app root. -->
<Target Name="ShipWithAssets" DependsOnTargets="Ship">
<ItemGroup>
<_AssetsFiles Include="$(PluginDir)bin\$(Configuration)\net10.0\assets\**\*" />
</ItemGroup>
<Copy SourceFiles="@(_AssetsFiles)" DestinationFolder="$(OutputPath)assets\%(RecursiveDir)" />
</Target>
</Project>