<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <Import Project="$(ProjectDir)..\..\Drivers\Common.items" />
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <RootNamespace>Reko.Decompiler.Runtime</RootNamespace>
    <AssemblyName>Reko.Decompiler.Runtime</AssemblyName>
    <Platforms>x86;x64;ARM64</Platforms>
    <Configurations>Debug;Release</Configurations>
    <NuspecFile>$(MSBuildThisFileDirectory)/bin/Runtime-$(Platform)-$(Configuration).nuspec</NuspecFile>
  </PropertyGroup>
  <Import Project="$(ProjectDir)..\..\Drivers\PreBuild.targets" />

  <Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
    <PropertyGroup>
      <NuspecProperties>$(NuspecProperties);id=$(AssemblyName)</NuspecProperties>
      <NuspecProperties>$(NuspecProperties);config=$(Configuration)</NuspecProperties>
      <NuspecProperties>$(NuspecProperties);platform=$(Platform)</NuspecProperties>
      <NuspecProperties>$(NuspecProperties);version=$(PackageVersion)</NuspecProperties>
      <NuspecProperties>$(NuspecProperties);authors=$(Authors)</NuspecProperties>
    </PropertyGroup>
    <Message Importance="high" Text="NuspecProperties: $(NuspecProperties)" />
  </Target>

  <Target Name="SetNuspecFiles" BeforeTargets="GenerateNuspec">
    <Message Importance="high" Text="Updating nuspec &quot;$(NuspecFile)&quot;..." />
    <MSBuild Projects="$(ProjectDir)..\..\BuildTargets\BuildTargets.csproj" Properties="Configuration=$(Configuration);Platform=$(Platform)" Targets="update_runtime_nuspec" />
  </Target>
</Project>
