Skip to content

Commit d41ed34

Browse files
author
Ali Abdelfattah
authored
Merge pull request #646 from Instabug/fix/ios-build-variables-INSD-6153
[INSD-6153] Update iOS build variables required for source map upload
2 parents dc040df + 38e0bda commit d41ed34

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## master
2+
23
* Adds APM.endAppLaunch API
4+
* Fixes an issue with iOS sourcemap upload that causes the build to fail
35

46
## 10.9.1 (2021-10-13)
57

ios/upload_sourcemap.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,30 @@ elif [ -x "$(command -v brew)" ] && [ -s "$(brew --prefix nvm)/nvm.sh" ]; then
88
fi
99
export NODE_BINARY=node
1010

11+
if [ ! "$INFOPLIST_FILE" ] || [ -z "$INFOPLIST_FILE" ]; then
12+
echo "Instabug: INFOPLIST_FILE not found in Xcode build settings, skipping sourcemap upload"
13+
exit 0
14+
fi
15+
16+
if [ ! "${PROJECT_DIR}" ] || [ -z "${PROJECT_DIR}" ]; then
17+
echo "Instabug: PROJECT_DIR not found in Xcode build settings, skipping sourcemap upload"
18+
exit 0
19+
fi
20+
21+
PLIST_ABS_PATH="$PROJECT_DIR/$INFOPLIST_FILE"
22+
echo "Instabug: PLIST_ABS_PATH: $PLIST_ABS_PATH"
23+
1124
if [ ! "${INSTABUG_APP_TOKEN}" ] || [ -z "${INSTABUG_APP_TOKEN}" ]; then
1225
echo "Instabug: Looking for Token..."
1326
INSTABUG_APP_TOKEN=$(grep -r --exclude-dir={node_modules,ios,android} "Instabug.start[WithToken]*([\"\'][0-9a-zA-Z]*[\"\']" ./ -m 1 | grep -o "[\"\'][0-9a-zA-Z]*[\"\']" | cut -d "\"" -f 2 | cut -d "'" -f 2)
1427
fi
1528

1629
if [ ! "${INSTABUG_APP_TOKEN}" ] || [ -z "${INSTABUG_APP_TOKEN}" ]; then
17-
echo "Instabug: err: INSTABUG_APP_TOKEN not found. Make sure you've added the SDK initialization line Instabug.start Or added the environment variable INSTABUG_APP_TOKEN"
30+
echo "Instabug: INSTABUG_APP_TOKEN not found. Make sure you've added the SDK initialization line Instabug.start Or added the environment variable INSTABUG_APP_TOKEN"
1831
exit 0
1932
else
2033
if [ ! "${INSTABUG_APP_VERSION_CODE}" ] || [ -z "${INSTABUG_APP_VERSION_CODE}" ]; then
21-
INSTABUG_APP_VERSION_CODE=$(/usr/libexec/PlistBuddy -c 'print CFBundleVersion' ${PRODUCT_SETTINGS_PATH} )
34+
INSTABUG_APP_VERSION_CODE=$(/usr/libexec/PlistBuddy -c 'print CFBundleVersion' ${PLIST_ABS_PATH} )
2235
if [ ! "${INSTABUG_APP_VERSION_CODE}" ] || [ -z "${INSTABUG_APP_VERSION_CODE}" ]; then
2336
echo "CFBundleVersion could not be found, please upload the sourcemap files manually"
2437
exit 0
@@ -33,7 +46,7 @@ else
3346
fi
3447
fi
3548
if [ ! "${INSTABUG_APP_VERSION_NAME}" ] || [ -z "${INSTABUG_APP_VERSION_NAME}" ]; then
36-
INSTABUG_APP_VERSION_NAME=$(/usr/libexec/PlistBuddy -c 'print CFBundleShortVersionString' ${PRODUCT_SETTINGS_PATH} )
49+
INSTABUG_APP_VERSION_NAME=$(/usr/libexec/PlistBuddy -c 'print CFBundleShortVersionString' ${PLIST_ABS_PATH} )
3750
if [ ! "${INSTABUG_APP_VERSION_NAME}" ] || [ -z "${INSTABUG_APP_VERSION_NAME}" ]; then
3851
echo "CFBundleShortVersionString could not be found, please upload the sourcemap files manually"
3952
exit 0
@@ -48,7 +61,8 @@ else
4861
fi
4962
fi
5063
VERSION='{"code":"'"$INSTABUG_APP_VERSION_CODE"'","name":"'"$INSTABUG_APP_VERSION_NAME"'"}'
51-
echo "Instabug: Token found" "\""${INSTABUG_APP_TOKEN}"\""
64+
echo "Instabug: Token:" "\""${INSTABUG_APP_TOKEN}"\""
65+
echo "Instabug: VERSION: $VERSION"
5266
echo "Instabug: Generating sourcemap files..."
5367
#Generate ios sourcemap
5468
npx react-native bundle --platform ios \

0 commit comments

Comments
 (0)