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

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <OutputType>Exe</OutputType>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <RootNamespace>Mbproxy</RootNamespace>
    <AssemblyName>Mbproxy</AssemblyName>
    <!-- Phase 08: Assembly version.  CI can override via /p:InformationalVersion=... -->
    <InformationalVersion>1.0.0</InformationalVersion>
  </PropertyGroup>

  <!-- Phase 08: single-file self-contained publish (Release only; Debug stays normal for fast iteration).
       NOTE: the resulting Mbproxy.exe is ~100 MB because the self-contained publish bundles the full
       .NET 10 + ASP.NET Core runtime. This exceeds the original 50 MB target in the phase spec;
       the runtime size is a fixed cost of self-contained deployment on .NET 10 with ASP.NET Core.
       Operators who need a smaller footprint can use a framework-dependent publish
       (dotnet publish -c Release -r win-x64 - -self-contained false /p:PublishSingleFile=true)
       if the target machine has .NET 10 installed. -->
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <PublishSingleFile>true</PublishSingleFile>
    <SelfContained>true</SelfContained>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
  </PropertyGroup>

  <ItemGroup>
    <!-- ASP.NET Core for the Phase 07 Kestrel-hosted admin endpoint. -->
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>

  <ItemGroup>
    <!-- Microsoft.Extensions.Hosting is already included transitively via
         Microsoft.AspNetCore.App — do not re-add it explicitly. -->
    <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.8" />
    <PackageReference Include="Serilog.Extensions.Hosting" Version="10.0.0" />
    <PackageReference Include="Serilog.Settings.Configuration" Version="10.0.0" />
    <PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
    <PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
    <!-- Referenced now so phase 04/05 don't need to touch this csproj; usage is deferred -->
    <PackageReference Include="Polly" Version="8.6.6" />
  </ItemGroup>

  <ItemGroup>
    <!-- Allow test project to access internal types (HeartbeatWorker, HostingExtensions, etc.) -->
    <InternalsVisibleTo Include="Mbproxy.Tests" />
  </ItemGroup>

  <ItemGroup>
    <Content Update="appsettings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

</Project>
