-
Notifications
You must be signed in to change notification settings - Fork 895
/
Copy pathbuild-mac.sh
48 lines (30 loc) · 960 Bytes
/
build-mac.sh
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
#!/bin/sh
set -e
set -x
BUILD_CONFIGURATION=$1
PWDPATH=$PWD
CPPATH="../../../../../build-${BUILD_CONFIGURATION}"
PROJECT="${CPPATH}/telegrammacos"
rsync -av --progress ../telegrammacos $CPPATH > /dev/null
cd $PROJECT
cd ..
files_to_remove=$(ls -A | grep -v telegrammacos || true)
if [ -n "$files_to_remove" ]; then
rm -r $files_to_remove
else
echo "No files to remove."
fi
rm -r telegrammacos.xcarchive || true
cd telegrammacos
sh "scripts/configure_frameworks.sh"
cp "configurations/${BUILD_CONFIGURATION}.xcconfig" "Telegram-Mac/Release.xcconfig"
xcodebuild archive -workspace "Telegram-Mac.xcworkspace" \
-scheme Release \
-configuration Release \
-archivePath ./
cd ..
archive="./telegrammacos.xcarchive"
appname="Telegram.app"
cp -R "${archive}/Products/Applications/Telegram.app" ${appname}
cp -R "${archive}/dSYMs/Telegram.app.dSYM" ${appname}.dSYM
ditto -c -k --sequesterRsrc --keepParent ${appname}.dSYM ${appname}.DSYM.zip