Skip to content

Commit 750bd90

Browse files
a7medevAli Abdelfattah
andauthored
[MOB-8371] Dynamic entry file (#674)
* Enable dynamic entry file on Android * Enable dynamic entry file on iOS * Update CHANGELOG Co-authored-by: Ali Abdelfattah <[email protected]>
1 parent 8cfc300 commit 750bd90

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## master
2+
3+
* Adds dynamic entry file support
4+
15
## 10.13.0 (2022-03-17)
26

37
* Adds Instabug Experiments APIs

android/upload_sourcemap.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,21 @@ else
3232
exit 0
3333
fi
3434
fi
35+
if [ -z "${INSTABUG_ENTRY_FILE}" ]; then
36+
ENTRY_FILE='index.js'
37+
else
38+
ENTRY_FILE=${INSTABUG_ENTRY_FILE}
39+
fi
40+
if [ ! -f $ENTRY_FILE ]; then
41+
echo "Instabug: err: entry file not found. Make sure" "\"${ENTRY_FILE}\"" "exists in your projects root directory. Or add the environment variable INSTABUG_ENTRY_FILE with the name of your entry file"
42+
exit 0
43+
fi
44+
fi
3545
VERSION='{"code":"'"$INSTABUG_APP_VERSION_CODE"'","name":"'"$INSTABUG_APP_VERSION_NAME"'"}'
3646
echo "Instabug: Token found" "\""${INSTABUG_APP_TOKEN}"\""
3747
echo "Instabug: Version Code found" "\""${INSTABUG_APP_VERSION_CODE}"\""
3848
echo "Instabug: Version Name found" "\""${INSTABUG_APP_VERSION_NAME}"\""
49+
echo "Instabug: Entry file found" "\""${ENTRY_FILE}"\""
3950
echo "Instabug: Generating sourcemap files..."
4051
IS_HERMES=$(grep "enableHermes:" ./android/app/build.gradle -m 1)
4152
if [[ $IS_HERMES == *"true"* ]]; then
@@ -59,7 +70,7 @@ else
5970
#Generate android sourcemap (HERMES)
6071
npx react-native bundle --platform android \
6172
--reset-cache \
62-
--entry-file index.js \
73+
--entry-file $ENTRY_FILE \
6374
--dev false \
6475
--bundle-output index.android.bundle \
6576
--sourcemap-output index.android.bundle.packager.map \
@@ -78,7 +89,7 @@ else
7889
else
7990
#Generate android sourcemap
8091
npx react-native bundle --platform android \
81-
--entry-file index.js \
92+
--entry-file $ENTRY_FILE \
8293
--dev false \
8394
--bundle-output ./android/main.jsbundle \
8495
--sourcemap-output ./android-sourcemap.json

ios/upload_sourcemap.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,24 @@ else
6060
fi
6161
fi
6262
fi
63+
if [ -z "${INSTABUG_ENTRY_FILE}" ]; then
64+
ENTRY_FILE='index.js'
65+
else
66+
ENTRY_FILE=${INSTABUG_ENTRY_FILE}
67+
fi
68+
if [ ! -f $ENTRY_FILE ]; then
69+
echo "Instabug: err: entry file not found. Make sure" "\"${ENTRY_FILE}\"" "exists in your projects root directory. Or add the environment variable INSTABUG_ENTRY_FILE with the name of your entry file"
70+
exit 0
71+
fi
6372
VERSION='{"code":"'"$INSTABUG_APP_VERSION_CODE"'","name":"'"$INSTABUG_APP_VERSION_NAME"'"}'
6473
echo "Instabug: Token:" "\""${INSTABUG_APP_TOKEN}"\""
6574
echo "Instabug: VERSION: $VERSION"
75+
echo "Instabug: Entry file found" "\""${ENTRY_FILE}"\""
6676
echo "Instabug: Generating sourcemap files..."
77+
6778
#Generate ios sourcemap
6879
npx react-native bundle --platform ios \
69-
--entry-file index.js \
80+
--entry-file $ENTRY_FILE \
7081
--dev false \
7182
--bundle-output ./ios/main.jsbundle \
7283
--sourcemap-output ./ios-sourcemap.json

0 commit comments

Comments
 (0)