<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<RootNamespace>ResoniteModLoader</RootNamespace>
		<AssemblyName>ResoniteModLoader</AssemblyName>
		<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
		<TargetFramework>net472</TargetFramework>
		<FileAlignment>512</FileAlignment>
		<LangVersion>10.0</LangVersion>
		<Nullable>enable</Nullable>
		<Deterministic>true</Deterministic>
		<GenerateDocumentationFile>True</GenerateDocumentationFile>
		<ImplicitUsings>enable</ImplicitUsings>
		<EnableNETAnalyzers>True</EnableNETAnalyzers>
		<AnalysisLevel>7.0-Recommended</AnalysisLevel>
		<!-- Change CopyToLibraries to true if you'd like builds to be moved into the Libraries folder automatically-->
		<CopyToLibraries Condition="'$(CopyToLibraries)'==''">false</CopyToLibraries>
		<DebugType Condition="'$(Configuration)'=='Debug'">embedded</DebugType>
	</PropertyGroup>

	<PropertyGroup Condition="'$(ResonitePath)'==''">
		<!-- If you don't want to provide a ResonitePath in dotnet build, you can specify one here -->
		<ResonitePath>$(MSBuildThisFileDirectory)Resonite/</ResonitePath>
		<ResonitePath Condition="Exists('C:\Program Files (x86)\Steam\steamapps\common\Resonite\')">C:\Program Files (x86)\Steam\steamapps\common\Resonite\</ResonitePath>
		<ResonitePath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/Resonite/')">$(HOME)/.steam/steam/steamapps/common/Resonite/</ResonitePath>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Lib.Harmony" Version="2.3.3" />
		<Reference Include="Elements.Core">
			<HintPath>$(ResonitePath)Resonite_Data\Managed\Elements.Core.dll</HintPath>
			<Private>False</Private>
		</Reference>
		<Reference Include="FrooxEngine">
			<HintPath>$(ResonitePath)Resonite_Data\Managed\FrooxEngine.dll</HintPath>
			<Private>False</Private>
		</Reference>
		<Reference Include="Newtonsoft.Json">
			<HintPath>$(ResonitePath)Resonite_Data\Managed\Newtonsoft.Json.dll</HintPath>
			<Private>False</Private>
		</Reference>
		<Reference Include="Assembly-CSharp">
			<HintPath>$(ResonitePath)Resonite_Data\Managed\Assembly-CSharp.dll</HintPath>
			<Private>False</Private>
		</Reference>
		<Reference Include="UnityEngine.CoreModule">
			<HintPath>$(ResonitePath)Resonite_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
			<Private>False</Private>
		</Reference>
	</ItemGroup>

	<ItemGroup>
		<Using Remove="System.Net.Http" />
	</ItemGroup>

	<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(CopyToLibraries)'=='true'">
		<Message Text="Attempting to copy $(TargetFileName) to $(ResonitePath)Libraries" Importance="high" />
		<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFolder="$(ResonitePath)Libraries" ContinueOnError="true" />
		<Copy SourceFiles="$(TargetDir)$(TargetName).xml" DestinationFolder="$(ResonitePath)Libraries" ContinueOnError="true" />
	</Target>

</Project>
