forked from mapsme/omim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·79 lines (72 loc) · 2.47 KB
/
configure.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
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
#!/bin/sh
# Please run this script to configure the repository after cloning it.
# Stop on the first error.
set -e -u
BASE_PATH=`dirname "$0"`
PRIVATE_HEADER="$BASE_PATH/private.h"
PRIVATE_PROPERTIES="$BASE_PATH/android/secure.properties"
PRIVATE_FABRIC_PROPERTIES="$BASE_PATH/android/fabric.properties"
PRIVATE_PUSHWOOSH_PROPERTIES="$BASE_PATH/android/pushwoosh.properties"
SAVED_PRIVATE_REPO_FILE="$BASE_PATH/.private_repository_url"
TMP_REPO_DIR="$BASE_PATH/.tmp.private.repo"
if [ ! -f "$BASE_PATH/omim.pro" ]; then
echo "Please run this script from the root repository folder."
exit -1
fi
if [ -f "$SAVED_PRIVATE_REPO_FILE" ]; then
PRIVATE_REPO=`cat "$SAVED_PRIVATE_REPO_FILE"`
echo "Using stored private repository URL: $PRIVATE_REPO"
else
echo "If you are developer from MAPS.ME team, please specify a private repository url here."
echo "If not [yet :)], then just press Enter."
echo -n "> "
read PRIVATE_REPO
if [ -z "$PRIVATE_REPO" ]; then
echo "Initializing repository with default values in Open-Source mode."
echo '
#pragma once
#define ALOHALYTICS_URL ""
#define FLURRY_KEY "12345678901234567890"
#define MY_TRACKER_KEY ""
#define MY_TARGET_KEY ""
#define PUSHWOOSH_APPLICATION_ID ""
#define OSM_CONSUMER_KEY ""
#define OSM_CONSUMER_SECRET ""
#define MWM_GEOLOCATION_SERVER ""
#define OSRM_ONLINE_SERVER_URL ""
#define RESOURCES_METASERVER_URL ""
#define METASERVER_URL ""
#define DEFAULT_URLS_JSON ""
#define AD_PERMISION_SERVER_URL ""
#define AD_PERMISION_CHECK_DURATION 2 * 60 * 60
#define HOCKEY_APP_KEY ""
#define HOCKEY_APP_BETA_KEY ""
#define CRASHLYTICS_IOS_KEY ""
#define BOOKING_AFFILIATE_ID ""
#define BOOKING_KEY ""
#define BOOKING_SECRET ""
' > "$PRIVATE_HEADER"
echo 'ext {
spropStoreFile = "../tools/android/debug.keystore"
spropStorePassword = "12345678"
spropKeyAlias = "debug"
spropKeyPassword = "12345678"
}
' > "$PRIVATE_PROPERTIES"
echo 'apiSecret=0000000000000000000000000000000000000000000000000000000000000000
apiKey=0000000000000000000000000000000000000000
' > "$PRIVATE_FABRIC_PROPERTIES"
echo 'pwAppId=XXXXX
pwProjectId=A123456789012
' > "$PRIVATE_PUSHWOOSH_PROPERTIES"
exit
fi
fi
if git clone --depth 1 "$PRIVATE_REPO" "$TMP_REPO_DIR"; then
echo "Saved private repository url to $SAVED_PRIVATE_REPO_FILE"
echo "$PRIVATE_REPO" > "$SAVED_PRIVATE_REPO_FILE"
rm -rf "$TMP_REPO_DIR/.git" "$TMP_REPO_DIR/README.md"
cp -Rv "$TMP_REPO_DIR"/* "$BASE_PATH"
rm -rf "$TMP_REPO_DIR"
echo "Private files have been updated."
fi