Skip to content

Commit

Permalink
Merge pull request #561 from WildernessLabs/vs2022_extension_prep
Browse files Browse the repository at this point in the history
Updates to support VS2022 extension
  • Loading branch information
ctacke authored May 6, 2024
2 parents e8501b1 + abf9bc2 commit e36076c
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Commands/Current/BaseDeviceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private async Task<IMeadowConnection> GetConnection(string? route, bool forceRec
}
catch (TimeoutException)
{
throw new CommandException("Timeout attempting to attach to device on {connection?.Name}", CommandExitCode.ConnectionNotFound);
throw new CommandException($"Timeout attempting to attach to device on {connection?.Name}", CommandExitCode.ConnectionNotFound);
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Meadow.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Wilderness Labs, Inc</Authors>
<Company>Wilderness Labs, Inc</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>2.0.39.0</PackageVersion>
<PackageVersion>2.0.40.0</PackageVersion>
<Platforms>AnyCPU</Platforms>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.CLI/</PackageProjectUrl>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.CLI</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace Meadow.CLI;

public static class Constants
{
public const string CLI_VERSION = "2.0.39.0";
public const string CLI_VERSION = "2.0.40.0";
}
5 changes: 5 additions & 0 deletions Source/v2/Meadow.Cloud.Client/Meadow.Cloud.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<LangVersion>10</LangVersion>
</PropertyGroup>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\MeadowCLIKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CredentialManagement.Standard" Version="1.0.4" />
<PackageReference Include="IdentityModel.OidcClient" Version="3.1.2" />
Expand Down
7 changes: 6 additions & 1 deletion Source/v2/Meadow.Hcom/AssemblyAttributes.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Meadow.HCom.Integration.Tests")]
[assembly: InternalsVisibleTo("Meadow.HCom.Integration.Tests,PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100792a27a41cf42a" +
"09ac6bb433f2602ac886175eed60cc74ae70adbdc8237b510ae474981420f1d0395ad58cfd459b" +
"6c6ecbe28ec7234761cfe5acadcf7b76e273b25a3547826e16658a474a8e34ec297778130a1781" +
"95a2034e7b1ec591177ce1e87160682d5f8b49d3c63a92aafa9c7f7f5b06763d7a19d96b781099" +
"a39e35d1")]
17 changes: 5 additions & 12 deletions Source/v2/Meadow.Hcom/Connections/SerialConnection.ListenerProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private async Task ListenerProc()

if (_reconnectInProgress)
{
_state = ConnectionState.MeadowAttached;
Open();
_reconnectInProgress = false;
}
else if (_textListComplete != null)
Expand All @@ -213,18 +213,11 @@ private async Task ListenerProc()
else if (response is ReconnectRequiredResponse rrr)
{
// the device is going to restart - we need to wait for a HCOM_HOST_REQUEST_TEXT_CONCLUDED to know it's back
_state = ConnectionState.Disconnected;
_reconnectInProgress = true;
Close();

if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
if (_port.IsOpen)
{
_port.Close();
Thread.Sleep(2000);
_port.Open();
}
}
await Task.Delay(3000);

Open();
}
else if (response is FileReadInitOkResponse fri)
{
Expand Down
3 changes: 1 addition & 2 deletions Source/v2/Meadow.Hcom/Connections/SerialConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,7 @@ public override async Task<DebuggingServer> StartDebuggingSession(int port, ILog
logger?.LogDebug($"Start Debugging on port: {port}");
await Device.StartDebugging(port, logger, cancellationToken);

/* TODO logger?.LogDebug("Reinitialize the device");
await ReInitializeMeadow(cancellationToken); */
await WaitForMeadowAttach(cancellationToken);

var endpoint = new IPEndPoint(IPAddress.Loopback, port);
var debuggingServer = new DebuggingServer(this, Device, endpoint, logger);
Expand Down
16 changes: 14 additions & 2 deletions Source/v2/Meadow.Hcom/Debugging/DebuggingServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Buffers;
using Microsoft.Extensions.Logging;
using System.Buffers;
using System.Collections.Concurrent;
using System.Net;
using System.Net.Sockets;
Expand Down Expand Up @@ -192,7 +193,13 @@ internal ActiveClient(IMeadowConnection connection, TcpClient tcpClient, ILogger
_receiveVsDebugDataTask = Task.Factory.StartNew(SendToMeadowAsync, TaskCreationOptions.LongRunning);
_receiveMeadowDebugDataTask = Task.Factory.StartNew(SendToVisualStudio, TaskCreationOptions.LongRunning);

_connection.DebuggerMessageReceived += (s, e) => _debuggerMessages.Add(e);
_connection.DebuggerMessageReceived += MeadowConnection_DebuggerMessageReceived;
}

private void MeadowConnection_DebuggerMessageReceived(object sender, byte[] e)
{
_logger?.LogDebug("Debugger Message Received, Adding to collection");
_debuggerMessages.Add(e);
}

private const int RECEIVE_BUFFER_SIZE = 256;
Expand Down Expand Up @@ -330,6 +337,11 @@ public void Dispose()
_tcpClient.Dispose();
_networkStream.Dispose();
_cts.Dispose();

if (_connection != null)
{
_connection.DebuggerMessageReceived -= MeadowConnection_DebuggerMessageReceived;
}
Disposed = true;
}
}
Expand Down
5 changes: 5 additions & 0 deletions Source/v2/Meadow.Hcom/Meadow.HCom.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<LangVersion>10</LangVersion>
</PropertyGroup>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\MeadowCLIKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\..\..\Meadow.Contracts\Source\Meadow.Contracts\CircularBuffer.cs" Link="CircularBuffer.cs" />
</ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions Source/v2/Meadow.Linker/Meadow.Linker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<LangVersion>10</LangVersion>
</PropertyGroup>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\MeadowCLIKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.5" />
Expand Down
15 changes: 13 additions & 2 deletions Source/v2/Meadow.SoftwareManager/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Unit.Tests")]
[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Integration.Tests")]
[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Unit.Tests,PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100792a27a41cf42a" +
"09ac6bb433f2602ac886175eed60cc74ae70adbdc8237b510ae474981420f1d0395ad58cfd459b" +
"6c6ecbe28ec7234761cfe5acadcf7b76e273b25a3547826e16658a474a8e34ec297778130a1781" +
"95a2034e7b1ec591177ce1e87160682d5f8b49d3c63a92aafa9c7f7f5b06763d7a19d96b781099" +
"a39e35d1")]

[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Integration.Tests,PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100792a27a41cf42a" +
"09ac6bb433f2602ac886175eed60cc74ae70adbdc8237b510ae474981420f1d0395ad58cfd459b" +
"6c6ecbe28ec7234761cfe5acadcf7b76e273b25a3547826e16658a474a8e34ec297778130a1781" +
"95a2034e7b1ec591177ce1e87160682d5f8b49d3c63a92aafa9c7f7f5b06763d7a19d96b781099" +
"a39e35d1")]
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal F7FirmwarePackageCollection(IMeadowCloudClient meadowCloudClient)
{
}

internal F7FirmwarePackageCollection(string rootPath, IMeadowCloudClient meadowCloudClient)
public F7FirmwarePackageCollection(string rootPath, IMeadowCloudClient meadowCloudClient)
{
_downloadManager = new F7FirmwareDownloadManager(meadowCloudClient);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<LangVersion>10</LangVersion>
</PropertyGroup>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\MeadowCLIKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Net.Http.Json" Version="7.0.1" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
Expand Down
9 changes: 8 additions & 1 deletion Source/v2/Meadow.Tooling.Core/App/AppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ public static async Task DeployApplication(
static string GetRelativePath(string relativeTo, string path)
{
// Determine the difference
var relativePath = path.Substring(relativeTo.Length + 1);
var relativePath = path.Substring(relativeTo.Length);
//remove leading slash
if (relativePath.StartsWith(Path.DirectorySeparatorChar.ToString()) ||
relativePath.StartsWith("/") ||
relativePath.StartsWith("\\"))
{
relativePath = relativePath.Substring(1);
}
return relativePath;
}
}
5 changes: 5 additions & 0 deletions Source/v2/Meadow.Tooling.Core/Meadow.Tooling.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<LangVersion>10</LangVersion>
</PropertyGroup>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\MeadowCLIKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Glob" Version="1.1.9" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.22.0" />
Expand Down
Binary file added Source/v2/MeadowCLIKey.snk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\MeadowCLIKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\MeadowCLIKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="8.1.0" />
<PackageReference Include="FakeItEasy.Analyzer.CSharp" Version="6.1.1">
Expand Down

0 comments on commit e36076c

Please sign in to comment.