Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.3.4 #352

Merged
merged 4 commits into from
Sep 26, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Meadow.CLI
env:
CLI_RELEASE_VERSION: 1.3.0.0
IDE_TOOLS_RELEASE_VERSION: 1.3.0
MEADOW_OS_VERSION: 1.3.0.0
CLI_RELEASE_VERSION: 1.3.4.0
IDE_TOOLS_RELEASE_VERSION: 1.3.4
MEADOW_OS_VERSION: 1.3.4.0
VS_MAC_2019_VERSION: 8.10
VS_MAC_2022_VERSION: 17.5

Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI.Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Meadow.CLI.Core
{
public static class Constants
{
public const string CLI_VERSION = "1.3.0.0";
public const string CLI_VERSION = "1.3.4.0";
public const ushort HCOM_PROTOCOL_PREVIOUS_VERSION_NUMBER = 0x0006;
public const ushort HCOM_PROTOCOL_CURRENT_VERSION_NUMBER = 0x0007; // Used for transmission
public const string WILDERNESS_LABS_USB_VID = "2E6A";
Expand Down
40 changes: 20 additions & 20 deletions Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
await SendTheEntireFile(command, true, cancellationToken);
}

public async Task WriteFileToEspFlash(string fileName,

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / Build and Optionally Publish Meadow.CLI nuget

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / Build and Optionally Publish Meadow.CLI nuget

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / Build Mac 2022 Extension

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / Build Mac 2019 Extension

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / Build VSCode Extension

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / Build Win 2019 Extension

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / Build Win 2022 Extension

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).
uint partition = 0,
string? mcuDestAddress = null,
CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -577,40 +577,40 @@
return;
}

await DeleteTemporaryFiles(cancellationToken);

var fi = new FileInfo(applicationFilePath);
var directoryName = fi.DirectoryName ?? string.Empty;
var meadowDll = Path.Combine(directoryName, "Meadow.dll");

if (!File.Exists(meadowDll))
{
Logger.LogError($"{meadowDll} not found.");
return;
}

var fileName = fi.Name;
var fileNamePdb = Path.Combine(directoryName, "App.pdb");

await DeleteTemporaryFiles(cancellationToken);

var deviceFiles = await GetFilesAndCrcs(
DefaultTimeout,
cancellationToken: cancellationToken);

//rename App.dll to App.exe
var fileNameDll = Path.Combine(fi.DirectoryName, "App.dll");
var fileNameExe = Path.Combine(fi.DirectoryName, "App.exe");
var fileNamePdb = Path.Combine(fi.DirectoryName, "App.pdb");

if (File.Exists(fileNameDll))
{
if (File.Exists(fileNameExe))
{
File.Delete(fileNameExe);
}
File.Copy(fileNameDll, fileNameExe);
}

foreach (var f in deviceFiles)
{
Logger.LogInformation($"Found {f.FileName} (CRC: {f.Crc})" + Environment.NewLine);
}

var binaries = Directory.EnumerateFiles(fi.DirectoryName, "*.*", SearchOption.TopDirectoryOnly)
var binaries = Directory.EnumerateFiles(directoryName, "*.*", SearchOption.TopDirectoryOnly)
.Where(s => new FileInfo(s).Extension != ".dll")
.Where(s => new FileInfo(s).Extension != ".pdb");
// .Where(s => extensions.Contains(new FileInfo(s).Extension));

var files = new Dictionary<string, uint>();

// Add the App.dll
await AddFile(Path.Combine(directoryName, fileName), false);

if (includePdbs)
{
await AddFile(fileNamePdb, false);
Expand Down Expand Up @@ -647,12 +647,12 @@
}
}

var dependencies = AssemblyManager.GetDependencies(fi.Name, fi.DirectoryName, osVersion)
var dependencies = AssemblyManager.GetDependencies(fileName, directoryName, osVersion)
.Where(x => x.Contains("App.") == false)
// .Where(x => dllLinkIngoreList.Any(f => x.Contains(f)) == false)
.ToList();

var trimmedDependencies = await AssemblyManager.TrimDependencies(fi.Name, fi.DirectoryName, dependencies, noLink, Logger, includePdbs: includePdbs, verbose: verbose);
var trimmedDependencies = await AssemblyManager.TrimDependencies(fileName, directoryName, dependencies, noLink, Logger, includePdbs: includePdbs, verbose: verbose);

//add local files (this includes App.exe)
foreach (var file in binaries)
Expand Down Expand Up @@ -760,7 +760,7 @@
}
else
{
Logger.LogInformation($"{Environment.NewLine}{fi.Name} deploy complete!{Environment.NewLine}");
Logger.LogInformation($"{Environment.NewLine}{fileName} deploy complete!{Environment.NewLine}");
}
}
catch (Exception ex)
Expand Down
15 changes: 7 additions & 8 deletions Meadow.CLI.Core/Internals/Dfu/DfuUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ public static async Task<bool> FlashFile(string fileName, IUsbDevice? device = n

LastSerialNumber = GetDeviceSerial(device);

var dfuUtilVersion = GetDfuUtilVersion();
var dfuUtilVersion = new System.Version(GetDfuUtilVersion());
logger.LogDebug("Detected OS: {os}", RuntimeInformation.OSDescription);

if (string.IsNullOrEmpty(dfuUtilVersion))
if (dfuUtilVersion == null)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Expand All @@ -236,24 +236,23 @@ public static async Task<bool> FlashFile(string fileName, IUsbDevice? device = n
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
logger.LogError("dfu-util not found - install using package manager, for example: `apt install dfu-util`");
logger.LogError("dfu-util not found - install using package manager, for example: `apt install dfu-util` or the equivalent for your Linux distribution");
}
return false;
}
else if (dfuUtilVersion != "0.10")
else if (dfuUtilVersion.CompareTo(new System.Version("0.11")) < 0)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
logger.LogError("dfu-util update required. To install, run in administrator mode: meadow install dfu-util");
logger.LogError("dfu-util update required. To update, run in administrator mode: `meadow install dfu-util`");
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
logger.LogError("dfu-util update required. To install, run: brew upgrade dfu-util");
logger.LogError("dfu-util update required. To update, run: `brew upgrade dfu-util`");
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
if (dfuUtilVersion != "0.9")
return false;
logger.LogError("dfu-util update required. To update , run: `apt upgrade dfu-util` or the equivalent for your Linux distribution");
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI.Core/Managers/DownloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public async Task InstallDfuUtil(bool is64Bit = true,

Directory.CreateDirectory(WildernessLabsTemp);

const string downloadUrl = "https://s3-us-west-2.amazonaws.com/downloads.wildernesslabs.co/public/dfu-util-0.10-binaries.zip";
const string downloadUrl = "https://s3-us-west-2.amazonaws.com/downloads.wildernesslabs.co/public/dfu-util-0.11-binaries.zip";

var downloadFileName = downloadUrl.Substring(downloadUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
var response = await Client.GetAsync(downloadUrl, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI.Core/Meadow.CLI.Core.6.0.0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.3.0.0</Version>
<Version>1.3.4.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI.Core/Meadow.CLI.Core.Classic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.3.0.0</Version>
<Version>1.3.4.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.3.0.0</Version>
<Version>1.3.4.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI.Core/Meadow.CLI.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.3.0.0</Version>
<Version>1.3.4.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI/Meadow.CLI.Classic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Peter Moody, Adrian Stevens, Brian Kim, Pete Garafano, Dominique Louis</Authors>
<Company>Wilderness Labs, Inc</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>1.3.0.0</PackageVersion>
<PackageVersion>1.3.4.0</PackageVersion>
<Platforms>AnyCPU</Platforms>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
Expand Down
2 changes: 1 addition & 1 deletion Meadow.CLI/Meadow.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Peter Moody, Adrian Stevens, Brian Kim, Pete Garafano, Dominique Louis</Authors>
<Company>Wilderness Labs, Inc</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>1.3.0.0</PackageVersion>
<PackageVersion>1.3.4.0</PackageVersion>
<Platforms>AnyCPU</Platforms>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
Expand Down
9 changes: 2 additions & 7 deletions Meadow.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@ public static async Task<int> Main(string[] args)
.Build();

var logLevel = LogEventLevel.Information;
var logModifier = args.FirstOrDefault(a => a.Equals("-m"))
?.Count(x => x == 'm') ?? 0;

logLevel -= logModifier;
if (logLevel < 0)
{
logLevel = 0;
}
if (args.Contains("--verbose"))
logLevel = LogEventLevel.Verbose;

var outputTemplate = logLevel == LogEventLevel.Verbose
? "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}"
Expand Down
Loading