diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 39a868fb..cf901f5f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,8 +1,8 @@ name: Meadow.CLI env: - TOOLS_RELEASE_VERSION: 1.0.4.0 - SHORT_TOOLS_RELEASE_VERSION: 1.0.4 - MEADOW_OS_VERSION: 1.0.2.0 + TOOLS_RELEASE_VERSION: 1.1.0.0 + SHORT_TOOLS_RELEASE_VERSION: 1.1.0 + MEADOW_OS_VERSION: 1.1.0.0 VS_MAC_2019_VERSION: 8.10 VS_MAC_2022_VERSION: 17.5 @@ -72,12 +72,12 @@ jobs: uses: actions/upload-artifact@v2 with: name: Meadow.CLI.nuget.${{ ENV.TOOLS_RELEASE_VERSION }} - path: 'main\**\Meadow.CLI\bin\Release\*.nupkg' + path: 'main\Meadow.CLI\bin\Release\*.nupkg' - if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }} name: Publish Meadow.CLI Nuget publically run: | - nuget push main\**\Meadow.CLI\bin\Release\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} + nuget push main\Meadow.CLI\bin\Release\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} build-vswin-2019: runs-on: windows-2019 @@ -326,7 +326,7 @@ jobs: # - if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }} #- name: Upload Release Asset - # uses: actions/upload-release-asset@v1.0.4 + # uses: actions/upload-release-asset@v1.1.0 # env: # GITHUB_TOKEN: ${{ secrets.MEADOW_MAC_TOKEN }} # with: @@ -434,7 +434,7 @@ jobs: # - if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }} #- name: Upload Release Asset - # uses: actions/upload-release-asset@v1.0.4 + # uses: actions/upload-release-asset@v1.1.0 # env: # GITHUB_TOKEN: ${{ secrets.MEADOW_MAC_TOKEN }} # with: diff --git a/Meadow.CLI.Core/Constants.cs b/Meadow.CLI.Core/Constants.cs index aad2ff3e..41528b5e 100644 --- a/Meadow.CLI.Core/Constants.cs +++ b/Meadow.CLI.Core/Constants.cs @@ -7,7 +7,7 @@ namespace Meadow.CLI.Core { public static class Constants { - public const string CLI_VERSION = "1.0.4.0"; + public const string CLI_VERSION = "1.1.0.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"; diff --git a/Meadow.CLI.Core/DeviceManagement/MeadowDeviceManager.cs b/Meadow.CLI.Core/DeviceManagement/MeadowDeviceManager.cs index 029b6497..9e4eb1ff 100644 --- a/Meadow.CLI.Core/DeviceManagement/MeadowDeviceManager.cs +++ b/Meadow.CLI.Core/DeviceManagement/MeadowDeviceManager.cs @@ -293,17 +293,16 @@ public async static Task> GetMeadowSerialPortsForLinux(ILogger? lo }; using var proc = Process.Start(psi); - proc.WaitForExit(1000); - var output = proc.StandardOutput.ReadToEnd(); + _ = proc?.WaitForExit(1000); + var output = proc?.StandardOutput.ReadToEnd(); return output.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) .Where(x => x.Contains("Wilderness_Labs")) .Select( line => { - var parts = line.Split(' '); - var source = parts[8]; - var target = parts[10]; + var parts = line.Split(new[] { "-> " }, StringSplitOptions.RemoveEmptyEntries); + var target = parts[1]; var port = Path.GetFullPath(Path.Combine(devicePath, target)); return port; }).ToArray(); diff --git a/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs b/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs index 75e16750..effa7455 100644 --- a/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs +++ b/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs @@ -10,13 +10,14 @@ using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; +using YamlDotNet.Serialization; namespace Meadow.CLI.Core.Devices { public abstract partial class MeadowLocalDevice { - string[] dllLinkIngoreList = { "System.Threading.Tasks.Extensions.dll" };//, "Microsoft.Extensions.Primitives.dll" }; - string[] pdbLinkIngoreList = { "System.Threading.Tasks.Extensions.pdb" };//, "Microsoft.Extensions.Primitives.pdb" }; + private string[] dllLinkIngoreList = { "System.Threading.Tasks.Extensions.dll" };//, "Microsoft.Extensions.Primitives.dll" }; + private string[] pdbLinkIngoreList = { "System.Threading.Tasks.Extensions.pdb" };//, "Microsoft.Extensions.Primitives.pdb" }; public async Task> GetFilesAndFolders( TimeSpan timeout, @@ -470,7 +471,7 @@ public Task ForwardVisualStudioDataToMono(byte[] debuggerData, //ToDo this is super fragile (extra-super fragile!) //Need updated API to read files after B5.1 - async Task DeleteTemporaryFiles(CancellationToken cancellationToken = default) + private async Task DeleteTemporaryFiles(CancellationToken cancellationToken = default) { var items = await GetFilesAndFolders(new TimeSpan(0, 0, 15), cancellationToken); @@ -523,6 +524,17 @@ async Task DeleteTemporaryFiles(CancellationToken cancellationToken = default) } } + private record BuildOptions + { + public DeployOptions Deploy { get; set; } + + public record DeployOptions + { + public List NoLink { get; set; } + public bool? IncludePDBs { get; set; } + } + } + public async Task DeployApp(string applicationFilePath, string osVersion, bool includePdbs = false, @@ -530,6 +542,33 @@ public async Task DeployApp(string applicationFilePath, IList? noLink = null, CancellationToken cancellationToken = default) { + try + { + // does a meadow.build.yml file exist? + var buildOptionsFile = Path.Combine(Path.GetDirectoryName(applicationFilePath), "app.build.yaml"); + if (File.Exists(buildOptionsFile)) + { + var yaml = File.ReadAllText(buildOptionsFile); + var deserializer = new DeserializerBuilder() + .IgnoreUnmatchedProperties() + .Build(); + var opts = deserializer.Deserialize(yaml); + + if (opts.Deploy.NoLink != null && opts.Deploy.NoLink.Count > 0) + { + noLink = opts.Deploy.NoLink; + } + if (opts.Deploy.IncludePDBs != null) + { + includePdbs = opts.Deploy.IncludePDBs.Value; + } + } + } + catch (Exception ex) + { + Logger.LogInformation($"Failed to read app.build.yaml: {ex.Message}"); + } + try { if (!File.Exists(applicationFilePath)) @@ -661,7 +700,7 @@ async Task AddFile(string file, bool includePdbs) { found = true; } - if(found) { break; } + if (found) { break; } } if (found == false) { diff --git a/Meadow.CLI.Core/Meadow.CLI.Core.6.0.0.csproj b/Meadow.CLI.Core/Meadow.CLI.Core.6.0.0.csproj index 7f805e96..a8d7488f 100644 --- a/Meadow.CLI.Core/Meadow.CLI.Core.6.0.0.csproj +++ b/Meadow.CLI.Core/Meadow.CLI.Core.6.0.0.csproj @@ -11,7 +11,7 @@ preview enable True - 1.0.4.0 + 1.1.0.0 @@ -56,6 +56,7 @@ all + diff --git a/Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj b/Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj index 04f68621..0efdc30f 100644 --- a/Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj +++ b/Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj @@ -11,7 +11,7 @@ preview enable True - 1.0.4.0 + 1.1.0.0 @@ -59,6 +59,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + diff --git a/Meadow.CLI.Core/Meadow.CLI.Core.csproj b/Meadow.CLI.Core/Meadow.CLI.Core.csproj index 07f99348..ec39d8ae 100644 --- a/Meadow.CLI.Core/Meadow.CLI.Core.csproj +++ b/Meadow.CLI.Core/Meadow.CLI.Core.csproj @@ -11,7 +11,7 @@ preview enable True - 1.0.4.0 + 1.1.0.0 @@ -54,6 +54,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + diff --git a/Meadow.CLI/Meadow.CLI.csproj b/Meadow.CLI/Meadow.CLI.csproj index 9bfbc004..6b80b3d5 100644 --- a/Meadow.CLI/Meadow.CLI.csproj +++ b/Meadow.CLI/Meadow.CLI.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net6.0 true Wilderness Labs, Inc meadow @@ -10,7 +10,7 @@ Peter Moody, Adrian Stevens, Brian Kim, Pete Garafano, Dominique Louis Wilderness Labs, Inc true - 1.0.4.0 + 1.1.0.0 AnyCPU http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/ icon.png