Skip to content

Commit

Permalink
Messed up by only looking for csproj. Now as long as it has a Meadow …
Browse files Browse the repository at this point in the history
…SDK tag, we'll try to deploy it.
  • Loading branch information
CartBlanche committed Jan 23, 2024
1 parent bba96a7 commit 960e1fe
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions VS_Meadow_Extension/VS_Meadow_Extension.Shared/DeployProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,23 @@ public DeployProvider(ConfiguredProject configuredProject)

public async Task<bool> DeployMeadowProjectsAsync(CancellationToken cts, TextWriter outputPaneWriter)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

var dte = Package.GetGlobalService(typeof(DTE)) as DTE;
if (dte == null)
{
return false;
}

var solution = dte.Solution;
var startupProjects = solution.SolutionBuild.StartupProjects;
if (startupProjects == null)
if (cts.IsCancellationRequested)
{
return false;
}

MeadowPackage.DebugOrDeployInProgress = false;

foreach (string filename in (Array)startupProjects)
{
if (cts.IsCancellationRequested)
{
return false;
}
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

if (!filename.EndsWith(".csproj"))
{
continue;
}
var filename = this.configuredProject.UnconfiguredProject.FullPath;

var csprojContent = File.ReadAllText(filename);
if (csprojContent.Contains(MeadowSDKVersion))
{
await DeployOutputLogger?.ConnectTextWriter(outputPaneWriter);
var projFileContent = File.ReadAllText(filename);
if (projFileContent.Contains(MeadowSDKVersion))
{
await DeployOutputLogger?.ConnectTextWriter(outputPaneWriter);

return await DeployMeadowAppAsync(cts, outputPaneWriter, filename);
}
return await DeployMeadowAppAsync(cts, outputPaneWriter, filename);
}

return false;
Expand Down

0 comments on commit 960e1fe

Please sign in to comment.