diff --git a/release-notes.md b/release-notes.md
index ab9b122..14d7b65 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -4,6 +4,12 @@
This document contains the release information for the project.
+### 2.0.2 (Prev-2)
+
+* Fixed: As per #53, cleaned up exponential Build status messages.
+* Added: Enabled quick access to Linux Debugger's Options dialog
+* Update: Refactored options mechanism in prep for custom profiles.
+
### 2.0.1 (Prev-1)
* Added: Option to set output window focus to Linux Debugger, default=`false`. (PR #46)
diff --git a/sandbox/GuiNet5/Program.cs b/sandbox/GuiNet5/Program.cs
index 6265b1d..d869f42 100644
--- a/sandbox/GuiNet5/Program.cs
+++ b/sandbox/GuiNet5/Program.cs
@@ -12,8 +12,8 @@ public static AppBuilder BuildAvaloniaApp() => AppBuilder
.UsePlatformDetect()
.With(new X11PlatformOptions
{
- EnableMultiTouch = true,
- UseDBusMenu = true,
+ EnableMultiTouch = false,
+ UseDBusMenu = false,
})
.With(new Win32PlatformOptions
{
diff --git a/sandbox/GuiNet6/Program.cs b/sandbox/GuiNet6/Program.cs
index 4c10af9..468d707 100644
--- a/sandbox/GuiNet6/Program.cs
+++ b/sandbox/GuiNet6/Program.cs
@@ -13,7 +13,7 @@ public static AppBuilder BuildAvaloniaApp() => AppBuilder
.With(new X11PlatformOptions
{
EnableMultiTouch = true,
- UseDBusMenu = true,
+ UseDBusMenu = false,
})
.With(new Win32PlatformOptions
{
diff --git a/src/.editorconfig b/src/.editorconfig
index 34fc7c4..123b7b0 100644
--- a/src/.editorconfig
+++ b/src/.editorconfig
@@ -34,37 +34,8 @@ root = true
[*]
end_of_line = crlf
indent_style = space
-dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 2
indent_size = 2
-csharp_indent_labels = one_less_than_current
-dotnet_style_coalesce_expression = true:suggestion
-dotnet_style_null_propagation = true:suggestion
-dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
-dotnet_style_prefer_auto_properties = true:silent
-dotnet_style_object_initializer = true:suggestion
-dotnet_style_collection_initializer = true:suggestion
-dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
-dotnet_style_prefer_conditional_expression_over_assignment = true:silent
-dotnet_style_prefer_conditional_expression_over_return = true:silent
-dotnet_style_explicit_tuple_names = true:suggestion
-dotnet_style_prefer_inferred_tuple_names = true:suggestion
-dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
-dotnet_style_prefer_compound_assignment = true:suggestion
-dotnet_style_prefer_simplified_interpolation = true:suggestion
-csharp_using_directive_placement = outside_namespace:silent
-csharp_prefer_simple_using_statement = true:suggestion
-csharp_prefer_braces = when_multiline:silent
-csharp_style_namespace_declarations = block_scoped:silent
-csharp_style_prefer_method_group_conversion = true:silent
-csharp_style_expression_bodied_methods = false:silent
-csharp_style_expression_bodied_constructors = false:silent
-csharp_style_expression_bodied_operators = false:silent
-csharp_style_expression_bodied_properties = true:silent
-csharp_style_expression_bodied_indexers = true:silent
-csharp_style_expression_bodied_accessors = true:silent
-csharp_style_expression_bodied_lambdas = true:silent
-csharp_style_expression_bodied_local_functions = false:silent
[*.{c,cpp,h}]
indent_style = space
@@ -176,6 +147,9 @@ csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
+csharp_using_directive_placement = outside_namespace:silent
+csharp_prefer_simple_using_statement = true:suggestion
+
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
@@ -207,21 +181,21 @@ dotnet_style_require_accessibility_modifiers = for_non_interface_members
dotnet_style_readonly_field = true
# Expression-level preferences
-dotnet_style_coalesce_expression = true
-dotnet_style_collection_initializer = true
-dotnet_style_explicit_tuple_names = true
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_namespace_match_folder = true
-dotnet_style_null_propagation = true
-dotnet_style_object_initializer = true
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_object_initializer = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
-dotnet_style_prefer_auto_properties = true
+dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_compound_assignment = true
-dotnet_style_prefer_conditional_expression_over_assignment = true
-dotnet_style_prefer_conditional_expression_over_return = true
+dotnet_style_prefer_conditional_expression_over_assignment = true:silent
+dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_inferred_anonymous_type_member_names = true
-dotnet_style_prefer_inferred_tuple_names = true
-dotnet_style_prefer_is_null_check_over_reference_equality_method = true
-dotnet_style_prefer_simplified_boolean_expressions = true
+dotnet_style_prefer_inferred_tuple_names = true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
+dotnet_style_prefer_simplified_boolean_expressions = true:silent
dotnet_style_prefer_simplified_interpolation = true
# Parameter preferences
@@ -334,6 +308,13 @@ dotnet_diagnostic.IDE0046.severity = none
# IDE0058: Expression value is never used
# csharp_style_unused_value_expression_statement_preference = discard_variable
dotnet_diagnostic.IDE0058.severity = none
+csharp_style_namespace_declarations = block_scoped:silent
+csharp_style_prefer_method_group_conversion = true:silent
+csharp_style_expression_bodied_methods = false:silent
+csharp_style_expression_bodied_constructors = false:silent
+csharp_style_expression_bodied_operators = false:silent
+csharp_style_expression_bodied_lambdas = true:silent
+csharp_style_expression_bodied_local_functions = false:silent
## Code Quality Rules
# CA1031: Do not catch general exception types
diff --git a/src/VsLinuxDebugger/Commands.Impl.cs b/src/VsLinuxDebugger/Commands.Impl.cs
index accc48a..da29180 100644
--- a/src/VsLinuxDebugger/Commands.Impl.cs
+++ b/src/VsLinuxDebugger/Commands.Impl.cs
@@ -158,30 +158,32 @@ private void SetMenuTextAndVisibility(object sender, EventArgs e)
private UserOptions ToUserOptions()
{
+ DebuggerPackage VsixPackage = _package as DebuggerPackage;
+
return new UserOptions
{
- DeleteLaunchJsonAfterBuild = Settings.DeleteLaunchJsonAfterBuild,
+ DeleteLaunchJsonAfterBuild = VsixPackage.VsixOptions.DeleteLaunchJsonAfterBuild,
- HostIp = Settings.HostIp,
- HostPort = Settings.HostPort,
+ HostIp = VsixPackage.VsixOptions.HostIp,
+ HostPort = VsixPackage.VsixOptions.HostPort,
- LocalPLinkPath = Settings.LocalPLinkPath,
- LocalSwitchLinuxDbgOutput = Settings.LocalSwitchLinuxDbgOutput,
+ LocalPLinkPath = VsixPackage.VsixOptions.PLinkPath,
+ LocalSwitchLinuxDbgOutput = VsixPackage.VsixOptions.SwitchLinuxDbgOutput,
- RemoteDebugDisplayGui = Settings.RemoteDebugDisplayGui,
- RemoteDeployBasePath = Settings.RemoteDeployBasePath,
- RemoteDotNetPath = Settings.RemoteDotNetPath,
- RemoteVsDbgBasePath = Settings.RemoteVsDbgBasePath,
+ RemoteDebugDisplayGui = VsixPackage.VsixOptions.RemoteDebugDisplayGui,
+ RemoteDeployBasePath = VsixPackage.VsixOptions.RemoteDeployBasePath,
+ RemoteDotNetPath = VsixPackage.VsixOptions.RemoteDotNetPath,
+ RemoteVsDbgBasePath = VsixPackage.VsixOptions.RemoteVsDbgRootPath,
- UseCommandLineArgs = Settings.UseCommandLineArgs,
+ UseCommandLineArgs = VsixPackage.VsixOptions.UseCommandLineArgs,
//// UsePublish = Settings.UsePublish,
- UserPrivateKeyEnabled = Settings.UserPrivateKeyEnabled,
- UserPrivateKeyPath = Settings.UserPrivateKeyPath,
- UserPrivateKeyPassword = Settings.UserPrivateKeyPassword,
- UserName = Settings.UserName,
- UserPass = Settings.UserPass,
- UserGroupName = Settings.UserGroupName,
+ UserPrivateKeyEnabled = VsixPackage.VsixOptions.UserPrivateKeyEnabled,
+ UserPrivateKeyPath = VsixPackage.VsixOptions.UserPrivateKeyPath,
+ UserPrivateKeyPassword = VsixPackage.VsixOptions.UserPrivateKeyPassword,
+ UserName = VsixPackage.VsixOptions.UserName,
+ UserPass = VsixPackage.VsixOptions.UserPass,
+ UserGroupName = VsixPackage.VsixOptions.UserGroupName,
};
}
}
diff --git a/src/VsLinuxDebugger/Commands.cs b/src/VsLinuxDebugger/Commands.cs
index 413826f..67a424d 100644
--- a/src/VsLinuxDebugger/Commands.cs
+++ b/src/VsLinuxDebugger/Commands.cs
@@ -41,8 +41,6 @@ private Commands(AsyncPackage package, OleMenuCommandService commandService)
/// Gets the service provider from the owner package.
private Microsoft.VisualStudio.Shell.IAsyncServiceProvider ServiceProvider => this._package;
- private DebuggerPackage Settings => _package as DebuggerPackage;
-
/// Initializes the singleton instance of the command.
/// Owner package, not null.
public static async Task InitializeAsync(AsyncPackage package)
diff --git a/src/VsLinuxDebugger/Core/LaunchBuilder.cs b/src/VsLinuxDebugger/Core/LaunchBuilder.cs
index f17956f..eb2c6b9 100644
--- a/src/VsLinuxDebugger/Core/LaunchBuilder.cs
+++ b/src/VsLinuxDebugger/Core/LaunchBuilder.cs
@@ -8,18 +8,18 @@
namespace VsLinuxDebugger.Core
{
- // TODO: Combine with UserOptions to make life easier.
+ /// LaunchBuilder class for serialization.
public class LaunchBuilder
{
public const string AdapterFileName = "launch.json";
private UserOptions _opts;
- public LaunchBuilder(DTE2 dte, Project dteProject, UserOptions o)
+ public LaunchBuilder(DTE2 dte, Project dteProject, UserOptions userOptions)
{
ThreadHelper.ThrowIfNotOnUIThread();
- _opts = o;
+ _opts = userOptions;
AssemblyName = dteProject.Properties.Item("AssemblyName").Value.ToString();
ProjectConfigName = dteProject.ConfigurationManager.ActiveConfiguration.ConfigurationName;
diff --git a/src/VsLinuxDebugger/Core/RemoteDebugger.cs b/src/VsLinuxDebugger/Core/RemoteDebugger.cs
index 5bb5855..560122f 100644
--- a/src/VsLinuxDebugger/Core/RemoteDebugger.cs
+++ b/src/VsLinuxDebugger/Core/RemoteDebugger.cs
@@ -63,7 +63,9 @@ public async Task BeginAsync(BuildOptions buildOptions)
}
}
- using (var ssh = new SshTool(_options, _launchBuilder))
+ var remoteInfo = GetRemoteConnectionInfo();
+
+ using (var ssh = new SshTool(remoteInfo))
{
var success = await ssh.ConnectAsync();
if (!success)
@@ -72,13 +74,15 @@ public async Task BeginAsync(BuildOptions buildOptions)
return false;
}
- await ssh.TryInstallVsDbgAsync();
- await ssh.MakeDeploymentFolderAsync();
- await ssh.CleanDeploymentFolderAsync();
+ var vsDbgFolder = LinuxPath.Combine(_options.RemoteVsDbgBasePath, Constants.VS2022);
+
+ await ssh.TryInstallVsDbgAsync(vsDbgFolder);
+ await ssh.MakeDeploymentFolderAsync(_options.RemoteDeployBasePath);
+ await ssh.CleanFolderAsync(_launchBuilder.RemoteDeployProjectFolder);
if (buildOptions.HasFlag(BuildOptions.Deploy))
{
- await ssh.UploadFilesAsync();
+ await ssh.UploadFilesAsync(_launchBuilder.OutputDirFullPath, _launchBuilder.RemoteDeployProjectFolder);
}
////else if (buildOptions.HasFlag(BuildOptions.Publish))
////{
@@ -235,6 +239,21 @@ private bool Initialize()
return true;
}
+ private SshConnectionInfo GetRemoteConnectionInfo()
+ {
+ return new SshConnectionInfo
+ {
+ Host = _options.HostIp,
+ Port = _options.HostPort,
+ UserGroup = _options.UserGroupName,
+ UserName = _options.UserName,
+ UserPass = _options.UserPass,
+ PrivateKeyEnabled = _options.UserPrivateKeyEnabled,
+ PrivateKeyPath = _options.UserPrivateKeyPath,
+ PrivateKeyPassword = _options.UserPrivateKeyPassword,
+ };
+ }
+
private bool IsCSharpProject(Project vsProject)
{
ThreadHelper.ThrowIfNotOnUIThread();
diff --git a/src/VsLinuxDebugger/Core/SshConnectionInfo.cs b/src/VsLinuxDebugger/Core/SshConnectionInfo.cs
new file mode 100644
index 0000000..8fcb620
--- /dev/null
+++ b/src/VsLinuxDebugger/Core/SshConnectionInfo.cs
@@ -0,0 +1,22 @@
+namespace VsLinuxDebugger.Core
+{
+ public struct SshConnectionInfo
+ {
+ public string Host { get; set; }
+
+ public int Port { get; set; }
+
+ /// User's Group (if applicable).
+ public string UserGroup { get; set; }
+
+ public string UserName { get; set; }
+
+ public string UserPass { get; set; }
+
+ public bool PrivateKeyEnabled { get; set; }
+
+ public string PrivateKeyPath { get; set; }
+
+ public string PrivateKeyPassword { get; set; }
+ }
+}
diff --git a/src/VsLinuxDebugger/Core/SshTool.cs b/src/VsLinuxDebugger/Core/SshTool.cs
index e8d49e2..662c765 100644
--- a/src/VsLinuxDebugger/Core/SshTool.cs
+++ b/src/VsLinuxDebugger/Core/SshTool.cs
@@ -2,10 +2,8 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
-using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
-using Microsoft.VisualStudio.Shell;
using Renci.SshNet;
using Renci.SshNet.Common;
using SharpCompress.Common;
@@ -18,16 +16,14 @@ public class SshTool : IDisposable
private readonly string _tarGzFileName = "vsldBuildContents.tar.gz";
private bool _isConnected = false;
- private LaunchBuilder _launch;
- private UserOptions _opts;
+ private SshConnectionInfo _info;
private ScpClient _scp;
private SftpClient _sftp;
private SshClient _ssh;
- public SshTool(UserOptions opts, LaunchBuilder launch)
+ public SshTool(SshConnectionInfo info)
{
- _opts = opts;
- _launch = launch;
+ _info = info;
}
public SshClient Ssh => _ssh;
@@ -101,7 +97,7 @@ public string BashStream(string command, bool isSudo = false)
result = stream.Expect("password");
Logger.Debug($"BASH-SUDO: {result}");
- stream.Write(_opts.UserPass + "\n");
+ stream.Write(_info.UserPass + "\n");
result = stream.Expect(prompt);
Logger.Debug($"BASH-SUDO: {result}");
}
@@ -142,17 +138,19 @@ public string BashStream(string command, string searchText)
/// Cleans the contents of the deployment path.
/// Clear entire base deployment folder (TRUE) or just our project.
- public async Task CleanDeploymentFolderAsync(bool fullScrub = false)
+ public async Task CleanFolderAsync(string path)
{
// Whole deployment folder and hidden files
// rm -rf xxx/* == Contents of the folder but not the folder itself
// rm -rf xxx/{*,.*} == All hidden files and folders
- var filesAndFolders = "{*,.*}";
-
- if (fullScrub)
- await BashAsync($"rm -rf \"{_opts.RemoteDeployBasePath}/{filesAndFolders}\"");
- else
- await BashAsync($"rm -rf {_launch.RemoteDeployProjectFolder}/{filesAndFolders}");
+ var allFilesAndFolders = "{*,.*}";
+ await BashAsync($"rm -rf {path}/{allFilesAndFolders}"); // "~/LinuxDbg/MyProg/{*,.*}"
+
+ // Not used
+ ////if (fullScrub)
+ //// await BashAsync($"rm -rf \"{_opts.RemoteDeployBasePath}/{allFilesAndFolders}\""); // "~/LinuxDbg/{*,.*}"
+ ////else
+ //// await BashAsync($"rm -rf {_launch.RemoteDeployProjectFolder}/{allFilesAndFolders}"); // "~/LinuxDbg/MyProg/{*,.*}"
}
public async Task ConnectAsync()
@@ -161,12 +159,12 @@ public async Task ConnectAsync()
try
{
- if (_opts.UserPrivateKeyEnabled)
+ if (_info.PrivateKeyEnabled)
{
- if (string.IsNullOrEmpty(_opts.UserPrivateKeyPassword))
- keyFile = new PrivateKeyFile(_opts.UserPrivateKeyPath);
+ if (string.IsNullOrEmpty(_info.PrivateKeyPassword))
+ keyFile = new PrivateKeyFile(_info.PrivateKeyPath);
else
- keyFile = new PrivateKeyFile(_opts.UserPrivateKeyPath, _opts.UserPrivateKeyPassword);
+ keyFile = new PrivateKeyFile(_info.PrivateKeyPath, _info.PrivateKeyPassword);
}
}
catch (Exception ex)
@@ -178,9 +176,9 @@ public async Task ConnectAsync()
try
{
- _ssh = (_opts.UserPrivateKeyEnabled && File.Exists(_opts.UserPrivateKeyPath))
- ? new SshClient(_opts.HostIp, _opts.HostPort, _opts.UserName, keyFile)
- : new SshClient(_opts.HostIp, _opts.HostPort, _opts.UserName, _opts.UserPass);
+ _ssh = (_info.PrivateKeyEnabled && File.Exists(_info.PrivateKeyPath))
+ ? new SshClient(_info.Host, _info.Port, _info.UserName, keyFile)
+ : new SshClient(_info.Host, _info.Port, _info.UserName, _info.UserPass);
await Task.Run(() => _ssh.Connect());
}
@@ -193,8 +191,8 @@ public async Task ConnectAsync()
try
{
var sftpClient = (keyFile == null)
- ? new SftpClient(_opts.HostIp, _opts.HostPort, _opts.UserName, _opts.UserPass)
- : new SftpClient(_opts.HostIp, _opts.HostPort, _opts.UserName, keyFile);
+ ? new SftpClient(_info.Host, _info.Port, _info.UserName, _info.UserPass)
+ : new SftpClient(_info.Host, _info.Port, _info.UserName, keyFile);
sftpClient.Connect();
_sftp = sftpClient;
@@ -202,8 +200,8 @@ public async Task ConnectAsync()
catch (Exception)
{
_scp = (keyFile == null)
- ? new ScpClient(_opts.HostIp, _opts.HostPort, _opts.UserName, _opts.UserPass)
- : new ScpClient(_opts.HostIp, _opts.HostPort, _opts.UserName, keyFile);
+ ? new ScpClient(_info.Host, _info.Port, _info.UserName, _info.UserPass)
+ : new ScpClient(_info.Host, _info.Port, _info.UserName, keyFile);
_scp.Connect();
}
@@ -226,25 +224,25 @@ public void Dispose()
_scp?.Dispose();
}
- public async Task MakeDeploymentFolderAsync()
+ public async Task MakeDeploymentFolderAsync(string remoteBaseFolder)
{
- // do we need SUDO?
- await BashAsync($"mkdir -p {_opts.RemoteDeployBasePath}");
+ // do we need SUDO? Not yet
+ await BashAsync($"mkdir -p {remoteBaseFolder}");
//// Bash($"mkdir -p {_opts.RemoteDeployDebugPath}");
//// Bash($"mkdir -p {_opts.RemoteDeployReleasePath}");
- var group = string.IsNullOrEmpty(_opts.UserGroupName)
+ var group = string.IsNullOrEmpty(_info.UserGroup)
? string.Empty
- : $":{_opts.UserGroupName}";
+ : $":{_info.UserGroup}";
// Update ownership so it's not "root"
- await BashAsync($"sudo chown -R {_opts.UserName}{group} {_opts.RemoteDeployBasePath}");
+ await BashAsync($"sudo chown -R {_info.UserName}{group} {remoteBaseFolder}");
}
///
/// Install cURL and VS Debugger if it doesn't exist already.
///
- public async Task TryInstallVsDbgAsync()
+ public async Task TryInstallVsDbgAsync(string vsDbgFolder)
{
string arch = (await BashAsync("uname -m")).Trim('\n');
@@ -261,8 +259,7 @@ public async Task TryInstallVsDbgAsync()
// If output path does not exist, execute the following commands "curl .. | bash .."
// 2022-10-27: Added '-k' to allow for Microsoft's self-signed certificate.
- var outputPath = LinuxPath.Combine(_opts.RemoteVsDbgBasePath, Constants.VS2022);
- var ret = await BashAsync($"[ -d {outputPath} ] || curl -ksSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l {outputPath}");
+ var ret = await BashAsync($"[ -d {vsDbgFolder} ] || curl -ksSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l {vsDbgFolder}");
Logger.Output($"Returned: {ret}");
}
@@ -279,7 +276,11 @@ public void UploadFile(Stream input, string path)
}
}
- public async Task UploadFilesAsync()
+ /// Upload files to remote machine.
+ /// Local folder to upload from.
+ /// Remote target folder to upload to.
+ ///
+ public async Task UploadFilesAsync(string sourceFolder, string targetFolder)
{
try
{
@@ -291,22 +292,22 @@ public async Task UploadFilesAsync()
// TODO: Rev3 - Allow for both SFTP and SCP as a backup. This separating connection to a new disposable class.
//// Logger.Output($"Connected to {_connectionInfo.Username}@{_connectionInfo.Host}:{_connectionInfo.Port} via SSH and {(_sftpClient != null ? "SFTP" : "SCP")}");
- await BashAsync($@"mkdir -p {_launch.RemoteDeployProjectFolder}");
-
- var srcDirInfo = new DirectoryInfo(_launch.OutputDirFullPath);
+ var srcDirInfo = new DirectoryInfo(sourceFolder);
if (!srcDirInfo.Exists)
- throw new DirectoryNotFoundException($"Directory '{_launch.OutputDirFullPath}' not found!");
+ throw new DirectoryNotFoundException($"Directory '{sourceFolder}' not found!");
+
+ await BashAsync($@"mkdir -p {targetFolder}");
// Compress files to upload as single `tar.gz`.
- var destTarGz = LinuxPath.Combine(_launch.RemoteDeployProjectFolder, _tarGzFileName);
+ var destTarGz = LinuxPath.Combine(targetFolder, _tarGzFileName);
Logger.Output($"Destination Tar.GZ: '{destTarGz}'");
var success = await PayloadCompressAndUploadAsync(_sftp, srcDirInfo, destTarGz);
// Decompress file
- await PayloadDecompressAsync(destTarGz, false);
+ await PayloadDecompressAsync(targetFolder, destTarGz, false);
- Logger.Output($"Upload completed {(success ? "successfully." : "with failure.")}.");
+ Logger.Output($"Upload completed {(success ? "successfully" : "with failure")}.");
return string.Empty;
}
@@ -397,7 +398,6 @@ private ConcurrentDictionary GetLocalFiles(DirectoryInfo srcDi
localFileCache[cleanedRelativeFilePath] = new FileInfo(file);
});
- Logger.Output($"Local file cache created");
return localFileCache;
}
@@ -409,8 +409,11 @@ private ConcurrentDictionary GetLocalFiles(DirectoryInfo srcDi
private async Task PayloadCompressAndUploadAsync(SftpClient sftp, DirectoryInfo srcDirInfo, string pathBuildTarGz)
{
var success = false;
+ Logger.Output($"Getting bin files for transfer...");
var localFiles = GetLocalFiles(srcDirInfo);
+ Logger.Output($"Compressing files for transfer...");
+
// TODO: Delta remote files against local files for changes.
using (Stream tarGzStream = new MemoryStream())
{
@@ -480,6 +483,7 @@ await Task.Run(() =>
{
var tarGzSize = tarGzStream.Length;
+ Logger.Output("Uploading...");
await Task.Run(() =>
{
tarGzStream.Seek(0, SeekOrigin.Begin);
@@ -503,26 +507,23 @@ await Task.Run(() =>
}
/// Unpack build contents.
+ /// Remote target folder to upload to.
/// Path to upload to.
/// Remove our build's tar.gz file. Set to FALSE for debugging. (default=true)
/// Returns true on success.
- private async Task PayloadDecompressAsync(string pathBuildTarGz, bool removeTarGz = true)
+ private async Task PayloadDecompressAsync(string targetFolder, string pathBuildTarGz, bool removeTarGz = true)
{
- var decompressOutput = string.Empty;
-
try
{
-
var cmd = "set -e";
- cmd += $";cd \"{_launch.RemoteDeployProjectFolder}\"";
+ cmd += $";cd \"{targetFolder}\"";
cmd += $";tar -zxf \"{_tarGzFileName}\"";
////cmd += $";tar -zxf \"{pathBuildTarGz}\"";
if (removeTarGz)
cmd += $";rm \"{pathBuildTarGz}\"";
- decompressOutput = await BashAsync(cmd);
-
+ string decompressOutput = await BashAsync(cmd);
Logger.Output($"Payload Decompress results: '{decompressOutput}' (blank=OK)");
}
catch (Exception)
diff --git a/src/VsLinuxDebugger/DebuggerPackage.cs b/src/VsLinuxDebugger/DebuggerPackage.cs
index 96bf564..a3aed13 100644
--- a/src/VsLinuxDebugger/DebuggerPackage.cs
+++ b/src/VsLinuxDebugger/DebuggerPackage.cs
@@ -31,39 +31,7 @@ public sealed partial class DebuggerPackage : AsyncPackage
/// Package GUID string.
public const string PackageGuidString = "19f87f23-7a2c-4279-ac7c-c9267776bbf9";
- public bool DeleteLaunchJsonAfterBuild => _optionsPage.DeleteLaunchJsonAfterBuild;
-
- public string HostIp => _optionsPage.HostIp;
- public int HostPort => _optionsPage.HostPort;
-
- public string LocalPLinkPath => _optionsPage.PLinkPath;
- public bool LocalSwitchLinuxDbgOutput
- {
- get
- {
- Logger.AutoSwitchToLinuxDbgOutput = _optionsPage.SwitchLinuxDbgOutput;
- return _optionsPage.SwitchLinuxDbgOutput;
- }
- }
-
- public bool RemoteDebugDisplayGui => _optionsPage.RemoteDebugDisplayGui;
- public string RemoteDeployBasePath => _optionsPage.RemoteDeployBasePath;
- public string RemoteDotNetPath => _optionsPage.RemoteDotNetPath;
- public string RemoteVsDbgBasePath => _optionsPage.RemoteVsDbgRootPath;
-
- public bool UseCommandLineArgs => _optionsPage.UseCommandLineArgs;
- //// public bool UsePublish => _optionsPage.Publish;
-
- public string UserGroupName => _optionsPage.UserGroupName;
- public string UserName => _optionsPage.UserName;
- public string UserPass => _optionsPage.UserPass;
- public bool UserPrivateKeyEnabled => _optionsPage.UserPrivateKeyEnabled;
- public string UserPrivateKeyPath => _optionsPage.UserPrivateKeyPath;
- public string UserPrivateKeyPassword => _optionsPage.UserPrivateKeyPassword;
-
- private OptionsPage _optionsPage => (OptionsPage)GetDialogPage(typeof(OptionsPage));
-
- #region Package Members
+ public OptionsPage VsixOptions => (OptionsPage)GetDialogPage(typeof(OptionsPage));
///
/// Initialization of the package; this method is called right after the package is sited, so this is the place
@@ -79,10 +47,8 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
await Commands.InitializeAsync(this);
- Logger.Init(this, OutputWindowType.Custom, LocalSwitchLinuxDbgOutput);
+ Logger.Init(this, OutputWindowType.Custom, VsixOptions.SwitchLinuxDbgOutput);
Logger.Output("InitializeAsync");
}
-
- #endregion Package Members
}
}
diff --git a/src/VsLinuxDebugger/OptionsPages/OptionsPage.Local.cs b/src/VsLinuxDebugger/OptionsPages/OptionsPage.Local.cs
index 2f1bc4f..2601409 100644
--- a/src/VsLinuxDebugger/OptionsPages/OptionsPage.Local.cs
+++ b/src/VsLinuxDebugger/OptionsPages/OptionsPage.Local.cs
@@ -1,11 +1,13 @@
using System.ComponentModel;
using Microsoft.VisualStudio.Shell;
+using VsLinuxDebugger;
namespace Xeno.VsLinuxDebug.OptionsPages
{
public partial class OptionsPage : DialogPage
{
private const string Local = "Local Settings";
+ private bool _autoSwitchLinuxDbgOutput = false;
//// [Category("Build Options")]
//// [DisplayName("Use Command Line Arguments")]
@@ -38,6 +40,14 @@ public partial class OptionsPage : DialogPage
[Category(Local)]
[DisplayName("Switch to LinuxDbg Output on Build")]
[Description("Automatically show output for Linux Debugger on build (default = false).")]
- public bool SwitchLinuxDbgOutput { get; set; } = false;
+ public bool SwitchLinuxDbgOutput
+ {
+ get => _autoSwitchLinuxDbgOutput;
+ set
+ {
+ Logger.AutoSwitchToLinuxDbgOutput = value;
+ _autoSwitchLinuxDbgOutput = value;
+ }
+ }
}
}
diff --git a/src/VsLinuxDebugger/VsLinuxDebugger.csproj b/src/VsLinuxDebugger/VsLinuxDebugger.csproj
index 075fc1c..f09925a 100644
--- a/src/VsLinuxDebugger/VsLinuxDebugger.csproj
+++ b/src/VsLinuxDebugger/VsLinuxDebugger.csproj
@@ -51,6 +51,7 @@
+
diff --git a/src/VsLinuxDebugger/source.extension.vsixmanifest b/src/VsLinuxDebugger/source.extension.vsixmanifest
index bdabd7a..df399de 100644
--- a/src/VsLinuxDebugger/source.extension.vsixmanifest
+++ b/src/VsLinuxDebugger/source.extension.vsixmanifest
@@ -4,16 +4,17 @@
xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
VS Linux Debugger
Remotely deploy and debug your .NET apps visa SSH on your Linux device using Visual Studio 2022. Works with popular Linux distrobutions such as Ubuntu, Raspberry Pi, and more!
https://github.com/SuessLabs/VsLinuxDebug
LICENSE.txt
+ ..\..\readme.md
..\..\release-notes.md
Resources\TuxDebug.png
- debug; build; remote debug; vsdbg; linux; xamarin; rpi4; remotedebug; linux debug; net6; dotnet; raspberry pi;
+ debug; build; remote debug; vsdbg; linux; xamarin; rpi; rpi4; remotedebug; remote; debugger; linux debug; net6; dotnet; raspberry pi; ubuntu;
true