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

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <AssemblyName>QRRapidoApp</AssemblyName>
    <RootNamespace>QRRapidoApp</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="AspNetCore.DataProtection.MongoDb" Version="2.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="8.0.0" />
    <PackageReference Include="MongoDB.Driver" Version="2.22.0" />
    <PackageReference Include="Moq" Version="4.20.72" />
    <PackageReference Include="QRCoder" Version="1.4.3" />
    <PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
    <PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
    <PackageReference Include="Serilog.Enrichers.Process" Version="3.0.0" />
    <PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
    <PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
    <PackageReference Include="Serilog.Sinks.Console" Version="6.0.1-dev-00953" />
    <PackageReference Include="Serilog.Sinks.OpenSearch" Version="1.3.0" />
    <PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
    <PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
    <PackageReference Include="Stripe.net" Version="48.4.0" />
    <PackageReference Include="StackExchange.Redis" Version="2.7.4" />
    <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.0" />
    <PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Localization" Version="2.2.0" />
    <PackageReference Include="xunit.assert" Version="2.9.3" />
    <PackageReference Include="xunit.extensibility.core" Version="2.9.3" />
    <PackageReference Include="Markdig" Version="0.37.0" />
    <PackageReference Include="YamlDotNet" Version="16.2.0" />
  </ItemGroup>

  <ItemGroup>
    <Folder Include="wwwroot\images\" />
    <Folder Include="wwwroot\css\" />
    <Folder Include="Data\" />
    <Folder Include="Services\" />
    <Folder Include="Middleware\" />
    <Folder Include="Tests\" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="Content\Tutoriais\*.md">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
    </Content>
  </ItemGroup>

  <ItemGroup>
    <Compile Update="Resources\SharedResource.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>SharedResource.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Resources\SharedResource.en.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
    </EmbeddedResource>
    <EmbeddedResource Update="Resources\SharedResource.es.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
    </EmbeddedResource>
    <EmbeddedResource Update="Resources\SharedResource.pt-BR.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
    </EmbeddedResource>
    <EmbeddedResource Update="Resources\SharedResource.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>SharedResource.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>

  <Target Name="BuildFrontend" BeforeTargets="Build" Condition="'$(Configuration)'=='Release'">
    <Message Importance="High" Text="Executando build do frontend com Vite..." />
    <Exec Command="npm install" WorkingDirectory="$(MSBuildProjectDirectory)" Condition="!Exists('node_modules')" />
    <Exec Command="npm run build" WorkingDirectory="$(MSBuildProjectDirectory)" />
  </Target>

</Project>
