Skip to content

Commit 6fab958

Browse files
committed
Add osx-arm64 support
1 parent 847e935 commit 6fab958

File tree

16 files changed

+37
-16
lines changed

16 files changed

+37
-16
lines changed

Build/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ dotnet pack -c Release /p:PackageOutputPath=${nupkgdir}
6969

7070
# 打包nbeauty
7171
mkdir ${archivedir}
72-
"win-x86", "win-x64", "linux-x64", "osx-x64" | ForEach-Object -Process {
72+
"win-x86", "win-x64", "linux-x64", "osx-x64", "osx-arm64" | ForEach-Object -Process {
7373
$rid = $_
7474
cd "${tooldir}/${rid}"
7575
Compress-Archive -Force -Path * -DestinationPath "${archivedir}/${rid}.zip"

Common/Common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<PackageOutputPath>.nupkg</PackageOutputPath>
5-
<Version>2.1.4.1</Version>
5+
<Version>2.1.4.2</Version>
66

77
<Company>nulastudio</Company>
88
<Authors>LiesAuer</Authors>

NetBeauty/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ BINARY_WIN_X86 = win-x86/nbeauty2.exe
33
BINARY_WIN_X64 = win-x64/nbeauty2.exe
44
BINARY_LINUX_X64 = linux-x64/nbeauty2
55
BINARY_MAC_X64 = osx-x64/nbeauty2
6+
BINARY_MAC_ARM64 = osx-arm64/nbeauty2
67
BUILD_FLAGS = -ldflags="-s -w"
78
PACKAGE = "github.com/nulastudio/NetBeauty/src/main"
89

9-
build-all: build-win-x86 build-win-x64 build-linux-x64 build-osx-x64
10+
build-all: build-win-x86 build-win-x64 build-linux-x64 build-osx-x64 build-osx-arm64
1011

1112
build-win-x86:
1213
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_WIN_X86) $(PACKAGE)
@@ -19,3 +20,6 @@ build-linux-x64:
1920

2021
build-osx-x64:
2122
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_MAC_X64) $(PACKAGE)
23+
24+
build-osx-arm64:
25+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_MAC_ARM64) $(PACKAGE)

NetBeauty/make.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ $BINARY_WIN_X86 = "win-x86/nbeauty2.exe"
33
$BINARY_WIN_X64 = "win-x64/nbeauty2.exe"
44
$BINARY_LINUX_X64 = "linux-x64/nbeauty2"
55
$BINARY_MAC_X64 = "osx-x64/nbeauty2"
6+
$BINARY_MAC_ARM64 = "osx-arm64/nbeauty2"
67
$BUILD_FLAGS = '-ldflags="-s -w"'
78
$PACKAGE = "github.com/nulastudio/NetBeauty/src/main"
89

@@ -23,3 +24,7 @@ go build ${BUILD_FLAGS} -o ./${OUTPUT}/${BINARY_LINUX_X64} $PACKAGE
2324
$Env:GOOS = "darwin"
2425
$Env:GOARCH = "amd64"
2526
go build ${BUILD_FLAGS} -o ./${OUTPUT}/${BINARY_MAC_X64} $PACKAGE
27+
28+
$Env:GOOS = "darwin"
29+
$Env:GOARCH = "arm64"
30+
go build ${BUILD_FLAGS} -o ./${OUTPUT}/${BINARY_MAC_ARM64} $PACKAGE

NetBeauty/src/main/bindata.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NetBeauty/src/nbloader/nbloader.dll

0 Bytes
Binary file not shown.

NetBeautyGlobalTool/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Program
1616
["win-x64"] = "/nbeauty2/win-x64/nbeauty2.exe",
1717
["linux-x64"] = "/nbeauty2/linux-x64/nbeauty2",
1818
["osx-x64"] = "/nbeauty2/osx-x64/nbeauty2",
19+
["osx-arm64"] = "/nbeauty2/osx-arm64/nbeauty2",
1920
};
2021

2122
static void Main(string[] args)
@@ -32,7 +33,14 @@ static void Main(string[] args)
3233
}
3334
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
3435
{
35-
nbeautyBin = platform["osx-x64"];
36+
if (RuntimeInformation.ProcessArchitecture == Architecture.X64)
37+
{
38+
nbeautyBin = platform["osx-x64"];
39+
}
40+
else if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
41+
{
42+
nbeautyBin = platform["osx-arm64"];
43+
}
3644
}
3745
var psi = new ProcessStartInfo(rootDir + nbeautyBin)
3846
{

NetBeautyNuget/Beauty.targets

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">True</IsWindows>
44
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">True</IsLinux>
55
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">True</IsOSX>
6+
<RuntimeArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)</RuntimeArch>
67
<RuntimeOS Condition="$(IsWindows) == 'True'">win-x86</RuntimeOS>
78
<RuntimeOS Condition="$(IsLinux) == 'True'">linux-x64</RuntimeOS>
8-
<RuntimeOS Condition="$(IsOSX) == 'True'">osx-x64</RuntimeOS>
9+
<RuntimeOS Condition="$(IsOSX) == 'True' And $(RuntimeArch) == 'X64'">osx-x64</RuntimeOS>
10+
<RuntimeOS Condition="$(IsOSX) == 'True' And $(RuntimeArch) == 'Arm64'">osx-arm64</RuntimeOS>
911
<BeautyBinExt Condition="$(IsWindows) == 'True'">.exe</BeautyBinExt>
1012
<BeautyBin>"$(MSBuildThisFileDirectory)../tools/$(RuntimeOS)/nbeauty2$(BeautyBinExt)"</BeautyBin>
1113
<BeautyLibsDir Condition="$(BeautyLibsDir) == ''">libraries</BeautyLibsDir>
@@ -81,6 +83,8 @@ Args = string.Join(" ", CommandLineArgs);
8183
<_BeautyIsPublishing>True</_BeautyIsPublishing>
8284
</PropertyGroup>
8385

86+
<!-- <Message Text="RuntimeOS: $(RuntimeOS)" Importance="High" /> -->
87+
<!-- <Message Text="RuntimeArch: $(RuntimeArch)" Importance="High" /> -->
8488
<!-- <Message Text="Running inside Visual Studio: $(_BeautyDetermineIsInsideVS)" Importance="High" /> -->
8589
<!-- <Message Text="PublishProtocol: $(PublishProtocol)" Importance="High" /> -->
8690
<!-- <Message Text="Running is publish task: $(_BeautyIsPublishing)" Importance="High" /> -->

NetBeautyTest/AvaloniaTest/AvaloniaTest/AvaloniaTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</PropertyGroup>
5050

5151
<ItemGroup>
52-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
52+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
5353
</ItemGroup>
5454

5555
</Project>

NetBeautyTest/ChromelyTest/ChromelyTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
</PropertyGroup>
7878

7979
<ItemGroup>
80-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
80+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
8181
</ItemGroup>
8282

8383
</Project>

NetBeautyTest/NetFxTest/NetFxTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
</ItemGroup>
155155
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
156156
<ItemGroup>
157-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
157+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
158158
<PackageReference Include="SixLabors.ImageSharp">
159159
<Version>2.1.3</Version>
160160
</PackageReference>

NetBeautyTest/SharedRuntimeTest/WsClient/WsClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<ItemGroup>
4949
<PackageReference Include="WatsonWebsocket" Version="2.3.2.5" />
50-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
50+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
5151
</ItemGroup>
5252

5353
</Project>

NetBeautyTest/SharedRuntimeTest/WsServer/WsServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<ItemGroup>
4949
<PackageReference Include="WatsonWebsocket" Version="2.3.2.5" />
50-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
50+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
5151
</ItemGroup>
5252

5353
</Project>

NetBeautyTest/WPFTest/WPFTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
</PropertyGroup>
9898

9999
<ItemGroup>
100-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
100+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
101101
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
102102
</ItemGroup>
103103

NetBeautyTest/WebAppTest/WebAppTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</PropertyGroup>
4343

4444
<ItemGroup>
45-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
45+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
4646
</ItemGroup>
4747

4848
</Project>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ see [`--hiddens`](#use-the-binary-application-if-your-project-has-already-been-p
2020
| ---- | ---- | ---- |
2121
| Supported Framework | `.Net Framework`<br/>`.Net Core 3.0+` | `.Net Core 2.0+` |
2222
| Supported Deployment Model | Framework-dependent deployment (`FDD`)<br/>Self-contained deployment (`SCD`)<br/>Framework-dependent executables (`FDE`) | Self-contained deployment (`SCD`) |
23-
| Supported System | All | `win-x64` `win-x86`<br/>`linux-x64` `linux-arm` `linux-arm64`<br/>`osx-x64` |
23+
| Supported System | All | `win-x64` `win-x86`<br/>`linux-x64` `linux-arm` `linux-arm64`<br/>`osx-x64`<br/>`osx-arm64`(.NET 6+) |
2424
| Need Patched HostFXR | No<br />Yes(if use patch) | Yes |
2525
| Minimum Structure | ~20 Files<br />~8 Files(if use patch) | ~8 Files |
2626
| How It Works | [`STARTUP_HOOKS`](https://github.com/dotnet/runtime/blob/main/docs/design/features/host-startup-hook.md)<br/>[`AssemblyLoadContext.Resolving`](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext.resolving?view=netcore-3.0)<br/>[`AssemblyLoadContext.ResolvingUnmanagedDll`](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext.resolvingunmanageddll?view=netcore-3.0)<br />+<br />[`patched libhostfxr`](https://github.com/nulastudio/HostFXRPatcher)(if use patch)<br/>[`additionalProbingPaths`](https://github.com/dotnet/toolset/blob/master/Documentation/specs/runtime-configuration-file.md#runtimeoptions-section-runtimeconfigjson)(if use patch) | [`patched libhostfxr`](https://github.com/nulastudio/HostFXRPatcher)<br/>[`additionalProbingPaths`](https://github.com/dotnet/toolset/blob/master/Documentation/specs/runtime-configuration-file.md#runtimeoptions-section-runtimeconfigjson) |
@@ -84,7 +84,7 @@ Your `*.csproj` should be like:
8484
</PropertyGroup>
8585

8686
<ItemGroup>
87-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.1" />
87+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.2" />
8888
</ItemGroup>
8989

9090
</Project>

0 commit comments

Comments
 (0)