Skip to content

Commit

Permalink
Add AutoRestoreMGCBTool MSBuild property. Add Version to Content.Buil…
Browse files Browse the repository at this point in the history
…der.Tasks
  • Loading branch information
dellis1972 committed Oct 13, 2024
1 parent 5fb2812 commit 031a651
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
<PropertyGroup>
<DotnetCommand Condition="'$(DotnetCommand)' == ''">dotnet</DotnetCommand>
<EnableMGCBItems Condition="'$(EnableMGCBItems)' == ''">true</EnableMGCBItems>
<!-- Allow users the ability to disble tool restoration if needed -->
<AutoRestoreMGCBTool Condition="'$(AutoRestoreMGCBTool)' == ''">true</AutoRestoreMGCBTool>
<MGCBToolDirectory>$(MSBuildThisFileDirectory)dotnet-tools/</MGCBToolDirectory>
<MGCBCommand Condition="'$(MGCBCommand)' == ''">mgcb</MGCBCommand>
<MonoGameVersion>3.8.1.1-develop</MonoGameVersion>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
</Target>

<!-- Restore the dotnet-mgcb tool to a known location. -->
<Target Name="RestoreContentCompiler" Condition="!Exists ('$(MGCBToolDirectory)$(MGCBCommand)')">
<Target Name="RestoreContentCompiler" Condition=" '$(AutoRestoreMGCBTool)' == 'true' And !Exists ('$(MGCBToolDirectory)$(MGCBCommand)')">
<MakeDir Directories="$(MGCBToolDirectory)"/>
<Exec Command="&quot;$(DotnetCommand)&quot; tool install dotnet-mgcb --tool-path ." WorkingDirectory="$(MGCBToolDirectory)" />
<Exec Command="&quot;$(DotnetCommand)&quot; tool install dotnet-mgcb --version $(MonoGameVersion) --tool-path ." WorkingDirectory="$(MGCBToolDirectory)" ContinueOnError="true" />
</Target>

<!--
Expand Down

0 comments on commit 031a651

Please sign in to comment.