Initial binaries packaging by SimonDarksideJ · Pull Request #8959 · MonoGame/MonoGame

Summary

New packaging delivery to ship MonoGame as a Binaries delivery

Aims

To produce a pre-packaged version of all MonoGame deployments and dependencies in a single download.

Usage

Full docs are in the process for use, in the meantime, here is a sample/updated desktopgl project

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <PublishReadyToRun>false</PublishReadyToRun>
    <TieredCompilation>false</TieredCompilation>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <ApplicationIcon>../binariestest.Core/Content/Icon.ico</ApplicationIcon>
    <AssemblyName>binariestest</AssemblyName>
    <MonoGamePlatform>DesktopGL</MonoGamePlatform>
    <MonoGameBinariesPath Condition="'$(MonoGameBinariesPath)' == ''">$(MSBuildThisFileDirectory)..\..\MonoGame.3.8.4.2764-develop\MonoGame.Framework\</MonoGameBinariesPath>
  </PropertyGroup>
  <ItemGroup>
    <MonoGameContentReference Include="..\binariestest.Core\Content\binariestest.mgcb">
      <Link>Content\binariestest.mgcb</Link>
    </MonoGameContentReference>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\binariestest.Core\binariestest.Core.csproj" />
  </ItemGroup>
  <ItemGroup>
    <None Include="$(MonoGameBinariesPath)$(MonoGamePlatform)\runtimes\win-x64\native\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="MonoGame.Framework">
      <HintPath>$(MonoGameBinariesPath)$(MonoGamePlatform)\MonoGame.Framework.dll</HintPath>
    </Reference>
  </ItemGroup>  
  <ItemGroup>
    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.*" />
  </ItemGroup>
</Project>

As well as an updated Content Builder Project usage, for content reference (platform specific) inclusions:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <MonoGameBinariesPath Condition="'$(MonoGameBinariesPath)' == ''">$(MSBuildThisFileDirectory)..\..\MonoGame.3.8.4.2764-develop\</MonoGameBinariesPath>    
  </PropertyGroup>

  <ItemGroup>
	<None Include="Assets/*" />
  </ItemGroup>
  <ItemGroup>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\windows-x64\bin\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\runtimes\win-x64\native\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="MIConvexHull" Version="1.1.19.1019" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="MonoGame.Framework">
      <HintPath>$(MonoGameBinariesPath)MonoGame.Framework\Native\Release\MonoGame.Framework.dll</HintPath>
    </Reference>
    <Reference Include="MonoGame.Framework.Content.Pipeline">
      <HintPath>$(MonoGameBinariesPath)MonoGame.Framework.Content.Pipeline\MonoGame.Framework.Content.Pipeline.dll</HintPath>
    </Reference>
  </ItemGroup>
  
</Project>

Future updates

Current structure aligns with MonoGame output current deployment. Future work will restructure the output for easier consumption.