upd
This commit is contained in:
1 parent
4ec1a8b8df
commit
9da7f63f6b
4 files changed
+64
-53
No files matched your search
@@ -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
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
<ApplicationIcon>Assets\app.ico</ApplicationIcon>
|
||||
<AssemblyName>ArduManager</AssemblyName>
|
||||
<RootNamespace>ArduManager</RootNamespace>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>true</SelfContained>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="standard-platforms.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -4,40 +4,64 @@ namespace ArduboardsManager.App.Services;
|
||||
|
||||
public sealed class StandardPlatformLinksService
|
||||
{
|
||||
private const string FileName = "standard-platforms.json";
|
||||
|
||||
public IReadOnlyList<StandardPlatformLink> Load()
|
||||
private static readonly IReadOnlyList<StandardPlatformLink> BuiltInLinks = new List<StandardPlatformLink>
|
||||
{
|
||||
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<StandardPlatformLink>();
|
||||
|
||||
var json = File.ReadAllText(filePath);
|
||||
var map = JsonSerializer.Deserialize<Dictionary<string, string>>(json, new JsonSerializerOptions
|
||||
{
|
||||
ReadCommentHandling = JsonCommentHandling.Skip,
|
||||
AllowTrailingCommas = true
|
||||
});
|
||||
|
||||
if (map is null || map.Count == 0)
|
||||
return Array.Empty<StandardPlatformLink>();
|
||||
|
||||
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<StandardPlatformLink> Load() => BuiltInLinks;
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
Reference in new issue
Block a user