Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RaspberryDebugger/Commands/SettingsCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// FILE: SettingsCommand.cs
// CONTRIBUTOR: Jeff Lill
// COPYRIGHT: Copyright (c) 2021 by neonFORGE, LLC. All rights reserved.
Expand Down Expand Up @@ -69,7 +69,7 @@ private SettingsCommand(AsyncPackage package, OleMenuCommandService commandServi
{
var command = (OleMenuCommand)s;

command.Visible = PackageHelper.IsActiveProjectRaspberryCompatible(dte);
command.Visible = PackageHelper.IsActiveProjectRaspberryExecutable(dte);
};

commandService?.AddCommand(menuItem);
Expand Down
35 changes: 17 additions & 18 deletions RaspberryDebugger/DebugHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal static class DebugHelper
/// <summary>
/// Track the last output file that was uploaded.
/// </summary>
private static DirectoryInfo LastUploadedDirInfo { get; set; }
private static DirectoryInfo LastUploadedPublishDirInfo { get; set; }

/// <summary>
/// Ensures that the native Windows OpenSSH client is installed, prompting
Expand Down Expand Up @@ -302,7 +302,7 @@ private static async Task<bool> BuildProjectAsync(DTE2 dte, Solution solution, P
}

// Build the project to ensure that there are no compile-time errors.
Log.Info($"Build Started: {projectProperties?.FullPath}, Configuration: {projectProperties.Configuration}");
Log.Info($"Build Started: {project.FullName}, Configuration: {projectProperties.ConfigurationName}, Platform: {projectProperties.PlatformName}");

solution?.SolutionBuild.BuildProject(
solution.SolutionBuild.ActiveConfiguration.Name, project?.UniqueName, WaitForBuildToFinish: true);
Expand Down Expand Up @@ -338,7 +338,7 @@ private static async Task<bool> PublishProjectAsync(DTE2 dte, Solution solution,
// these can cause conflicts when we invoke [dotnet] below to
// publish the project.

Log.Info($"Publishing Started: {projectProperties?.FullPath}, Runtime: {projectProperties.Runtime}");
Log.Info($"Publishing Started: {project?.FullName}, RuntimeIdentifier: {projectProperties.RuntimeIdentifier}");

const string allowedVariableNames =
"""
Expand Down Expand Up @@ -413,24 +413,24 @@ private static async Task<bool> PublishProjectAsync(DTE2 dte, Solution solution,
var options = new List<object>()
{
"publish",
"--configuration", projectProperties.Configuration
"--configuration", projectProperties.ConfigurationName
};

if ( (bool)( projectProperties?.Framework.HasValue ) )
if ( (bool)( projectProperties?.TargetFramework.HasValue ) )
{
options.AddRange(
[
"--framework", projectProperties.Framework == DotNetFrameworks.DotNet_8
"--framework", projectProperties.TargetFramework == DotNetFrameworks.DotNet_8
? "net8.0"
: "net9.0", // short term hack
]);
}

options.AddRange( [
"--runtime", projectProperties.Runtime,
"--runtime", projectProperties.RuntimeIdentifier,
"--no-self-contained",
"--output", projectProperties.PublishFolder,
projectProperties.FullPath
project?.FullName
] );

Log.Info("dotnet Command:");
Expand Down Expand Up @@ -616,31 +616,30 @@ public static ConnectionInfo GetDebugConnectionInfo(ProjectProperties projectPro
return null;
}

var dirInfo = new DirectoryInfo(projectProperties.OutputFolder);
// look at the Build output and see if it's changed.
var dirInfo = new DirectoryInfo(projectProperties.PublishFolder);

bool shouldUploadProgram =
LastUploadedDirInfo == null ||
LastUploadedDirInfo.FullName != dirInfo.FullName ||
LastUploadedDirInfo.LastWriteTime != dirInfo.LastWriteTime;

var outputFileName = Path.Combine( projectProperties.OutputFolder, projectProperties.OutputFileName );

LastUploadedPublishDirInfo == null ||
LastUploadedPublishDirInfo.FullName != dirInfo.FullName ||
LastUploadedPublishDirInfo.LastWriteTime != dirInfo.LastWriteTime;

if (!shouldUploadProgram)
{
Log.Info($"Skipping upload of {outputFileName}, {dirInfo.LastWriteTime}");
Log.Info($"Skipping upload of {projectProperties.PublishFolder}, {dirInfo.LastWriteTime}");

return connection;
}

Log.Info($"Uploading {outputFileName}, {dirInfo.LastWriteTime}");
Log.Info($"Uploading {projectProperties.PublishFolder}, {dirInfo.LastWriteTime}");

// Upload the program binaries.
if (await connection.UploadProgramAsync(
projectProperties?.Name,
projectProperties?.AssemblyName,
projectProperties?.PublishFolder))
{
LastUploadedDirInfo = dirInfo;
LastUploadedPublishDirInfo = dirInfo;

return connection;
}
Expand Down
Loading