mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-04-25 07:30:32 +00:00
merge #624
This commit is contained in:
@@ -27,6 +27,10 @@ namespace ElectronNET.CLI.Commands.Actions
|
||||
netCorePublishRid = "osx-x64";
|
||||
electronPackerPlatform = "mac";
|
||||
break;
|
||||
case "osx-arm64":
|
||||
netCorePublishRid = "osx-arm64";
|
||||
electronPackerPlatform = "mac";
|
||||
break;
|
||||
case "linux":
|
||||
netCorePublishRid = "linux-x64";
|
||||
electronPackerPlatform = "linux";
|
||||
@@ -46,12 +50,22 @@ namespace ElectronNET.CLI.Commands.Actions
|
||||
netCorePublishRid = $"win-x{(Environment.Is64BitOperatingSystem ? "64" : "86")}";
|
||||
electronPackerPlatform = "win";
|
||||
}
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
netCorePublishRid = "osx-x64";
|
||||
electronPackerPlatform = "mac";
|
||||
if (RuntimeInformation.OSArchitecture.Equals(Architecture.Arm64))
|
||||
{
|
||||
//Apple Silicon Mac:
|
||||
netCorePublishRid = "osx-arm64";
|
||||
electronPackerPlatform = "mac";
|
||||
}
|
||||
else
|
||||
{
|
||||
//Intel Mac:
|
||||
netCorePublishRid = "osx-x64";
|
||||
electronPackerPlatform = "mac";
|
||||
}
|
||||
}
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
netCorePublishRid = "linux-x64";
|
||||
electronPackerPlatform = "linux";
|
||||
|
||||
@@ -178,6 +178,12 @@ Full example for a 32bit debug build with electron prune: build /target custom w
|
||||
Console.WriteLine("Executing electron magic in this directory: " + buildPath);
|
||||
|
||||
string electronArch = "x64";
|
||||
|
||||
if (platformInfo.NetCorePublishRid == "osx-arm64") //Apple Silicon Mac
|
||||
{
|
||||
electronArch = "arm64";
|
||||
}
|
||||
|
||||
if (parser.Arguments.ContainsKey(_paramElectronArch))
|
||||
{
|
||||
electronArch = parser.Arguments[_paramElectronArch][0];
|
||||
|
||||
@@ -137,10 +137,11 @@ There are additional platforms available:
|
||||
```
|
||||
electronize build /target win
|
||||
electronize build /target osx
|
||||
electronize build /target osx-arm64
|
||||
electronize build /target linux
|
||||
```
|
||||
|
||||
Those three "default" targets will produce x64 packages for those platforms.
|
||||
Those four "default" targets will produce packages for those platforms. Note that the `osx-arm64` is for Apple Silicon Macs.
|
||||
|
||||
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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user