<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <AssemblyName>TeslaConsole</AssemblyName>
    <GenerateAssemblyInfo>False</GenerateAssemblyInfo>
    <OutputType>WinExe</OutputType>
    <!-- net40 (XP11): the newest .NET Framework that installs on Windows XP SP3;
         net40 assemblies load in-place on the 4.8 runtime in Win10/11, so this ONE
         exe covers XP SP3 through Windows 11 — same deal as the Launcher. The
         original console was net20, so the decompiled core needs nothing newer.
         WinForms comes via plain framework references (UseWindowsForms is not
         wired up for net40). -->
    <TargetFramework>net40</TargetFramework>
    <LangVersion>Preview</LangVersion>
    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
    <ApplicationIcon>app.ico</ApplicationIcon>
    <RootNamespace />
    <!-- Decompiled from the original net20 TeslaConsole.exe; legacy WinForms 2.0 sources -->
    <Nullable>disable</Nullable>
    <ImplicitUsings>disable</ImplicitUsings>
    <!-- CS0649: decompiled WinForms designer 'components' fields are never assigned -->
    <NoWarn>$(NoWarn);CS0649</NoWarn>
  </PropertyGroup>

  <ItemGroup>
    <!-- .NET Framework reference assemblies so the project builds without a full targeting pack installed -->
    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <!-- The UI images, embedded as their raw original bytes (extracted 1:1 from the
         old .resx BinaryFormatter blobs). Loaded by Properties.Resources.EmbeddedBitmap/
         EmbeddedIcon: the .resx blob route needs System.Resources.Extensions at
         runtime, which is net461+ and cannot load on net40/XP. -->
    <EmbeddedResource Include="assets\icons\*.*" LogicalName="TeslaConsole.Icons.%(Filename)%(Extension)" />
  </ItemGroup>

  <ItemGroup>
    <!-- Runtime content the console loads relative to the exe (RPConfig.cs / RPStrings.cs / AppRegistry.cs) -->
    <Content Include="RedPlanet\RPConfig.xml" CopyToOutputDirectory="PreserveNewest" />
    <Content Include="RedPlanet\RPStrings.xml" CopyToOutputDirectory="PreserveNewest" />
    <Content Include="RedPlanet\Apps.xml" CopyToOutputDirectory="PreserveNewest" />
    <Content Include="BattleTech\BTConfig.xml" CopyToOutputDirectory="PreserveNewest" />
    <Content Include="BattleTech\BTStrings.xml" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

  <ItemGroup>
    <!-- Reference-only material: original binary + source art. Not compiled, not copied. -->
    <None Remove="original\**" />
    <None Remove="images\**" />
  </ItemGroup>

  <ItemGroup>
    <!-- The differential test project lives under tests\; keep its sources out of this build. -->
    <Compile Remove="tests\**" />
    <None Remove="tests\**" />
    <Content Remove="tests\**" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Configuration.Install" />
    <Reference Include="System.Xml" />
    <Reference Include="System.ServiceProcess" />
    <Reference Include="Microsoft.VisualBasic" />
    <Reference Include="WeifenLuo.WinFormsUI.Docking">
      <HintPath>lib\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
    </Reference>
    <Reference Include="Munga Net">
      <HintPath>lib\Munga Net.dll</HintPath>
    </Reference>
    <Reference Include="BitmapLibrary">
      <HintPath>lib\BitmapLibrary.dll</HintPath>
    </Reference>
  </ItemGroup>

  <ItemGroup>
    <!-- The wire contract (Tesla.Net) is now built from source. The project emits an
         assembly still named TeslaConsoleLaunchLib so the BinaryFormatter protocol is
         byte-identical to the old vendored lib\TeslaConsoleLaunchLib.dll. -->
    <ProjectReference Include="..\Contract\Tesla.Contract.csproj" />
    <!-- Secure-config provisioning (Tesla.PodConfigurationServer, OFBCryptoStream...),
         also built from source now, emitting assembly TeslaSecureConfiguration. -->
    <ProjectReference Include="..\SecureConfig\Tesla.SecureConfig.csproj" />
  </ItemGroup>
</Project>
