Martenfur/Nopipeline

Use value from `MonoGameMGCBAdditionalArguments` to build MGCB

Closed this issue · 0 comments

Currently, it's possible to customize the build process for MGCB using the property MonoGameMGCBAdditionalArguments.

https://monogame.net/articles/tools/mgcb.html#customizing-your-build-process

However, with the way Nopipeline works, it's running the MGCB manually, without waiting for the RunContentBuilder target from the MonoGame.Content.Builder.Task package.

I wish the Nopipeline task didn't do the generation of the content, and instead targetted running before the RunContentBuilder target. This would help a lot with configuring building for different platforms and configs through the csproj file.

For example, this is what I wanna be able to do while keeping the Nopipeline task included :

<Target Name="SetMGCBArgumentsMyself" BeforeTargets="RunContentBuilder">
  <PropertyGroup Condition="'$(Platform)' == 'desktopgl-linux' Or '$(Platform)' == 'desktopgl-windows'">
    <MonoGamePlatform>DesktopGL</MonoGamePlatform>
    <MonoGameMGCBAdditionalArguments>/profile:HiDef /platform:$(MonoGamePlatform)</MonoGameMGCBAdditionalArguments>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)' == 'WindowsDX'">
    <MonoGamePlatform>Windows</MonoGamePlatform>
    <MonoGameMGCBAdditionalArguments>/profile:HiDef /platform:$(MonoGamePlatform)</MonoGameMGCBAdditionalArguments>
  </PropertyGroup>
  <Message Importance="high" Text="'$(Platform)' '$(Configuration)' '$(MonoGameMGCBAdditionalArguments)' HELLO THERE HERE" />
</Target>

Unfortunately, this won't work if you build using Nopipeline.