Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Oct 11, 2024
1 parent c4e3feb commit 3c1022d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions MonoGame.Framework.Content.Pipeline/ExternalTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static void RestoreDotnetTool(string command, string toolName)
Directory.CreateDirectory (path);
var exe = CurrentPlatform.OS == OS.Windows ? "dotnet.exe" : "dotnet";
var dotnetRoot = Environment.GetEnvironmentVariable ("DOTNET_ROOT");
if (!string.IsNullOrEmpty(dotnetRoot)) {
if (!string.IsNullOrEmpty(dotnetRoot))
{
exe = Path.Combine(dotnetRoot, exe);
}
Run (exe, $"tool {command} {toolName} --tool-path .", out string stdOut, out string stdErr, workingDirectory: path);
Expand All @@ -60,7 +61,7 @@ public static void RestoreDotnetTools()
/// </summary>
public static int RunDotnetTool(string toolName, string args, out string stdOut, out string stdErr, string stdIn=null, string workingDirectory=null)
{
RestoreDotnetTools ();
RestoreDotnetTools();
var exe = FindCommand (toolName);
var finalizedArgs = args;
return ExternalTool.Run(exe, finalizedArgs, out stdOut, out stdErr, stdIn, workingDirectory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<DotnetCommand Condition="'$(DotnetCommand)' == ''">dotnet</DotnetCommand>
<EnableMGCBItems Condition="'$(EnableMGCBItems)' == ''">true</EnableMGCBItems>
<MGCBToolDirectory>$(MSBuildThisFileDirectory)dotnet-tools</MGCBToolDirectory>
<MGCBToolDirectory>$(MSBuildThisFileDirectory)dotnet-tools/</MGCBToolDirectory>
<MGCBCommand Condition="'$(MGCBCommand)' == ''">mgcb</MGCBCommand>
</PropertyGroup>

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

<!-- Restore the dotnet-mgcb tool to a known location. -->
<Target Name="RestoreContentCompiler" Condition="!Exists ('$(MGCBToolDirectory)\$(MGCBCommand)')">
<Target Name="RestoreContentCompiler" Condition="!Exists ('$(MGCBToolDirectory)$(MGCBCommand)')">
<MakeDir Directories="$(MGCBToolDirectory)"/>
<Exec Command="&quot;$(DotnetCommand)&quot; tool install dotnet-mgcb --tool-path ." WorkingDirectory="$(MGCBToolDirectory)" />
</Target>
Expand Down
22 changes: 11 additions & 11 deletions build/DeployTasks/UploadArtifactsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ public override async Task RunAsync(BuildContext context)
if (context.IsRunningOnMacOs())
{
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "osx");
DeleteToolStore (context, path);
DeleteToolStore(context, path);
}
if (context.IsRunningOnLinux())
{
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "linux");
DeleteToolStore (context, path);
DeleteToolStore(context, path);
}
if (context.IsRunningOnWindows())
{
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release");
DeleteToolStore (context, path);
DeleteToolStore(context, path);
}


Expand All @@ -49,16 +49,16 @@ public override async Task RunAsync(BuildContext context)
await context.GitHubActions().Commands.UploadArtifact(new DirectoryPath(System.IO.Path.Combine(context.BuildOutput, "Tests", "WindowsDX", "Release")), $"tests-windowsdx-{os}");
}

void DeleteToolStore (BuildContext context, string path)
void DeleteToolStore(BuildContext context, string path)
{
if (System.IO.Directory.Exists (path)) {
if (System.IO.Directory.Exists(path)) {
var store = System.IO.Path.Combine (path, ".store");
if (System.IO.Directory.Exists (store)) {
context.Log.Information ($"Deleting: {store}");
System.IO.Directory.Delete (store, recursive: true);
foreach (var file in System.IO.Directory.GetFiles (path, "mgcb-*", System.IO.SearchOption.TopDirectoryOnly)) {
context.Log.Information ($"Deleting: {file}");
System.IO.File.Delete (file);
if (System.IO.Directory.Exists(store)) {
context.Log.Information($"Deleting: {store}");
System.IO.Directory.Delete(store, recursive: true);
foreach (var file in System.IO.Directory.GetFiles(path, "mgcb-*", System.IO.SearchOption.TopDirectoryOnly)) {
context.Log.Information($"Deleting: {file}");
System.IO.File.Delete(file);
}
}
}
Expand Down

0 comments on commit 3c1022d

Please sign in to comment.