Skip to content

Commit 46299d4

Browse files
committed
Outputs to "remotebase/projectName" folder
1 parent 2452654 commit 46299d4

7 files changed

Lines changed: 27 additions & 25 deletions

File tree

src/VsLinuxDebugger/Commands.Impl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ private UserOptions ToUserOptions()
126126

127127
RemoteDebugDisplayGui = Settings.RemoteDebugDisplayGui,
128128
RemoteDeployBasePath = Settings.RemoteDeployBasePath,
129-
RemoteDeployDebugPath = Settings.RemoteDeployDebugPath,
130-
RemoteDeployReleasePath = Settings.RemoteDeployReleasePath,
129+
////RemoteDeployDebugPath = Settings.RemoteDeployDebugPath,
130+
////RemoteDeployReleasePath = Settings.RemoteDeployReleasePath,
131131
RemoteDotNetPath = Settings.RemoteDotNetPath,
132132
RemoteVsDbgPath = Settings.RemoteVsDbgPath,
133133

src/VsLinuxDebugger/Core/LaunchBuilder.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ public LaunchBuilder(DTE2 dte, Project dteProject, UserOptions o)
2121

2222
AssemblyName = dteProject.Properties.Item("AssemblyName").Value.ToString();
2323
ProjectConfigName = dteProject.ConfigurationManager.ActiveConfiguration.ConfigurationName;
24-
ProjectFullName = dteProject.FullName;
24+
ProjectFileFullPath = dteProject.FullName;
2525
ProjectName = dteProject.Name;
26-
SolutionFullName = dte.Solution.FullName;
26+
SolutionFileFullPath = dte.Solution.FullName;
2727
SolutionDirPath = Path.GetDirectoryName(dte.Solution.FullName);
2828
OutputDirName = dteProject.ConfigurationManager.ActiveConfiguration.Properties.Item("OutputPath").Value.ToString();
29-
OutputDirFullName = Path.Combine(Path.GetDirectoryName(dteProject.FullName), OutputDirName);
29+
OutputDirFullPath = Path.Combine(Path.GetDirectoryName(dteProject.FullName), OutputDirName);
3030
}
3131

3232
public string AssemblyName { get; set; }
3333

3434
public string CommandLineArgs { get; set; } = string.Empty;
3535

36-
public string OutputDirFullName { get; set; }
36+
public string OutputDirFullPath { get; set; }
3737

3838
public string OutputDirName { get; set; }
3939

4040
public string ProjectConfigName { get; set; }
4141

42-
public string ProjectFullName { get; set; }
42+
public string ProjectFileFullPath { get; set; }
4343

4444
public string ProjectName { get; set; }
4545

4646
public string SolutionDirPath { get; set; }
4747

48-
public string SolutionFullName { get; set; }
48+
public string SolutionFileFullPath { get; set; }
4949

5050
/// <summary>Generates the project's `launch.json` file.</summary>
5151
/// <returns>Returns the local path to the file.</returns>

src/VsLinuxDebugger/Core/RemoteDebugger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public async Task<bool> BeginAsync(BuildOptions buildOptions)
8484

8585
if (buildOptions.HasFlag(BuildOptions.Debug))
8686
{
87-
BuildDebugAttacher();
87+
// BuildDebugAttacher();
8888
}
8989
}
9090

@@ -153,7 +153,7 @@ private void BuildBegin()
153153
////BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone;
154154

155155
dte.SuppressUI = false;
156-
dte.Solution.SolutionBuild.BuildProject(_launchBuilder.ProjectConfigName, _launchBuilder.ProjectFullName);
156+
dte.Solution.SolutionBuild.BuildProject(_launchBuilder.ProjectConfigName, _launchBuilder.ProjectFileFullPath);
157157
}
158158

159159
private void BuildCleanup()

src/VsLinuxDebugger/Core/SshTool.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public SshTool(UserOptions opts, LaunchBuilder launch)
2626
_launch = launch;
2727
}
2828

29+
public string RemoteDeployPath => $"{_opts.RemoteDeployBasePath}/{_launch.ProjectName}";
30+
2931
public string Bash(string command)
3032
{
3133
try
@@ -125,8 +127,8 @@ public void MakeDeploymentFolder()
125127
{
126128
// do we need SUDO?
127129
Bash($"mkdir -p {_opts.RemoteDeployBasePath}");
128-
Bash($"mkdir -p {_opts.RemoteDeployDebugPath}");
129-
Bash($"mkdir -p {_opts.RemoteDeployReleasePath}");
130+
//// Bash($"mkdir -p {_opts.RemoteDeployDebugPath}");
131+
//// Bash($"mkdir -p {_opts.RemoteDeployReleasePath}");
130132

131133
var group = string.IsNullOrEmpty(_opts.UserGroupName)
132134
? string.Empty
@@ -163,21 +165,21 @@ public async Task<string> UploadFilesAsync()
163165
{
164166
try
165167
{
166-
Bash($@"mkdir -p {_opts.RemoteDeployDebugPath}");
168+
Bash($@"mkdir -p {RemoteDeployPath}");
167169

168170
// TODO: Rev1 - Iterate through each file and upload it via SCP client or SFTP.
169171
// TODO: Rev2 - Compress _localHost.OutputDirFullName, upload ZIP, and unzip it.
170172
// TODO: Rev3 - Allow for both SFTP and SCP as a backup. This separating connection to a new disposable class.
171173
//// LogOutput($"Connected to {_connectionInfo.Username}@{_connectionInfo.Host}:{_connectionInfo.Port} via SSH and {(_sftpClient != null ? "SFTP" : "SCP")}");
172174

173-
var srcDirInfo = new DirectoryInfo(_launch.OutputDirFullName);
175+
var srcDirInfo = new DirectoryInfo(_launch.OutputDirFullPath);
174176
if (!srcDirInfo.Exists)
175-
throw new DirectoryNotFoundException($"Directory '{_launch.OutputDirFullName}' not found!");
177+
throw new DirectoryNotFoundException($"Directory '{_launch.OutputDirFullPath}' not found!");
176178

177179
// Compress files to upload as single `tar.gz`.
178180
// TODO: Use base folder path: var pathTarGz = $"{_opts.RemoteDeployBasePath}/{_tarGzFileName}";
179181

180-
var destTarGz = $"{_opts.RemoteDeployDebugPath}/{_tarGzFileName}";
182+
var destTarGz = $"{RemoteDeployPath}/{_tarGzFileName}";
181183
var success = PayloadCompressAndUpload(_sftp, srcDirInfo, destTarGz);
182184

183185
// Decompress file
@@ -374,7 +376,7 @@ private bool PayloadDecompress(string pathBuildTarGz, bool removeTarGz = true)
374376
try
375377
{
376378
var cmd = "set -e";
377-
cmd += $";cd \"{_opts.RemoteDeployDebugPath}\"";
379+
cmd += $";cd \"{RemoteDeployPath}\"";
378380
cmd += $";tar -zxf \"{_tarGzFileName}\"";
379381
////cmd += $";tar -zxf \"{pathBuildTarGz}\"";
380382

src/VsLinuxDebugger/Core/UserOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public class UserOptions
99
public string LocalPLinkPath { get; set; }
1010

1111
public bool RemoteDebugDisplayGui { get; set; }
12-
public string RemoteDeployBasePath { get; set; }
13-
public string RemoteDeployDebugPath { get; set; }
14-
public string RemoteDeployReleasePath { get; set; }
12+
public string RemoteDeployBasePath { get; set; } // TODO: Scrub trailing '/\' chars
13+
////public string RemoteDeployDebugPath { get; set; }
14+
////public string RemoteDeployReleasePath { get; set; }
1515
public string RemoteDotNetPath { get; set; }
1616
public string RemoteVsDbgPath { get; set; }
1717

src/VsLinuxDebugger/DebuggerPackage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public sealed partial class DebuggerPackage : AsyncPackage
3939

4040
public bool RemoteDebugDisplayGui => _optionsPage.RemoteDebugDisplayGui;
4141
public string RemoteDeployBasePath => _optionsPage.RemoteDeployBasePath;
42-
public string RemoteDeployDebugPath => $"{_optionsPage.RemoteDeployBasePath}/TMP";
43-
public string RemoteDeployReleasePath => $"{_optionsPage.RemoteDeployBasePath}/TMP";
42+
////public string RemoteDeployDebugPath => $"{_optionsPage.RemoteDeployBasePath}/TMP";
43+
////public string RemoteDeployReleasePath => $"{_optionsPage.RemoteDeployBasePath}/TMP";
4444
public string RemoteDotNetPath => _optionsPage.RemoteDotNetPath;
4545
public string RemoteVsDbgPath => _optionsPage.RemoteVsDbgPath;
4646

src/VsLinuxDebugger/DebuggerPackage.vsct

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@
8686
<Parent guid="GuidLinuxDebugerMenu" id="RemoteMainMenuGroupLevel1" />
8787
<CommandFlag>DynamicVisibility</CommandFlag>
8888
<CommandFlag>TextChanges</CommandFlag>
89-
<!--<CommandFlag>DefaultDisabled</CommandFlag>-->
89+
<CommandFlag>DefaultDisabled</CommandFlag>
9090
<Icon guid="DeployAndDebug_16x" id="imgDeployAndDebug" />
9191
<Strings>
9292
<ButtonText>Build, Deploy and Debug</ButtonText>
9393
</Strings>
9494
</Button>
9595

96-
<Button guid="GuidLinuxDebugerMenu" id="CmdDebugOnly" priority="0x0402" type="Button">
96+
<!--<Button guid="GuidLinuxDebugerMenu" id="CmdDebugOnly" priority="0x0402" type="Button">
9797
<Parent guid="GuidLinuxDebugerMenu" id="RemoteMainMenuGroupLevel1" />
9898
<CommandFlag>DynamicVisibility</CommandFlag>
9999
<CommandFlag>TextChanges</CommandFlag>
100100
<Icon guid="DebugOnly_16x" id="imgDebugOnly" />
101101
<Strings>
102102
<ButtonText>Debug only</ButtonText>
103103
</Strings>
104-
</Button>
104+
</Button>-->
105105

106106
<!--
107107
TODO: Publish & Publish and Debug

0 commit comments

Comments
 (0)