You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs
+66-3Lines changed: 66 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
usingSystem;
2
+
usingSystem.Diagnostics;
2
3
usingSystem.Runtime.InteropServices;
3
4
4
5
namespaceElectronNET.CLI.Commands.Actions
@@ -27,6 +28,19 @@ public static GetTargetPlatformInformationResult Do(string desiredPlatform, stri
27
28
netCorePublishRid="osx-x64";
28
29
electronPackerPlatform="mac";
29
30
break;
31
+
case"osx-arm64":
32
+
netCorePublishRid="osx-arm64";
33
+
electronPackerPlatform="mac";
34
+
35
+
//Check to see if .net 6 is installed:
36
+
if(!Dotnet6Installed())
37
+
{
38
+
thrownewArgumentException("You are using a dotnet version older than dotnet 6. Compiling for osx-arm64 requires that dotnet 6 or greater is installed and targeted by your project.","osx-arm64");
39
+
}
40
+
41
+
//Warn for .net 6 targeting:
42
+
Console.WriteLine("Please ensure that your project targets .net 6 or greater. Otherwise you may experience an error compiling for osx-arm64.");
43
+
break;
30
44
case"linux":
31
45
netCorePublishRid="linux-x64";
32
46
electronPackerPlatform="linux";
@@ -48,8 +62,20 @@ public static GetTargetPlatformInformationResult Do(string desiredPlatform, stri
Copy file name to clipboardExpand all lines: README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,10 +137,13 @@ There are additional platforms available:
137
137
```
138
138
electronize build /target win
139
139
electronize build /target osx
140
+
electronize build /target osx-arm64
140
141
electronize build /target linux
141
142
```
142
143
143
-
Those three "default" targets will produce x64 packages for those platforms.
144
+
Those four "default" targets will produce packages for those platforms.
145
+
146
+
Note that the `osx-arm64` build requires that the project target `net6.0`. `osx-arm64` is for Apple Silicon Macs.
144
147
145
148
For certain NuGet packages or certain scenarios you may want to build a pure x86 application. To support those things you can define the desired [.NET Core runtime](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog), the [electron platform](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#platform) and [electron architecture](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#arch) like this:
0 commit comments