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

    <PropertyGroup>
        <TargetFramework>net9.0</TargetFramework>
        <IsPackable>false</IsPackable>
        <IsTestProject>true</IsTestProject>
        <NoWarn>
            <!-- Don't show warning to make method static for our tests. -->
            CA1822
        </NoWarn>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="CSPath"/>
        <PackageReference Include="coverlet.collector">
            <PrivateAssets>all</PrivateAssets>
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
        <PackageReference Include="NSubstitute"/>
        <PackageReference Include="NSubstitute.Analyzers.CSharp">
            <PrivateAssets>all</PrivateAssets>
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
        <PackageReference Include="System.Linq.Async"/>
        <PackageReference Include="TUnit"/>
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\PkmnLib.Dynamic\PkmnLib.Dynamic.csproj"/>
        <ProjectReference Include="..\PkmnLib.Static\PkmnLib.Static.csproj"/>
        <ProjectReference Include="..\Plugins\PkmnLib.Plugin.Gen7\PkmnLib.Plugin.Gen7.csproj"/>
    </ItemGroup>
    
    <Target Name="WorkaroundRider117732" AfterTargets="Build" Condition="!$([MSBuild]::IsOSPlatform('Windows'))">
        <Copy Condition="Exists('$(OutputPath)$(AssemblyName)')" SourceFiles="$(OutputPath)$(AssemblyName)" DestinationFiles="$(OutputPath)$(AssemblyName).exe"/>
    </Target>

    <Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
        <Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High"/>
        <Exec Command="dotnet husky install" StandardOutputImportance="Low" StandardErrorImportance="High" WorkingDirectory=".."/>
    </Target>
</Project>
