forked from TelegramMessenger/Telegram-iOS
-
Notifications
You must be signed in to change notification settings - Fork 11
/
prepare-build.sh
executable file
·52 lines (41 loc) · 1.15 KB
/
prepare-build.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
49
50
51
52
#!/bin/sh
set -e
APP_TARGET="$1"
if [ "$APP_TARGET" == "" ]; then
echo "Usage: sh prepare-build.sh app_target development|distribution"
exit 1
fi
BUILD_TYPE="$2"
case "$BUILD_TYPE" in
development)
PROFILES_TYPE="development"
;;
distribution)
PROFILES_TYPE="distribution"
;;
*)
echo "Unknown build provisioning type: $BUILD_TYPE"
exit 1
;;
esac
BASE_PATH=$(dirname $0)
COPY_PROVISIONING_PROFILES_SCRIPT="$BASE_PATH/copy-provisioning-profiles-$APP_TARGET.sh"
PREPARE_BUILD_VARIABLES_SCRIPT="$BASE_PATH/prepare-build-variables-$APP_TARGET.sh"
if [ ! -f "$COPY_PROVISIONING_PROFILES_SCRIPT" ]; then
echo "$COPY_PROVISIONING_PROFILES_SCRIPT not found"
exit 1
fi
if [ ! -f "$PREPARE_BUILD_VARIABLES_SCRIPT" ]; then
echo "$PREPARE_BUILD_VARIABLES_SCRIPT not found"
exit 1
fi
DATA_DIRECTORY="build-input/data"
rm -rf "$DATA_DIRECTORY"
mkdir -p "$DATA_DIRECTORY"
touch "$DATA_DIRECTORY/BUILD"
source "$COPY_PROVISIONING_PROFILES_SCRIPT"
source "$PREPARE_BUILD_VARIABLES_SCRIPT"
echo "Copying provisioning profiles..."
copy_provisioning_profiles "$PROFILES_TYPE"
echo "Preparing build variables..."
prepare_build_variables "$BUILD_TYPE"