<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net6.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>

    <ItemGroup>
        <ProjectReference Include="..\Flagrum.Core\Flagrum.Core.csproj" />
    </ItemGroup>

    <ItemGroup>
      <Content Include="templates\AVATAR_CLOTH.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\AVATAR_GLASS.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\AVATAR_HAIR.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\AVATAR_OUTFIT.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\AVATAR_SKIN.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\BASIC_MATERIAL.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\GLASS_MATERIAL.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </Content>
      <Content Include="templates\NAMED_HUMAN_EYE.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\NAMED_HUMAN_GLASS.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </Content>
      <Content Include="templates\NAMED_HUMAN_HAIR.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\NAMED_HUMAN_OUTFIT.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <Content Include="templates\NAMED_HUMAN_SKIN.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <None Remove="templates\GLASS_MATERIAL.json" />
      <Content Include="templates\AVATAR_EYE.json">
        <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </Content>
      <None Remove="templates\NAMED_HUMAN_GLASS.json" />
      <None Remove="templates\LUCII_PHANTOM.json" />
      <Content Include="templates\LUCII_PHANTOM.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </Content>
    </ItemGroup>

    <PropertyGroup>
        <SolutionDir>$([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))</SolutionDir>
        <PythonScriptsDir>$([System.IO.Path]::GetDirectoryName($(PublishDir)))</PythonScriptsDir>
    </PropertyGroup>

    <Target Name="CopyDependencies" AfterTargets="Publish">
        <ItemGroup>
            <Blender Include="$(SolutionDir)\Flagrum.Blender\**\*.py" Exclude="$(SolutionDir)\Flagrum.Blender\venv\**\*.py" />
        </ItemGroup>
        <Copy SourceFiles="@(Blender)" DestinationFiles="@(Blender->'$(PythonScriptsDir)\%(RecursiveDir)%(Filename)%(Extension)')" />
    </Target>

</Project>
