Skip to content

Commit

Permalink
Slight refactor of where we check when to inlcude PCBs
Browse files Browse the repository at this point in the history
  • Loading branch information
CartBlanche committed Mar 18, 2024
1 parent fcf9eef commit 0a7eaec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
18 changes: 6 additions & 12 deletions VS4Mac_Meadow_Extension/MeadowExecutionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ namespace Meadow.Sdks.IdeExtensions.Vs4Mac
{
public class MeadowExecutionCommand : ProcessExecutionCommand
{
public MeadowExecutionCommand() : base()
{
logger = new OutputLogger();
}

// Adrian: Task because it's been assigned in a non-async method
// i.e. it's a task to avoid awaiting the assignment (lazy but harmless)
public Task<List<string>> ReferencedAssemblies { get; set; }
Expand All @@ -32,7 +27,12 @@ public MeadowExecutionCommand() : base()
IMeadowConnection meadowConnection = null;
DebuggingServer meadowDebugServer = null;

public async Task DeployApp(int debugPort, CancellationToken cancellationToken)
public MeadowExecutionCommand() : base()
{
logger = new OutputLogger();
}

public async Task DeployApp(int debugPort, bool includePdbs, CancellationToken cancellationToken)
{
DeploymentTargetsManager.StopPollingForDevices();

Expand Down Expand Up @@ -81,12 +81,6 @@ public async Task DeployApp(int debugPort, CancellationToken cancellationToken)
Debug.WriteLine("OS download failed, make sure you have an active internet connection");
}

var configuration = IdeApp.Workspace.ActiveConfiguration;

bool includePdbs = configuration is SolutionConfigurationSelector isScs
&& isScs?.Id == "Debug"
&& debugPort > 1000;

meadowConnection!.FileWriteProgress += MeadowConnection_DeploymentProgress;
meadowConnection!.DeviceMessageReceived += MeadowConnection_DeviceMessageReceived;

Expand Down
2 changes: 1 addition & 1 deletion VS4Mac_Meadow_Extension/MeadowExecutionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public ProcessAsyncOperation Execute(ExecutionCommand command, OperationConsole
{
try
{
return new ProcessAsyncOperation(meadowCommand.DeployApp(-1, cts.Token), cts);
return new ProcessAsyncOperation(meadowCommand.DeployApp(-1, false, cts.Token), cts);
}
catch (Exception ex)
{
Expand Down
10 changes: 9 additions & 1 deletion VS4Mac_Meadow_Extension/MeadowSoftDebuggerSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Threading;
using Mono.Debugging.Client;
using Mono.Debugging.Soft;
using MonoDevelop.Ide;
using MonoDevelop.Projects;

namespace Meadow.Sdks.IdeExtensions.Vs4Mac
{
Expand All @@ -25,7 +27,13 @@ protected override async void OnRun(DebuggerStartInfo startInfo)
var connectArgs = meadowStartInfo.StartArgs as SoftDebuggerConnectArgs;
var port = connectArgs?.DebugPort ?? 0;

await meadowStartInfo.ExecutionCommand.DeployApp(port, debugCancelTokenSource.Token);
var configuration = IdeApp.Workspace.ActiveConfiguration;

bool includePdbs = configuration is SolutionConfigurationSelector isScs
&& isScs?.Id == "Debug"
&& port > 1000;

await meadowStartInfo.ExecutionCommand.DeployApp(port, includePdbs, debugCancelTokenSource.Token);

base.OnRun(startInfo);
}
Expand Down

0 comments on commit 0a7eaec

Please sign in to comment.