forked from codemerx/CodemerxDecompile
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdist.macos.sh
More file actions
executable file
·116 lines (97 loc) · 3.29 KB
/
dist.macos.sh
File metadata and controls
executable file
·116 lines (97 loc) · 3.29 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(cd "$(dirname "$0")" && pwd)"
cd "$script_dir"
echo "=== ProjectRover macOS Universal Binary Build ==="
echo
# Kill any lingering dotnet processes to release file locks
echo "[0/6] Cleaning up lingering processes..."
killall dotnet 2>/dev/null || true
sleep 1
# Clean previous builds
echo "[1/6] Cleaning previous build artifacts..."
rm -rf src/ProjectRover/bin/Release src/ProjectRover/obj ProjectRover.app
find . -name "packages.lock.json" -delete
# Build ARM64
echo "[2/6] Building ARM64 (Apple Silicon)..."
if ! dotnet restore ./src/ProjectRover/ProjectRover.csproj -r osx-arm64 --force-evaluate -q; then
echo "❌ ARM64 restore failed"
exit 1
fi
if ! dotnet publish ./src/ProjectRover/ProjectRover.csproj \
-r osx-arm64 \
-c Release \
--no-restore \
-p:PublishSingleFile=false \
-p:PublishTrimmed=false \
--self-contained; then
echo "❌ ARM64 publish failed"
exit 1
fi
if [ ! -f "src/ProjectRover/bin/Release/net10.0/osx-arm64/publish/ProjectRover" ]; then
echo "❌ ARM64 binary not found"
exit 1
fi
echo " ✓ ARM64 binary created"
# Build x64
echo "[3/6] Building x64 (Intel)..."
find . -name "packages.lock.json" -delete
# Kill any remaining processes and wait
killall dotnet 2>/dev/null || true
sleep 2
# Clean obj directories more aggressively to release file locks
find thirdparty -type d -name "obj" -exec rm -rf {} + 2>/dev/null || true
find src -type d -name "obj" -exec rm -rf {} + 2>/dev/null || true
if ! dotnet restore ./src/ProjectRover/ProjectRover.csproj -r osx-x64 --force-evaluate -q; then
echo "❌ x64 restore failed"
exit 1
fi
if ! dotnet publish ./src/ProjectRover/ProjectRover.csproj \
-r osx-x64 \
-c Release \
--no-restore \
-p:PublishSingleFile=false \
-p:PublishTrimmed=false \
--self-contained; then
echo "❌ x64 publish failed"
exit 1
fi
if [ ! -f "src/ProjectRover/bin/Release/net10.0/osx-x64/publish/ProjectRover" ]; then
echo "❌ x64 binary not found"
exit 1
fi
echo " ✓ x64 binary created"
echo "[4/7] Creating universal application bundle..."
if ! ./build/macos/build-application-bundle.sh osx-universal; then
echo "❌ Failed to create universal bundle"
exit 1
fi
echo "[5/7] Verifying universal binary..."
if file ProjectRover.app/Contents/MacOS/ProjectRover | grep -q "universal binary"; then
echo " ✓ Universal binary verified (both x86_64 and arm64)"
else
echo "❌ Binary is not a universal binary"
exit 1
fi
echo "[6/7] Building DMG package..."
if ! ./build/macos/build-dmg.sh ProjectRover.app ProjectRover-macos-universal.dmg images/social.png; then
echo "❌ Failed to create DMG package"
exit 1
fi
echo " ✓ DMG package created"
echo "[7/7] Cleaning up temporary artifacts..."
rm -rf src/ProjectRover/bin src/ProjectRover/obj
find . -name "packages.lock.json" -delete
echo
echo "✅ Universal macOS application bundle created successfully!"
echo
echo "📍 Location: $(pwd)/ProjectRover.app"
echo "📍 DMG: $(pwd)/ProjectRover-macos-universal.dmg"
echo
echo "🚀 To run the app:"
echo " open ProjectRover.app"
echo " # or"
echo " ./ProjectRover.app/Contents/MacOS/ProjectRover"
echo
echo "📦 To distribute, create a tarball:"
echo " tar -czf ProjectRover-macos-universal.tar.gz ProjectRover.app"