<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects.
        One for Windows with net9.0-windows TFM, one for MacOS with net9.0-macos and one with net9.0 TFM for Linux.-->
        <TargetFramework>net9.0</TargetFramework>
        <Nullable>enable</Nullable>
        <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
        <RunPostBuildEvent>Always</RunPostBuildEvent>
    </PropertyGroup>

    <PropertyGroup>
        <ApplicationManifest>app.manifest</ApplicationManifest>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Avalonia.Desktop" Version="11.2.0" />
        <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
        <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.0" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\PSCHelpdesk\PSCHelpdesk.csproj"/>
    </ItemGroup>

    <ItemGroup>
      <Reference Include="Avalonia.Controls">
        <HintPath>..\..\..\..\.nuget\packages\avalonia\11.2.0\ref\net8.0\Avalonia.Controls.dll</HintPath>
      </Reference>
      <Reference Include="Projektanker.Icons.Avalonia">
        <HintPath>..\..\..\..\.nuget\packages\projektanker.icons.avalonia\9.4.1\lib\netstandard2.0\Projektanker.Icons.Avalonia.dll</HintPath>
      </Reference>
      <Reference Include="Projektanker.Icons.Avalonia.FontAwesome">
        <HintPath>..\..\..\..\.nuget\packages\projektanker.icons.avalonia.fontawesome\9.4.1\lib\netstandard2.0\Projektanker.Icons.Avalonia.FontAwesome.dll</HintPath>
      </Reference>
    </ItemGroup>

    <ItemGroup>
        <MySourceFiles Include="
        $(SolutionDir)\_dist\nextcloud\Nextcloud.dll;
        $(SolutionDir)\_dist\nextcloud\RestSharp.dll;
        $(SolutionDir)\_dist\nextcloud\Markdown.Avalonia*;
        $(SolutionDir)\_dist\nextcloud\ColorTextBlock.Avalonia*;
        $(SolutionDir)\_dist\nextcloud\AvaloniaEdit*;
        $(SolutionDir)\_dist\nextcloud\HtmlAgilityPack*;
        $(SolutionDir)\_dist\nextcloud\Avalonia.Svg*;
        $(SolutionDir)\_dist\hetzner\HetznerServer.dll;
        $(SolutionDir)\_dist\hetzner\HetznerCloudApi.dll;
        $(SolutionDir)\_dist\hetzner\Renci.SshNet.dll;
        "/>
    </ItemGroup>

    <Target Name="CopyFiles" AfterTargets="PostBuildEvent">
        <Copy
                SourceFiles="@(MySourceFiles)"
                DestinationFolder="$(TargetDir)/plugins/"
        />
    </Target>
    
    <!--<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="">
      <Exec Command="call postbuild.bat $(SolutionDir) $(SolutionDir)\PSCHelpdesk\PSCHelpdesk.Desktop\bin\Debug\net9.0\plugins" />
    </Target>-->
</Project>
