Files
WCS/Plugins/Driver/Cowain.Driver/Plugin.Cowain.Driver.csproj
2026-03-02 09:08:20 +08:00

80 lines
3.2 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<!--<Import Project="../../../Directory.Version.props" />-->
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>12.0</LangVersion>
<!-- 确保 NuGet 包的 DLL 被复制 -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<None Remove="i18n\en-US.json" />
<None Remove="i18n\zh-CN.json" />
</ItemGroup>
<ItemGroup>
<AvaloniaResource Include="i18n\en-US.json" />
<AvaloniaResource Include="i18n\zh-CN.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HslCommunication" />
<PackageReference Include="Ke.Bee.Localization" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="Semi.Avalonia" />
<PackageReference Include="Semi.Avalonia.ColorPicker" />
<PackageReference Include="Semi.Avalonia.DataGrid" />
<PackageReference Include="Irihi.Ursa" />
<PackageReference Include="Irihi.Ursa.Themes.Semi" />
<PackageReference Include="Xaml.Behaviors.Avalonia" />
<PackageReference Include="Xaml.Behaviors.Interactivity" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Cowain.Base\Cowain.Base.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Views\ActionManagementView.axaml.cs">
<DependentUpon>ActionManagementView.axaml</DependentUpon>
</Compile>
<Compile Update="Views\VariableMonitorView.axaml.cs">
<DependentUpon>VariableMonitorView.axaml</DependentUpon>
</Compile>
<Compile Update="Views\TagManagementView.axaml.cs">
<DependentUpon>TagManagementView.axaml</DependentUpon>
</Compile>
<Compile Update="Views\DriverSelectedDialog.axaml.cs">
<DependentUpon>DriverSelectedDialog.axaml</DependentUpon>
</Compile>
</ItemGroup>
<Target Name="CopyFilesToDestination" AfterTargets="AfterBuild" Condition="true">
<!-- 确定相对路径到目标目录 -->
<PropertyGroup>
<!-- 这里使用 MSBuild 的内置属性来构造正确的路径 -->
<TargetDirectory>../../../Cowain.TestProject/Plugins/Driver</TargetDirectory>
</PropertyGroup>
<!-- 确保目标目录存在 -->
<MakeDir Directories="$(TargetDirectory)" Condition="!Exists('$(TargetDirectory)')" />
<ItemGroup>
<Source1 Include="i18n/*.*" />
<Source2 Include="Configs/*.*" />
<FilesToCopy Include="$(OutputPath)**/Plugin.Cowain.Driver.dll" />
<FilesToCopy Include="$(OutputPath)**/Plugin.Cowain.Driver.pdb" />
<FilesToCopy Include="$(OutputPath)**/Plugin.Cowain.Driver.deps.json" />
<FilesToCopy Include="$(OutputPath)**/HslCommunication.dll" />
<FilesToCopy Include="$(OutputPath)**/Newtonsoft.Json.dll" />
<FilesToCopy Include="$(OutputPath)**/System.IO.Ports.dll" />
</ItemGroup>
<!-- 复制文件到目标目录 -->
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(TargetDirectory)/%(RecursiveDir)" />
<Copy SourceFiles="@(Source1)" DestinationFolder="$(TargetDirectory)/i18n/" />
<Copy SourceFiles="@(Source2)" DestinationFolder="$(TargetDirectory)/Configs/" />
<!-- 输出TargetDirectory -->
<Message Text="TargetDirectory: $(TargetDirectory)" Importance="high" />
</Target>
</Project>