-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-mac.sh
More file actions
executable file
·27 lines (21 loc) · 871 Bytes
/
build-mac.sh
File metadata and controls
executable file
·27 lines (21 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# https://avaloniaui.net/blog/the-definitive-guide-to-building-and-deploying-avalonia-applications-for-macos
PROJECT_NAME="$1"
OUTPUT_DIR="./WheelWizard/bin/Release/compiled"
build_for_arch() {
local arch=$1
echo "Building for $arch..."
dotnet publish -r osx-$arch -c Release /p:PublishSingleFile=true \
/p:IncludeAllContentForSelfExtract=true /p:IncludeNativeLibrariesForSelfExtract=true \
/p:EnableCompressionInSingleFile=true /p:PublishReadyToRun=true \
-p:UseAppHost=true --self-contained true -o "$OUTPUT_DIR/osx-$arch"
}
build_for_arch "x64"
build_for_arch "arm64"
echo "Creating universal binary..."
mkdir -p "$OUTPUT_DIR/Universal"
lipo -create \
"$OUTPUT_DIR/osx-x64/WheelWizard" \
"$OUTPUT_DIR/osx-arm64/WheelWizard" \
-output "$OUTPUT_DIR/Universal/WheelWizard"
echo "Universal binary created"