Hello there!
I just updated my whole code base to the new prerealease version 3.8.0.1375-develop and now I try to implement a custom build process with MSBuild (though I am fairly new with the “targets” stuff )
According to this part of the MGCB documentation, I can use BeforeTargets="BuildContent"
and AfterTargets="BuildContent"
to do things before or after the MGCB process runs.
So here is what I tried in my .csproj :
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<MonoGamePlatform>Windows</MonoGamePlatform>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.0.1375-develop" />
</ItemGroup>
<Target Name="MyBeforeTarget" BeforeTargets="BuildContent">
<Message Text="MyBeforeTarget Ran"/>
</Target>
<Target Name="MyAfterTarget" AfterTargets="BuildContent">
<Message Text="MyAfterTarget Ran"/>
</Target>
<Target Name="IncludeContent" BeforeTargets="PrepareForBuild">
<Message Text="IncludeContent Ran"/>
</Target>
</Project>
Unfortunately, none of these targets seem to be called as long as MonoGame.Content.Builder.Task
is in the project. Only the MGCB task runs during the build and I don’t see any other message in the Build Output. Am I missing something?