<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <ApplicationIcon>assets/icon64.ico</ApplicationIcon>
        <RootNamespace>KeyPaint</RootNamespace>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <Nullable>enable</Nullable>

        <!-- Platform definitions -->
        <IsWindows
            Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">
            true</IsWindows>
        <IsOSX
            Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">
            true</IsOSX>
        <IsLinux
            Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">
            true</IsLinux>
    </PropertyGroup>

    <!-- Platform constants -->
    <PropertyGroup Condition="'$(IsWindows)'=='true'">
        <DefineConstants>$(DefineConstants);Windows</DefineConstants>
    </PropertyGroup>
    <PropertyGroup Condition="'$(IsOSX)'=='true'">
        <DefineConstants>$(DefineConstants);OSX</DefineConstants>
    </PropertyGroup>
    <PropertyGroup Condition="'$(IsLinux)'=='true'">
        <DefineConstants>$(DefineConstants);Linux</DefineConstants>
    </PropertyGroup>

    <!-- Adding assets to bin folder -->
    <Target Name="CopyAssets" AfterTargets="AfterBuild">
        <ItemGroup>
            <_AssetFiles Include="$(MSBuildProjectDirectory)\assets\**" />
            <_GlfwFiles Include="$(MSBuildProjectDirectory)\glfw\**" />
        </ItemGroup>
        <Copy SourceFiles="@(_AssetFiles)" DestinationFolder="$(OutDir)assets\%(RecursiveDir)" />
        <Copy SourceFiles="@(_GlfwFiles)" DestinationFolder="$(OutDir)\%(RecursiveDir)" />
    </Target>

    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
    <ItemGroup>
        <PackageReference Include="Silk.NET" Version="2.15.0" />
        <PackageReference Include="Silk.NET.Core" Version="2.15.0" />
        <PackageReference Include="Silk.NET.Windowing.Common" Version="2.15.0" />
        <PackageReference Include="Silk.NET.Windowing.Glfw" Version="2.15.0" />
        <PackageReference Include="SkiaSharp" Version="2.88.3" />
        <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
        <PackageReference Include="SixLabors.ImageSharp" Version="2.1.2" />
        <PackageReference Include="NativeFileDialogSharp" Version="*" />
    </ItemGroup>
</Project>