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

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

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.5" />
    <PackageReference Include="NSwag.AspNetCore" Version="13.10.9" />
    <PackageReference Include="NSwag.MSBuild" Version="13.10.9">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
  </ItemGroup>

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <NoWarn>$(NoWarm);1591</NoWarn>
  </PropertyGroup>

  <!-- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile>C:\Users\Julien\Documents\Sources\cesi\hn-20-2\Apps\Api\Api.xml</DocumentationFile>
  </PropertyGroup> -->

  <!-- Permet de générer le fichier de description de l'api à chaque build qui sera utile pour la génération du client -->
  <Target Name="NSwag" AfterTargets="Build">
    <Exec EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net50) aspnetcore2openapi /assembly:$(TargetDir)Api.dll /output:swagger.json" />
  </Target>

</Project>
