<Project Sdk="Microsoft.NET.Sdk.Razor">

    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>net6.0-windows10.0.17763.0</TargetFramework>
        <Nullable>enable</Nullable>
        <UseWPF>true</UseWPF>
        <ApplicationIcon>Resources\flagrum.ico</ApplicationIcon>
        <DebugType>embedded</DebugType>
        <AssemblyName>Flagrum</AssemblyName>
        <AssemblyVersion>1.4.3</AssemblyVersion>
        <FileVersion>1.4.3</FileVersion>
    </PropertyGroup>

    <ItemGroup>
        <None Remove="loading.gif" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Clowd.Squirrel" Version="2.6.34-pre" />
        <PackageReference Include="FontAwesome5" Version="2.1.6" />
        <PackageReference Include="HelixToolkit.SharpDX.Assimp" Version="2.22.0" />
        <PackageReference Include="HelixToolkit.SharpDX.Core.Wpf" Version="2.22.0" />
        <PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.4" />
        <PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="6.0.101-preview.11.2349" />
        <PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="6.0.0" />
        <PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\Flagrum.Web\Flagrum.Web.csproj" />
    </ItemGroup>

    <ItemGroup>
        <None Update="steam_appid.txt">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Update="steam_api64.dll">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <Content Include="Resources\preview.png">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="Resources\default.png">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="Resources\Textures\teal.btex">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\fonts\MaterialIcons-Regular.ttf">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\fonts\MaterialIconsOutlined-Regular.otf">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\fonts\Play-Regular.ttf">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\fonts\Roboto-Regular.ttf">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\app.css">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\discord-button.png">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\index.html">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Update="wwwroot\interop.js">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <None Remove="Resources\earc.png" />
        <Content Include="Resources\earc.png">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
    </ItemGroup>

    <ItemGroup>
        <Resource Include="flagrum-titlebar.png">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Resource>
        <Resource Include="patreon.png">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Resource>
    </ItemGroup>

    <ItemGroup>
        <EmbeddedResource Update="Resources\Localisation.resx">
            <Generator>PublicResXFileCodeGenerator</Generator>
            <LastGenOutput>Localisation.Designer.cs</LastGenOutput>
        </EmbeddedResource>
        <EmbeddedResource Update="Resources\Localisation.ja-JP.resx">
            <Generator>PublicResXFileCodeGenerator</Generator>
            <LastGenOutput>Localisation.ja-JP.Designer.cs</LastGenOutput>
        </EmbeddedResource>
        <EmbeddedResource Update="Resources\Localisation.zh-cn.resx">
            <Generator>ResXFileCodeGenerator</Generator>
            <LastGenOutput>Localisation.zh-cn.Designer.cs</LastGenOutput>
        </EmbeddedResource>
        <EmbeddedResource Update="Resources\Localisation.zh-hk.resx">
            <Generator>ResXFileCodeGenerator</Generator>
            <LastGenOutput>Localisation.zh-hk.Designer.cs</LastGenOutput>
        </EmbeddedResource>
    </ItemGroup>

    <ItemGroup>
        <Compile Update="Resources\Localisation.Designer.cs">
            <DesignTime>True</DesignTime>
            <AutoGen>True</AutoGen>
            <DependentUpon>Localisation.resx</DependentUpon>
        </Compile>
        <Compile Update="Resources\Localisation.ja-JP.Designer.cs">
            <DesignTime>True</DesignTime>
            <AutoGen>True</AutoGen>
            <DependentUpon>Localisation.ja-JP.resx</DependentUpon>
        </Compile>
        <Compile Update="Resources\Localisation.zh-cn.Designer.cs">
            <DesignTime>True</DesignTime>
            <AutoGen>True</AutoGen>
            <DependentUpon>Localisation.zh-cn.resx</DependentUpon>
        </Compile>
        <Compile Update="Resources\Localisation.zh-hk.Designer.cs">
            <DesignTime>True</DesignTime>
            <AutoGen>True</AutoGen>
            <DependentUpon>Localisation.zh-hk.resx</DependentUpon>
        </Compile>
    </ItemGroup>

    <PropertyGroup>
        <SolutionDir>$([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))</SolutionDir>
        <ApplicationManifest>app.manifest</ApplicationManifest>
    </PropertyGroup>

    <Target Name="CopyDependencies" AfterTargets="Publish">
        <ItemGroup>
            <ExternalDependencies Include="$(SolutionDir)\Dependencies\**\*.*" />
        </ItemGroup>
        <Copy SourceFiles="@(ExternalDependencies)" DestinationFiles="@(ExternalDependencies->'$(PublishDir)\%(RecursiveDir)%(Filename)%(Extension)')" />
    </Target>

</Project>
