<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <RootNamespace>BrassAndSigil.Server</RootNamespace>
    <AssemblyName>brass-sigil-server</AssemblyName>
    <ApplicationIcon>Assets\icon.ico</ApplicationIcon>

    <!-- Single-file self-contained publish defaults -->
    <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">linux-x64</RuntimeIdentifier>
    <RuntimeIdentifiers>linux-x64;win-x64</RuntimeIdentifiers>
    <PublishSingleFile>true</PublishSingleFile>
    <SelfContained>true</SelfContained>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
    <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
    <DebugType>embedded</DebugType>

    <!-- Embed wwwroot/* into the assembly so the published exe is truly single-file. -->
    <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
    <StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>
    <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.7" />
    <PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
  </ItemGroup>

  <ItemGroup>
    <!-- Replace the implicit Web SDK Content rule for wwwroot with EmbeddedResource. -->
    <Content Remove="wwwroot\**" />
    <EmbeddedResource Include="wwwroot\**" />
    <!-- Server-list icon dropped into <serverDir>/server-icon.png on first install. -->
    <EmbeddedResource Include="Assets\server-icon.png">
      <LogicalName>BrassAndSigil.Server.Assets.server-icon.png</LogicalName>
    </EmbeddedResource>
  </ItemGroup>
</Project>
