<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <RootNamespace>DynamicOpenVR</RootNamespace>
    <AssemblyName>DynamicOpenVR</AssemblyName>
    <DefineConstants>UNITY_5_3_OR_NEWER;MONO</DefineConstants>
    <TargetFramework>netstandard2.0</TargetFramework>
    <LibrariesDir>$(ProjectDir)..\..\Libraries\Mono\</LibrariesDir>
  </PropertyGroup>
  <Import Project="Common.props" />
  <Target Name="PublishForBeatSaber" AfterTargets="Publish">    
    <ItemGroup>
      <CopyToOutput Include="$(ProjectDir)..\..\Packaging\DynamicOpenVR\**\*.*" />
    </ItemGroup>

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

    <!-- copy static files -->
    <Copy SourceFiles="@(CopyToOutput)" DestinationFiles="@(CopyToOutput->'$(PublishDir)\%(RecursiveDir)%(Filename)%(Extension)')" />
  </Target>
</Project>