<Project Sdk="Dalamud.NET.Sdk/14.0.1">
	<PropertyGroup Label="Target">
		<PlatformTarget>x64</PlatformTarget>
		<TargetFramework>net10.0-windows</TargetFramework>
		<LangVersion>latest</LangVersion>
		<Platforms>x64</Platforms>
		<Configurations>Debug;Release</Configurations>
	</PropertyGroup>

	<PropertyGroup>
		<AssemblyName>HSUI</AssemblyName>
		<AssemblyVersion>1.0.8.23</AssemblyVersion>
		<FileVersion>1.0.8.23</FileVersion>
		<InformationalVersion>1.0.8.23</InformationalVersion>
	</PropertyGroup>

	<PropertyGroup>
		<OutputType>Library</OutputType>
		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
		<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
		<Nullable>enable</Nullable>
		<RestorePackagesWithLockFile>false</RestorePackagesWithLockFile>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)'=='Release'">
		<Deterministic>true</Deterministic>
		<!-- Do not emit PDBs in Release; prevents your local path from appearing in user crash logs -->
		<DebugType>none</DebugType>
		<DebugSymbols>false</DebugSymbols>
	</PropertyGroup>

	<PropertyGroup>
		<DalamudVersion>dev</DalamudVersion>
		<DalamudLocal>../repos/Dalamud-master/</DalamudLocal>
	</PropertyGroup>

	<PropertyGroup>
		<AssemblySearchPaths>
			$(AssemblySearchPaths);
			$(DalamudLocal);
			$(DalamudLibPath);
		</AssemblySearchPaths>
	</PropertyGroup>

	<ItemGroup>
		<ProjectReference Include="..\repos\KamiToolKit-master\KamiToolKit.csproj" />
	</ItemGroup>

	<ItemGroup>
		<Content Include="$(ProjectDir)HSUI.json" CopyToOutputDirectory="Always" />
		<Content Include="$(ProjectDir)changelog.md" CopyToOutputDirectory="Always" />
		<Content Include="$(ProjectDir)Media\**" CopyToOutputDirectory="PreserveNewest" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Colourful" Version="3.2.0" />
		<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
	</ItemGroup>

	<!-- Deploy Release build to devPlugins so the game loads it automatically -->
	<Target Name="DeployToDevPlugins" AfterTargets="Build" Condition="'$(Configuration)'=='Release'">
		<PropertyGroup>
			<_HomeDir>$([System.Environment]::GetEnvironmentVariable('HOME'))</_HomeDir>
			<_UserProfile>$([System.Environment]::GetEnvironmentVariable('USERPROFILE'))</_UserProfile>
			<DevPluginsDir Condition="'$(_HomeDir)' != ''">$(_HomeDir)/.xlcore/devPlugins/HSUI</DevPluginsDir>
			<DevPluginsDir Condition="'$(DevPluginsDir)' == '' and '$(_UserProfile)' != ''">$(_UserProfile)/.xlcore/devPlugins/HSUI</DevPluginsDir>
			<DevPluginsDir Condition="'$(DevPluginsDir)' == ''">$(UserProfile)/.xlcore/devPlugins/HSUI</DevPluginsDir>
		</PropertyGroup>
		<MakeDir Directories="$(DevPluginsDir)" Condition="'$(DevPluginsDir)' != '' and !Exists('$(DevPluginsDir)')" />
		<Copy SourceFiles="$(OutputPath)HSUI.dll" DestinationFolder="$(DevPluginsDir)" SkipUnchangedFiles="true" Condition="'$(DevPluginsDir)' != '' and Exists('$(DevPluginsDir)')" />
		<Message Importance="high" Text="Deployed HSUI.dll to $(DevPluginsDir)" Condition="'$(DevPluginsDir)' != ''" />
	</Target>
</Project>
