From 9da7f63f6bd234994dbd40abd3bff9aa2648b206 Mon Sep 17 00:00:00 2001 From: AlexGyver Date: Wed, 24 Jun 2026 23:01:36 +0300 Subject: [PATCH] upd --- README.md | 4 +- src/ArduManager.App/ArduManager.App.csproj | 12 +-- .../Services/StandardPlatformLinksService.cs | 88 ++++++++++++------- src/ArduManager.App/standard-platforms.json | 13 --- 4 files changed, 64 insertions(+), 53 deletions(-) delete mode 100644 src/ArduManager.App/standard-platforms.json diff --git a/README.md b/README.md index c166df0..9c58db5 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ Кастомный менеджер Arduino-библиотек и платформ для Windows. Работает напрямую с GitHub, а не с экосистемой Arduino, которая заблокировала доступ пользователям из России Скачать свежую версию: -- [Windows 64 bit](https://github.com/AlexGyver/ArduManager/releases/latest/download/ArduManager-x64.exe) -- [Windows 32 bit](https://github.com/AlexGyver/ArduManager/releases/latest/download/ArduManager-x86.exe) +- Windows 64 bit: [релиз](https://github.com/AlexGyver/ArduManager/releases/latest/download/ArduManager-x64.exe), [Яндекс.Диск](https://disk.yandex.ru/d/bZ77gGHrPNZJBw) +- Windows 32 bit: [релиз](https://github.com/AlexGyver/ArduManager/releases/latest/download/ArduManager-x86.exe), [Яндекс.Диск](https://disk.yandex.ru/d/9WKubhTYC0kM2g) Возможности: - Работа напрямую с GitHub-списком библиотек в обход Arduino diff --git a/src/ArduManager.App/ArduManager.App.csproj b/src/ArduManager.App/ArduManager.App.csproj index d9a433c..6791328 100644 --- a/src/ArduManager.App/ArduManager.App.csproj +++ b/src/ArduManager.App/ArduManager.App.csproj @@ -10,11 +10,11 @@ Assets\app.ico ArduManager ArduManager + true + true + true + true + None + false - - - - PreserveNewest - - diff --git a/src/ArduManager.App/Boards/Services/StandardPlatformLinksService.cs b/src/ArduManager.App/Boards/Services/StandardPlatformLinksService.cs index 9f79736..047344d 100644 --- a/src/ArduManager.App/Boards/Services/StandardPlatformLinksService.cs +++ b/src/ArduManager.App/Boards/Services/StandardPlatformLinksService.cs @@ -4,40 +4,64 @@ namespace ArduboardsManager.App.Services; public sealed class StandardPlatformLinksService { - private const string FileName = "standard-platforms.json"; - - public IReadOnlyList Load() + private static readonly IReadOnlyList BuiltInLinks = new List { - var filePath = Path.Combine(AppContext.BaseDirectory, FileName); - - // При dotnet run файл копируется в bin. На случай запуска из другой структуры оставляем fallback. - if (!File.Exists(filePath)) + new() { - var sourceTreeFallback = Path.Combine(Environment.CurrentDirectory, "src", "ArduManager.App", FileName); - if (File.Exists(sourceTreeFallback)) - filePath = sourceTreeFallback; + Name = "ESP8266", + Url = "https://arduino.esp8266.com/stable/package_esp8266com_index.json" + }, + new() + { + Name = "ESP32", + Url = "https://espressif.github.io/arduino-esp32/package_esp32_index.json" + }, + new() + { + Name = "RP2040/RP2350", + Url = "https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json" + }, + new() + { + Name = "STM32duino", + Url = "https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json" + }, + new() + { + Name = "Arduino official", + Url = "https://downloads.arduino.cc/packages/package_index.json" + }, + new() + { + Name = "MicroCore", + Url = "https://mcudude.github.io/MicroCore/package_MCUdude_MicroCore_index.json" + }, + new() + { + Name = "ATTinyCore", + Url = "http://drazzy.com/package_drazzy.com_index.json" + }, + new() + { + Name = "MiniCore", + Url = "https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json" + }, + new() + { + Name = "MightyCore", + Url = "https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json" + }, + new() + { + Name = "MegaCore", + Url = "https://mcudude.github.io/MegaCore/package_MCUdude_MegaCore_index.json" + }, + new() + { + Name = "LGT8fx", + Url = "https://raw.githubusercontent.com/dbuezas/lgt8fx/master/package_lgt8fx_index.json" } + }; - if (!File.Exists(filePath)) - return Array.Empty(); - - var json = File.ReadAllText(filePath); - var map = JsonSerializer.Deserialize>(json, new JsonSerializerOptions - { - ReadCommentHandling = JsonCommentHandling.Skip, - AllowTrailingCommas = true - }); - - if (map is null || map.Count == 0) - return Array.Empty(); - - return map - .Where(x => !string.IsNullOrWhiteSpace(x.Key) && !string.IsNullOrWhiteSpace(x.Value)) - .Select(x => new StandardPlatformLink - { - Name = x.Key.Trim(), - Url = x.Value.Trim() - }) - .ToList(); - } + public IReadOnlyList Load() => BuiltInLinks; } diff --git a/src/ArduManager.App/standard-platforms.json b/src/ArduManager.App/standard-platforms.json deleted file mode 100644 index 0a95a42..0000000 --- a/src/ArduManager.App/standard-platforms.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ESP8266": "https://arduino.esp8266.com/stable/package_esp8266com_index.json", - "ESP32": "https://espressif.github.io/arduino-esp32/package_esp32_index.json", - "RP2040/RP2350": "https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json", - "STM32duino": "https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json", - "Arduino official": "https://downloads.arduino.cc/packages/package_index.json", - "MicroCore": "https://mcudude.github.io/MicroCore/package_MCUdude_MicroCore_index.json", - "ATTinyCore": "http://drazzy.com/package_drazzy.com_index.json", - "MiniCore": "https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json", - "MightyCore": "https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json", - "MegaCore": "https://mcudude.github.io/MegaCore/package_MCUdude_MegaCore_index.json", - "LGT8fx": "https://raw.githubusercontent.com/dbuezas/lgt8fx/master/package_lgt8fx_index.json" -} \ No newline at end of file