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

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <Version>1.0.0</Version>
    <EnableDynamicLoading>true</EnableDynamicLoading>
    <OutputPath>bin\$(Configuration)\$(TargetFramework)\content\</OutputPath>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <PluginPackageOutputDirectory>$(MSBuildThisFileDirectory)artifacts\Packages\</PluginPackageOutputDirectory>
    <PluginPackagePath>$(PluginPackageOutputDirectory)$(AssemblyName).$(Version).laapp</PluginPackagePath>
    <LegacyLoosePluginOutputDirectory>$(MSBuildThisFileDirectory)artifacts\Loose\</LegacyLoosePluginOutputDirectory>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\..\LanMountainDesktop.PluginSdk\LanMountainDesktop.PluginSdk.csproj" Private="false" />
    <None Include="plugin.json" CopyToOutputDirectory="PreserveNewest" />
    <None Include="Localization\*.json" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

  <Target Name="CreateLaappPackage" AfterTargets="Build">
    <MakeDir Directories="$(PluginPackageOutputDirectory)" />
    <RemoveDir Directories="$(LegacyLoosePluginOutputDirectory)" />
    <Delete Files="$(PluginPackagePath)" TreatErrorsAsWarnings="true" />
    <ZipDirectory SourceDirectory="$(OutputPath)" DestinationFile="$(PluginPackagePath)" />
  </Target>

</Project>
