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

  <PropertyGroup>
    <!-- Common settings -->
    <TargetFramework>net9.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <OptimizationPreference>Speed</OptimizationPreference>
    <ApplicationIcon>icon.ico</ApplicationIcon>
    <PackageIcon>icon.png</PackageIcon>
    <SelfContained>true</SelfContained>
    <RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
    <InvariantGlobalization>true</InvariantGlobalization>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
    <DebugType>embedded</DebugType>
    
    <!-- Package information -->
    <AssemblyName>FireflyClient</AssemblyName>
    <RootNamespace>FireflyClient</RootNamespace>
    <Title>Firefly Client</Title>
    <Description>A client library for interacting with Firefly Redis-compatible server</Description>
    <PackageId>FireflyClient</PackageId>
    <Version>1.0.0</Version>
    <Authors>IDSolutions</Authors>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
    <IsPackable>true</IsPackable>
  </PropertyGroup>

  <!-- Executable configuration -->
  <PropertyGroup Condition="'$(BuildType)' != 'lib'">
    <OutputType>Exe</OutputType>
    <PublishSingleFile>true</PublishSingleFile>
    <SelfContained>true</SelfContained>
    <PublishTrimmed>true</PublishTrimmed>
    <StripSymbols>true</StripSymbols>
    <PublishAot>true</PublishAot>
    <IlcOptimizationPreference>Speed</IlcOptimizationPreference>
    <IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
    <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
  </PropertyGroup>

  <!-- Library configuration -->
  <PropertyGroup Condition="'$(BuildType)' == 'lib'">
    <OutputType>Library</OutputType>
    <EnableDynamicLoading>true</EnableDynamicLoading>
    <NativeLib>Shared</NativeLib>
    <PublishAot>true</PublishAot>
    <PublishTrimmed>true</PublishTrimmed>
    <StripSymbols>true</StripSymbols>
    <IlcOptimizationPreference>Speed</IlcOptimizationPreference>
    <IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="icon.png" />
    <Content Include="icon.ico" />
    <None Include="resources\icon.png" Pack="true" Visible="false" PackagePath="\" />
    <None Include="resources\icon.ico" Pack="true" Visible="false" PackagePath="\" />
  </ItemGroup>

  <!-- Include header file in the package -->
  <ItemGroup>
    <None Include="firefly.h" Pack="true" Visible="false" PackagePath="include" />
  </ItemGroup>

</Project>