<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <Nullable>enable</Nullable>
        <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
        <ApplicationManifest>app.manifest</ApplicationManifest>
        <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
        <Platforms>AnyCPU;x64</Platforms>
    </PropertyGroup>

    <ItemGroup>
        <AvaloniaResource Include="Assets\**" />
        <AvaloniaResource Remove="dist\**" />
        <AvaloniaResource Remove="Embedded\dist\**" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Avalonia" Version="11.0.10" />
        <PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
        <PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
        <PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" />
        <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
        <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
        <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.10" />
        <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
        <PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.13" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.13" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.13">
          <PrivateAssets>all</PrivateAssets>
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
        <PackageReference Include="OfficeOpenXml.Extension.AspNetCore" Version="1.0.0" />
        <PackageReference Include="PaddleOCRSharp" Version="4.4.0.2" />
        <PackageReference Include="RestSharp" Version="112.0.0" />
        <PackageReference Include="Serilog" Version="4.1.0" />
        <PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
        <PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
        <PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
        <PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
        <PackageReference Include="Tesseract" Version="5.2.0" />
    </ItemGroup>


    <ItemGroup>
      <Reference Include="xwd.utils">
        <HintPath>Libs\xwd.utils.dll</HintPath>
      </Reference>
    </ItemGroup>

    <ItemGroup>
      <ProjectReference Include="..\detect.device\detect.device.csproj" />
      <ProjectReference Include="..\WebViewControl.Avalonia\WebViewControl.Avalonia.csproj" />
    </ItemGroup>

    <ItemGroup>
      <None Update="app.state.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
      <None Update="appsettings.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
      <None Update="appsettings.dev.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
      <None Update="appsettings.prod.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
      <None Update="chi_sim.traineddata">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
    </ItemGroup>
    
    <ItemGroup>
      <UpToDateCheckInput Remove="Views\Camera\CameraLayoutView.axaml" />
      <UpToDateCheckInput Remove="Views\Camera\CameraLayoutWindow.axaml" />
      <UpToDateCheckInput Remove="Views\Camera\VideoFullWindow.axaml" />
      <UpToDateCheckInput Remove="Views\Camera\VideoPlayer.axaml" />
    </ItemGroup>

    <ItemGroup>
      <Content Include="Embedded\dist\**\*">
          <!-- 设置目标输出目录，保留文件的相对路径 -->
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
          <Link>dist\%(RecursiveDir)%(FileName)%(Extension)</Link>
      </Content>
    </ItemGroup>

    <ItemGroup>
      <Compile Update="Views\DeviceView.axaml.cs">
        <DependentUpon>DeviceView.axaml</DependentUpon>
        <SubType>Code</SubType>
      </Compile>
      <Compile Update="Views\WebBrowserWindow.axaml.cs">
        <DependentUpon>WebBrowserWindow.axaml</DependentUpon>
        <SubType>Code</SubType>
      </Compile>
    </ItemGroup>
</Project>
