From b595208830d4e956bac5fc24832b65e4eb9ca9a8 Mon Sep 17 00:00:00 2001 From: Herwin Date: Mon, 24 Oct 2022 20:08:14 +0200 Subject: [PATCH] Initial Commit Update .drone.yml, .gitignore, and 12 more files... --- .drone.yml | 18 ++ .gitignore | 13 ++ ComPortWatcher.sln | 22 +++ .../ErrorCodes.cs | 20 ++ ...NibblePoker.Application.ListComPort.csproj | 33 ++++ .../Program.cs | 183 ++++++++++++++++++ .../ComPortHelper.cs | 73 +++++++ .../ComPortInfo.cs | 18 ++ .../NibblePoker.Library.ComPortHelpers.csproj | 15 ++ .../SortingOrder.cs | 7 + build.bat | 39 ++++ build.sh | 26 +++ lscom-v2-text-01.ico | Bin 0 -> 4185 bytes readme.md | 0 14 files changed, 467 insertions(+) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 ComPortWatcher.sln create mode 100644 NibblePoker.Application.ListComPort/ErrorCodes.cs create mode 100644 NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj create mode 100644 NibblePoker.Application.ListComPort/Program.cs create mode 100644 NibblePoker.Library.ComPortHelpers/ComPortHelper.cs create mode 100644 NibblePoker.Library.ComPortHelpers/ComPortInfo.cs create mode 100644 NibblePoker.Library.ComPortHelpers/NibblePoker.Library.ComPortHelpers.csproj create mode 100644 NibblePoker.Library.ComPortHelpers/SortingOrder.cs create mode 100644 build.bat create mode 100644 build.sh create mode 100644 lscom-v2-text-01.ico create mode 100644 readme.md diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e6e8d38 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,18 @@ +# Documentation: +# * https://docs.drone.io/quickstart/docker/ +# * https://docs.drone.io/pipeline/docker/examples/languages/csharp/ +# * https://discourse.drone.io/t/builds-are-stuck-in-pending-status/4437 + +kind: pipeline +type: docker +name: default + +platform: + os: linux + arch: arm64 + +steps: + - name: test + image: mcr.microsoft.com/dotnet/sdk:6.0-alpine + commands: + - dotnet build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0b8c6e --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +.idea/ +Builds/ +Trash/ + +bin/ +obj/ + +*.exe +*.pbd +*.so +*.zip + +notes.txt diff --git a/ComPortWatcher.sln b/ComPortWatcher.sln new file mode 100644 index 0000000..a8ee3ef --- /dev/null +++ b/ComPortWatcher.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NibblePoker.Library.ComPortHelpers", "NibblePoker.Library.ComPortHelpers\NibblePoker.Library.ComPortHelpers.csproj", "{2E9CEFC2-66A8-4A03-84FB-C28F752F522C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NibblePoker.Application.ListComPort", "NibblePoker.Application.ListComPort\NibblePoker.Application.ListComPort.csproj", "{0E6E464E-8497-4752-8281-24A64E5E8A9D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E9CEFC2-66A8-4A03-84FB-C28F752F522C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E9CEFC2-66A8-4A03-84FB-C28F752F522C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E9CEFC2-66A8-4A03-84FB-C28F752F522C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E9CEFC2-66A8-4A03-84FB-C28F752F522C}.Release|Any CPU.Build.0 = Release|Any CPU + {0E6E464E-8497-4752-8281-24A64E5E8A9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E6E464E-8497-4752-8281-24A64E5E8A9D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E6E464E-8497-4752-8281-24A64E5E8A9D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E6E464E-8497-4752-8281-24A64E5E8A9D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/NibblePoker.Application.ListComPort/ErrorCodes.cs b/NibblePoker.Application.ListComPort/ErrorCodes.cs new file mode 100644 index 0000000..cc95726 --- /dev/null +++ b/NibblePoker.Application.ListComPort/ErrorCodes.cs @@ -0,0 +1,20 @@ +namespace NibblePoker.Application.ListComPort; + +public static class ErrorCodes { + public const int NoError = 0; + + /* Fatal errors (1-9) */ + // Not needed in C# + + /* Internal argument parser errors (10-19) */ + public const int ArgumentParsingFailure = 10; + // ArgumentDefinitionFailure = 11 => Cannot happen due to the way options are declared. (Caught in development) + // ArgumentInitFailure = 12 => Cannot happen with "NibblePoker.Library.Arguments". + + /* External argument errors (20-29) */ + public const int NoPaddingValue = 20; + + /* Application & System errors (30-39) */ + // NoFriendlyNames = 30 => Causes problems with broad-range exit code checks. + public const int NoComPorts = 31; +} \ No newline at end of file diff --git a/NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj b/NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj new file mode 100644 index 0000000..7b5a90f --- /dev/null +++ b/NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj @@ -0,0 +1,33 @@ + + + + Exe + net6.0-windows + enable + enable + NibblePoker.Application.ListComPort + NibblePoker.Application.ListComPort + 3.0.0 + 3.0.0 + 3.0.0 + en-001 + ..\lscom-v2-text-01.ico + false + Herwin Bozet (@NibblePoker) + + + + + + + + + + + + + lscom-v2-text-01.ico + + + + diff --git a/NibblePoker.Application.ListComPort/Program.cs b/NibblePoker.Application.ListComPort/Program.cs new file mode 100644 index 0000000..bf524bc --- /dev/null +++ b/NibblePoker.Application.ListComPort/Program.cs @@ -0,0 +1,183 @@ +using NibblePoker.Library.Arguments; +using NibblePoker.Library.ComPortWatcher; + +namespace NibblePoker.Application.ListComPort; + +internal static class Program { + private const string Version = "3.0.0-indev"; + + private static readonly Verb RootVerb = new Verb(""); + + private static readonly Option OptionShowAll = new('a', "show-all", "Display the complete port's name (Equal to '-dfn')"); + private static readonly Option OptionShowDevice = new('d', "show-device", "Displays the port's device name"); + private static readonly Option OptionDivider = new('D', "divider", "Uses the given string or char as a separator (Can be an empty string !)", OptionFlags.HasValue); + private static readonly Option OptionShowFriendly = new('f', "show-friendly", "Displays the port's friendly name"); + private static readonly Option OptionHelp = new('h', "help", "Display the help text", OptionFlags.StopsParsing); + private static readonly Option OptionHelpShort = new('H', "short-help", "Display the short help text", OptionFlags.StopsParsing); + private static readonly Option OptionShowNameRaw = new('n', "show-name-raw", "Displays the port's raw name (See remarks section)"); + private static readonly Option OptionNoPretty = new('P', "no-pretty", "Disables the pretty printing format (Equal to -D \" \""); + private static readonly Option OptionSort = new('s', "sort", "Sorts the port based on their raw names in an ascending order"); + private static readonly Option OptionSortReverse = new('S', "sort-reverse", "Sorts the port based on their raw names in a descending order"); + private static readonly Option OptionTabPadding = new('t', "tab-padding", "Use tabs for padding between the types of names (Overrides '-D')"); + private static readonly Option OptionVersion = new('v', "version", "Shows the utility's version number and other info"); + private static readonly Option OptionVersionOnly = new('V', "version-only", "Shows the utility's version number only (Overrides '-v')"); + + private static bool _shouldPrintRawNames = true; + private static bool _shouldPrintDeviceNames = false; + private static bool _shouldPrintFriendlyNames = false; + + private static string _paddingText = ""; + + private static SortingOrder _sortingOrder = SortingOrder.None; + + private static int _exitCode = ErrorCodes.NoError; + + private static int Main(string[] args) { + try { + ArgumentsParser.ParseArguments(RootVerb.RegisterOption(OptionShowAll).RegisterOption(OptionShowDevice) + .RegisterOption(OptionDivider).RegisterOption(OptionShowFriendly).RegisterOption(OptionHelp) + .RegisterOption(OptionShowNameRaw).RegisterOption(OptionNoPretty).RegisterOption(OptionSort) + .RegisterOption(OptionSortReverse).RegisterOption(OptionTabPadding).RegisterOption(OptionVersion) + .RegisterOption(OptionVersionOnly), args); + } catch(ArgumentException) { + Console.Error.Write("Failed to parse the launch arguments, default options will be used."); + _exitCode = ErrorCodes.ArgumentParsingFailure; + RootVerb.Clear(); + } + + if(OptionHelp.WasUsed() || OptionHelpShort.WasUsed()) { + Console.WriteLine(HelpText.GetFullHelpText(RootVerb, "lscom.exe", (uint)Console.BufferWidth - 1, 1, 2, false)); + + if(OptionHelp.WasUsed()) { + Console.WriteLine("\nRemarks:"); + Console.WriteLine(" * If '-d' or '-f' is used, the raw name will not be shown unless '-n' is used."); + Console.WriteLine(" * If '-D', '-t' or '-p' are used, the special separator between the raw and friendly name and the square brackets are not shown."); + Console.WriteLine(" * By default, the ports are sorted in the order they are provided by the registry, which is often chronological."); + Console.WriteLine(" * The 'raw name' refers to a port name. (e.g.: COM1, COM2, ...)"); + Console.WriteLine(" * The 'device name' refers to a port device path. (e.g.: \\Device\\Serial1, ...)"); + Console.WriteLine(" * The 'friendly name' refers to a port name as seen in the device manager. (e.g.: Communications Port, USB-SERIAL CH340, ...)"); + Console.WriteLine(" * Any result returned with an error code between 1-9 and 30-39 should be considered as invalid."); + Console.WriteLine(" * Any result returned with another error code is valid but probably not formatted properly."); + } + + return ErrorCodes.NoError; + } + + if(OptionVersionOnly.WasUsed()) { + Console.WriteLine(Version); + return ErrorCodes.NoError; + } + + if(OptionVersion.WasUsed()) { + Console.WriteLine("NibblePoker.Application.ListComPort (lscom) v" + Version); + Console.WriteLine(""); + Console.WriteLine("Dependencies:"); + Console.WriteLine("├─> NibblePoker.Library.Arguments v1.1.0"); + Console.WriteLine("├─> NibblePoker.Library.ComPortHelpers v" + Version); + Console.WriteLine("└─> NibblePoker.Library.RegistryHelpers v0.0.1"); + Console.WriteLine(""); + Console.WriteLine("GitHub repositories:"); + Console.WriteLine("├─> https://github.com/aziascreations/DotNet-Arguments"); + Console.WriteLine("└─> https://github.com/aziascreations/DotNet-RegistryHelpers"); + // TODO: Add final repo link here ! + Console.WriteLine(""); + Console.WriteLine("This software and all its libraries are licensed under the MIT license."); + return ErrorCodes.NoError; + } + + if(OptionShowDevice.WasUsed()) { + _shouldPrintRawNames = false; + _shouldPrintDeviceNames = true; + } + + if(OptionShowFriendly.WasUsed()) { + _shouldPrintRawNames = false; + _shouldPrintFriendlyNames = true; + } + + if(OptionShowNameRaw.WasUsed()) { + _shouldPrintRawNames = true; + } + + if(OptionShowAll.WasUsed()) { + _shouldPrintRawNames = true; + _shouldPrintFriendlyNames = true; + _shouldPrintDeviceNames = true; + } + + if(OptionSort.WasUsed()) { + _sortingOrder = SortingOrder.Ascending; + } + + if(OptionSortReverse.WasUsed()) { + _sortingOrder = SortingOrder.Descending; + } + + if(OptionNoPretty.WasUsed()) { + _paddingText = " "; + } + + if(OptionDivider.WasUsed()) { + _paddingText = OptionDivider.Arguments[0]; + } + + if(OptionTabPadding.WasUsed()) { + _paddingText = "\t"; + } + + // Application's code + + string rawToFriendlySeparator = " - "; + bool addDeviceBrackets = true; + + if(string.IsNullOrEmpty(_paddingText)) { + _paddingText = " "; + } else { + rawToFriendlySeparator = _paddingText; + addDeviceBrackets = false; + } + + if(!_shouldPrintRawNames && !_shouldPrintFriendlyNames && _shouldPrintDeviceNames) { + addDeviceBrackets = false; + } + + List comPortsInfo = ComPortHelper.GetComList(_shouldPrintFriendlyNames); + + if(comPortsInfo.Count > 0) { + comPortsInfo = _sortingOrder switch { + SortingOrder.Ascending => comPortsInfo.OrderBy(o => o.RawName).ToList(), + SortingOrder.Descending => comPortsInfo.OrderByDescending(o => o.RawName).ToList(), + _ => comPortsInfo + }; + + foreach(ComPortInfo comPortInfo in comPortsInfo) { + if(_shouldPrintRawNames) { + Console.Write(comPortInfo.RawName); + + if(_shouldPrintFriendlyNames) { + Console.Write(rawToFriendlySeparator); + } + } + + if(_shouldPrintFriendlyNames) { + Console.Write(comPortInfo.FriendlyName); + } + + if((_shouldPrintRawNames || _shouldPrintFriendlyNames) && _shouldPrintDeviceNames) { + Console.Write(_paddingText); + } + + if(_shouldPrintDeviceNames) { + Console.Write((addDeviceBrackets ? "[" : "") + comPortInfo.DeviceName + (addDeviceBrackets ? "]" : "")); + } + + Console.WriteLine(); + } + } else { + Console.Error.Write("No COM port could be found."); + _exitCode = ErrorCodes.NoComPorts; + } + + return _exitCode; + } +} diff --git a/NibblePoker.Library.ComPortHelpers/ComPortHelper.cs b/NibblePoker.Library.ComPortHelpers/ComPortHelper.cs new file mode 100644 index 0000000..1e639cc --- /dev/null +++ b/NibblePoker.Library.ComPortHelpers/ComPortHelper.cs @@ -0,0 +1,73 @@ +using Microsoft.Win32; +using static NibblePoker.Library.RegistryHelpers.RegistryHelpers; + +namespace NibblePoker.Library.ComPortWatcher; + +public static class ComPortHelper { + private const string RegistryKeySerial = "HARDWARE\\DEVICEMAP\\SERIALCOMM"; + private const string RegistryKeyDeviceEnum = "SYSTEM\\ControlSet001\\Enum"; + + private static readonly string[] IgnoredRegistryDeviceEnums = { + "ACPI", "ACPI_HAL", "HDAUDIO", "SCSI", "STORAGE", "SW", "SWD", "UEFI" + }; + + private const string RegistryNameFriendlyName = "FriendlyName"; + + private static void AddFriendlyNamesToPortsInfo(List comPortsInfo) { + List subKeys = GetSubKeys(Registry.LocalMachine, RegistryKeyDeviceEnum); + List intermediateSubKeys = new List(); + List finalSubKeys = new List(); + List friendlyNames = new List(); + + foreach(var subKey in subKeys.Where(subKey => !IgnoredRegistryDeviceEnums.Contains(subKey))) { + intermediateSubKeys.AddRange(GetSubKeys( + Registry.LocalMachine, + RegistryKeyDeviceEnum + "\\" + subKey, + true)); + } + subKeys.Clear(); + + foreach(string subSubKey in intermediateSubKeys) { + finalSubKeys.AddRange(GetSubKeys( + Registry.LocalMachine, + subSubKey, + true)); + } + intermediateSubKeys.Clear(); + + foreach(string finalSubKey in finalSubKeys) { + Dictionary mappedKeyValues = GetMappedKeyNameStringValue(Registry.LocalMachine, finalSubKey); + + if(mappedKeyValues.ContainsKey(RegistryNameFriendlyName)) { + friendlyNames.Add(mappedKeyValues[RegistryNameFriendlyName]); + } + } + finalSubKeys.Clear(); + + foreach(ComPortInfo comPortInfo in comPortsInfo) { + foreach(string friendlyName in friendlyNames) { + if(!friendlyName.Contains("(" + comPortInfo.RawName + ")")) { + continue; + } + + comPortInfo.FriendlyName = friendlyName; + break; + } + } + friendlyNames.Clear(); + } + + public static List GetComList(bool addFriendlyNames = false) { + List portsInfo = new List(); + + foreach(KeyValuePair rawPortInfo in GetMappedKeyNameStringValue(Registry.LocalMachine, RegistryKeySerial)) { + portsInfo.Add(new ComPortInfo(rawPortInfo.Value, rawPortInfo.Key)); + } + + if(addFriendlyNames && portsInfo.Count > 0) { + AddFriendlyNamesToPortsInfo(portsInfo); + } + + return portsInfo; + } +} diff --git a/NibblePoker.Library.ComPortHelpers/ComPortInfo.cs b/NibblePoker.Library.ComPortHelpers/ComPortInfo.cs new file mode 100644 index 0000000..4853b96 --- /dev/null +++ b/NibblePoker.Library.ComPortHelpers/ComPortInfo.cs @@ -0,0 +1,18 @@ +namespace NibblePoker.Library.ComPortWatcher; + +public class ComPortInfo { + public string RawName; + public string DeviceName; + public string FriendlyName; + + public ComPortInfo(string rawName, string deviceName, string friendlyName = "") { + RawName = rawName; + DeviceName = deviceName; + + if(string.IsNullOrEmpty(friendlyName)) { + FriendlyName = "No friendly name found (" + rawName + ")"; + } else { + FriendlyName = friendlyName; + } + } +} \ No newline at end of file diff --git a/NibblePoker.Library.ComPortHelpers/NibblePoker.Library.ComPortHelpers.csproj b/NibblePoker.Library.ComPortHelpers/NibblePoker.Library.ComPortHelpers.csproj new file mode 100644 index 0000000..6979cd3 --- /dev/null +++ b/NibblePoker.Library.ComPortHelpers/NibblePoker.Library.ComPortHelpers.csproj @@ -0,0 +1,15 @@ + + + + net6.0-windows + enable + enable + NibblePoker.Library.ComPortWatcher + NibblePoker.Library.ComPortHelpers + + + + + + + diff --git a/NibblePoker.Library.ComPortHelpers/SortingOrder.cs b/NibblePoker.Library.ComPortHelpers/SortingOrder.cs new file mode 100644 index 0000000..98b3a35 --- /dev/null +++ b/NibblePoker.Library.ComPortHelpers/SortingOrder.cs @@ -0,0 +1,7 @@ +namespace NibblePoker.Library.ComPortWatcher; + +public enum SortingOrder { + Descending = -1, + None = 0, + Ascending = 1, +} diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..d5e3ef0 --- /dev/null +++ b/build.bat @@ -0,0 +1,39 @@ +@echo off + +echo Fixing CWD... +cd /D "%~dp0" + +echo Deleting build directories... +rmdir /Q /S .\ComPortHelpers\bin 2>nul +rmdir /Q /S .\ComPortHelpers\obj 2>nul +rmdir /Q /S .\ComPortWatcher\bin 2>nul +rmdir /Q /S .\ComPortWatcher\obj 2>nul +rmdir /Q /S .\ListComPort\bin 2>nul +rmdir /Q /S .\ListComPort\obj 2>nul +rmdir /Q /S .\Builds 2>nul + +echo Building... + +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -o "./Builds/any/" + +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x86 -c Release -o "./Builds/x86_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x64 -c Release -o "./Builds/x64_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm -c Release -o "./Builds/arm_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm64 -c Release -o "./Builds/arm64_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true + +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x86 -c Release -o "./Builds/x86_sc" --self-contained true -p:PublishReadyToRun=true +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x64 -c Release -o "./Builds/x64_sc" --self-contained true -p:PublishReadyToRun=true +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm -c Release -o "./Builds/arm_sc" --self-contained true -p:PublishReadyToRun=true +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm64 -c Release -o "./Builds/arm64_sc" --self-contained true -p:PublishReadyToRun=true + +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x86 -c Release -o "./Builds/x86_sc_trim" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x64 -c Release -o "./Builds/x64_sc_trim" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm -c Release -o "./Builds/arm_sc_trim" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true +::dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm64 -c Release -o "./Builds/arm64_sc_trim" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true + +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x86 -c Release -o "./Builds/x86_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x64 -c Release -o "./Builds/x64_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm -c Release -o "./Builds/arm_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm64 -c Release -o "./Builds/arm64_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true + +pause diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..4fcf3cf --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +echo "Deleting build directories..." +rm -rf ./ComPortHelpers/bin 2>nul +rm -rf ./ComPortHelpers/obj 2>nul +rm -rf ./ComPortWatcher/bin 2>nul +rm -rf ./ComPortWatcher/obj 2>nul +rm -rf ./ListComPort/bin 2>nul +rm -rf ./ListComPort/obj 2>nul +rm -rf ./Builds 2>nul + +echo "Building..." + +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -o "./Builds/any/" + +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x86 -c Release -o "./Builds/x86_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x64 -c Release -o "./Builds/x64_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm -c Release -o "./Builds/arm_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm64 -c Release -o "./Builds/arm64_single" --no-self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true + +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x86 -c Release -o "./Builds/x86_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-x64 -c Release -o "./Builds/x64_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm -c Release -o "./Builds/arm_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true +dotnet publish "./NibblePoker.Application.ListComPort/NibblePoker.Application.ListComPort.csproj" --nologo -r win-arm64 -c Release -o "./Builds/arm64_single_sc_trim_comp" --self-contained true -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true + +echo "Done !" diff --git a/lscom-v2-text-01.ico b/lscom-v2-text-01.ico new file mode 100644 index 0000000000000000000000000000000000000000..c7e1ca93f52195787de119c217af592b6666ab0f GIT binary patch literal 4185 zcmZ`+c|4Tg_rJ5DF}AWtCfWC788M8p?_(%f3M$Pzu$fCJ@=k-?|Gl~p9cU0{QVsWfComr00_e8(-d1XF03dP zK5|)@8$0~H{ku3&@D|eO>I49Cm16B=0<({++?0t?H`2|ClyrFN+MckdG2w$ftqGMk>G|?_y&yGP0O@Jxoh^GoM5>_d`eAU^* z4}K48!N~uWl$AH;msJxilgN%|V$xgvf@5Lz?S9&?4j!a0~XD+<2cdKY<+kQ;*pdPdHZLp!%q-GWv*hKvG(-yLG@^EtV(J+aT z)AWX8QPlBH&nbnGtFE;tq~!#JCt7-5f#vr8Ok3Z2Sgvgrt3dEHw|1;+h@ z#L?8 zphk*RHHbK56rpXAtWFMB)(gE{+xky+^M%T$((*>Q^hFoz&y-Zc35TUpRUmj-QC#6tMkQrvnJ3j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