Skip to content

Commit c36e4b0

Browse files
authored
Merge pull request #5 from AMagicPear/fix/fix-5.10
fix: 修复迁移后的依赖问题
2 parents 7f3568f + 5b81ba2 commit c36e4b0

File tree

8 files changed

+46
-10
lines changed

8 files changed

+46
-10
lines changed

PCL.Neo.Core/Const.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,38 @@ public enum RunningOs
2525
: RunningOs.Unknown;
2626

2727
public static readonly Architecture Architecture = RuntimeInformation.ProcessArchitecture;
28+
29+
/// <summary>
30+
/// 根据 MOJANG API 命名
31+
/// </summary>
32+
public static string Platform
33+
{
34+
get
35+
{
36+
return Os switch
37+
{
38+
RunningOs.Windows => Architecture switch
39+
{
40+
Architecture.X64 => "windows-x64",
41+
Architecture.X86 => "windows-x86",
42+
Architecture.Arm64 => "windows-arm64",
43+
_ => "unknown"
44+
},
45+
RunningOs.Linux => Architecture switch
46+
{
47+
Architecture.X64 => "linux",
48+
Architecture.X86 => "linux-i386",
49+
_ => "unknown"
50+
},
51+
RunningOs.MacOs => Architecture switch
52+
{
53+
Architecture.X64 => "mac-os",
54+
Architecture.Arm64 => "mac-os-arm64",
55+
_ => "unknown"
56+
},
57+
RunningOs.Unknown => "unknown",
58+
_ => "unknown"
59+
};
60+
}
61+
}
2862
}

PCL.Neo/Helpers/FileHelper.cs renamed to PCL.Neo.Core/Helpers/FileHelper.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
using Avalonia.Platform.Storage;
2-
using CommunityToolkit.Mvvm.DependencyInjection;
3-
using PCL.Neo.Services;
4-
using System;
51
using System.Diagnostics;
6-
using System.IO;
7-
using System.Net.Http;
82
using System.Runtime.InteropServices;
93
using System.Runtime.Versioning;
10-
using System.Threading;
11-
using System.Threading.Tasks;
124

13-
namespace PCL.Neo.Helpers;
5+
namespace PCL.Neo.Core.Helpers;
146

157
/// <summary>
168
/// 一些文件操作和下载请求之类的

PCL.Neo.Core/Models/Minecraft/Java/JavaData.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using PCL.Neo.Core.Utils;
12
using System.Diagnostics;
23
using System.Text.RegularExpressions;
34

PCL.Neo.Core/Models/Minecraft/Java/JavaFetcherOnline.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using PCL.Neo.Core.Helpers;
12
using System.Diagnostics;
23
using System.Text.Json;
34
using System.Text.Json.Nodes;
@@ -105,7 +106,7 @@ public sealed record MojangJavaVersion(string Value)
105106
}
106107

107108
string localFilePath = Path.Combine(destinationFolder,
108-
filePath.Replace("/", Const.Sep.ToString()));
109+
filePath.Replace("/", Path.DirectorySeparatorChar.ToString()));
109110
if (isExecutable) executableFiles.Add(localFilePath);
110111
Directory.CreateDirectory(Path.GetDirectoryName(localFilePath)!);
111112
// 有的文件有LZMA压缩但是有的 tm 没有,尼玛搞了个解压缩发现文件少了几个

PCL.Neo.Core/Models/Minecraft/Java/JavaManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using PCL.Neo.Core.Utils;
2+
13
namespace PCL.Neo.Core.Models.Minecraft.Java;
24

35
/// <summary>

PCL.Neo.Core/Models/Minecraft/Java/Unix.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using PCL.Neo.Core.Utils;
12
using System.Diagnostics;
23
using System.Text.RegularExpressions;
34

PCL.Neo.Core/Models/Minecraft/Java/Windows.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using PCL.Neo.Core.Utils;
12
using System.Collections.Immutable;
23

34
namespace PCL.Neo.Core.Models.Minecraft.Java;

PCL.Neo.Core/PCL.Neo.Core.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<PackageReference Include="SevenZip" Version="19.0.0" />
11+
</ItemGroup>
12+
913
</Project>

0 commit comments

Comments
 (0)