<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <RootNamespace>DynamicOpenVR.IL2CPP</RootNamespace>
    <AssemblyName>DynamicOpenVR.IL2CPP</AssemblyName>
    <DefineConstants>UNITY_5_3_OR_NEWER;OPENVR_XR_API;IL2CPP</DefineConstants>
    <TargetFramework>net6.0</TargetFramework>
    <LibrariesDir>$(ProjectDir)..\..\Libraries\Il2CppInterop\</LibrariesDir>
  </PropertyGroup>
  <Import Project="$(ProjectDir)..\DynamicOpenVR\Common.props" />
  <ItemGroup>
    <Reference Include="Il2CppInterop.Common">
      <HintPath>$(LibrariesDir)\Il2CppInterop.Common.dll</HintPath>
      <Private>false</Private>
    </Reference>
    <Reference Include="Il2CppInterop.Runtime">
      <HintPath>$(LibrariesDir)\Il2CppInterop.Runtime.dll</HintPath>
      <Private>false</Private>
    </Reference>
    <Reference Include="Il2Cppmscorlib">
      <HintPath>$(LibrariesDir)\Il2Cppmscorlib.dll</HintPath>
      <Private>false</Private>
    </Reference>
    <Reference Include="SteamVR">
      <HintPath>$(LibrariesDir)\SteamVR.dll</HintPath>
      <Private>false</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="$(ProjectDir)..\DynamicOpenVR\**\*.cs" Exclude="$(ProjectDir)..\DynamicOpenVR\bin\**;$(ProjectDir)..\DynamicOpenVR\obj\**" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Update="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.5.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Update="Microsoft.Unity.Analyzers" Version="1.17.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
  <Target Name="PublishForBepInEx" AfterTargets="Publish">
    <!-- clean up -->
    <RemoveDir Directories="$(PublishDir)" />

    <!-- create Libs folder and move DLL/PDB inside -->
    <MakeDir Directories="$(PublishDir)BepInEx\plugins" />
    <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PublishDir)BepInEx\plugins" />
    <Copy SourceFiles="$(TargetDir)$(TargetName).xml" DestinationFolder="$(PublishDir)BepInEx\plugins" />
    <Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="$(PublishDir)BepInEx\plugins" Condition="$(DebugType) != 'none'" />
  </Target>
</Project>