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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DebugType>embedded</DebugType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DebugType>embedded</DebugType>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="Tools\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
    <ProjectReference Include="..\EgwCApp.ExcImport\EgwCApp.ExcImport.csproj" />
  </ItemGroup>

  <ItemGroup>
    <None Update="Tools\ExcImport.exe">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

  <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="preBuild.bat $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\win-x64\publish\ $(ProjectDir)Tools" />
  </Target>

</Project>
