<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <DalamudLibPath Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
    <DalamudLibPath Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(HOME)/.xlcore/dalamud/Hooks/dev/</DalamudLibPath>
    <DalamudLibPath Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(HOME)/Library/Application Support/XIV on Mac/dalamud/Hooks/dev/</DalamudLibPath>
    <DalamudLibPath Condition="'$(GITHUB_ACTIONS)' == 'true'">$(HOME)/dalamud/</DalamudLibPath>
    <DalamudLibPath Condition="$(DALAMUD_HOME) != ''">$(DALAMUD_HOME)/</DalamudLibPath>
  </PropertyGroup>

  <PropertyGroup>
    <Version>27.0.3</Version>
    <TargetFramework>net8.0-windows</TargetFramework>
    <Platforms>x64</Platforms>
    <Nullable>enable</Nullable>
    <LangVersion>latest</LangVersion>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <ProduceReferenceAssembly>false</ProduceReferenceAssembly>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <AssemblySearchPaths>$(AssemblySearchPaths);$(DalamudLibPath)</AssemblySearchPaths>
    <OutputPath>..\bin\</OutputPath>
    <DebugType>full</DebugType>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="DalamudPackager" Version="2.1.13" />
    <Reference Include="Dalamud" Private="false" />
    <Reference Include="ImGui.NET" Private="false" />
    <Reference Include="ImGuiScene" Private="false" />
    <Reference Include="Lumina" Private="false" />
    <Reference Include="Lumina.Excel" Private="false" />
    <Reference Include="SharpDX" Private="false" />
    <Reference Include="SharpDX.Direct3D11" Private="false" />
    <Reference Include="SharpDX.DXGI" Private="false" />
  </ItemGroup>

  <ItemGroup Condition="!Exists('$(ProjectDir)..\FFXIVClientStructs')">
    <Reference Include="InteropGenerator.Runtime" Private="false" />
    <Reference Include="FFXIVClientStructs" Private="false" />
  </ItemGroup>

  <PropertyGroup Condition="Exists('$(ProjectDir)..\FFXIVClientStructs')">
    <InteropGenerator_InteropNamespace>HaselTweaks</InteropGenerator_InteropNamespace>
    <DefineConstants>HAS_LOCAL_CS</DefineConstants>
  </PropertyGroup>

  <ItemGroup Condition="Exists('$(ProjectDir)..\FFXIVClientStructs')">
    <CompilerVisibleProperty Include="InteropGenerator_InteropNamespace" />
    <ProjectReference Include="..\FFXIVClientStructs\InteropGenerator\InteropGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
    <ProjectReference Include="..\FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj" Private="True" />
    <ProjectReference Include="..\FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj" Private="True" />
  </ItemGroup>

  <Target Name="Message" BeforeTargets="BeforeBuild">
    <Message Text="Dalamud.Plugin: root at $(DalamudLibPath)" Importance="high" />
  </Target>

  <PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
    <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
    <Deterministic>true</Deterministic>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <EmbedAllSources>true</EmbedAllSources>
  </PropertyGroup>

  <ItemGroup>
    <EmbeddedResource Include="Assets\Logo.png" />
    <EmbeddedResource Include="Translations.json" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
    <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106" PrivateAssets="All" />
    <PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\HaselCommon\HaselCommon\HaselCommon.csproj" />
  </ItemGroup>
</Project>
