Skip to content

Commit 0871f7b

Browse files
DavidMina96Ali Abdelfattah
andauthored
[MOB-9315] Adjust Hermes path for RN 0.69 onwards (#750)
* Fix Hermes path for RN 0.69 onwards * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Ali Abdelfattah <[email protected]> Co-authored-by: Ali Abdelfattah <[email protected]>
1 parent 750973f commit 0871f7b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* React Native 0.69 support
44
* Bumps the minimum supported React Native version to 0.60.0
55
* Drops manual linking support
6+
* Adjusts source maps auto upload script on Android to support the bundled Hermes in RN v0.69
67

78
## 11.0.2 (2022-07-20)
89

android/upload_sourcemap.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,16 @@ else
5757
*) echo "unknown: $OSTYPE" ;;
5858
esac
5959

60-
#Find HERMES command file name
60+
#Find hermes(c) binary file path
6161
INSTALLED_RN_VERSION_MAJOR=$(node -p "require('./node_modules/react-native/package.json').version" | cut -d "." -f2)
62-
if [ "$INSTALLED_RN_VERSION_MAJOR" -ge 63 ]
63-
then
64-
HERMES_COMMAND_NAME='hermesc'
65-
else
66-
HERMES_COMMAND_NAME='hermes'
67-
62+
if [ "$INSTALLED_RN_VERSION_MAJOR" -ge 69 ]
63+
then
64+
HERMES_PATH=node_modules/react-native/sdks/hermesc/$HERMES_OS_BIN/hermesc
65+
elif [ "$INSTALLED_RN_VERSION_MAJOR" -lt 63 ]
66+
then
67+
HERMES_PATH=node_modules/hermes-engine/$HERMES_OS_BIN/hermes
68+
else
69+
HERMES_PATH=node_modules/hermes-engine/$HERMES_OS_BIN/hermesc
6870
fi
6971
#Generate android sourcemap (HERMES)
7072
npx react-native bundle --platform android \
@@ -74,7 +76,7 @@ else
7476
--bundle-output index.android.bundle \
7577
--sourcemap-output index.android.bundle.packager.map \
7678

77-
node_modules/hermes-engine/$HERMES_OS_BIN/$HERMES_COMMAND_NAME -emit-binary -out index.android.bundle.hbc index.android.bundle -O -output-source-map > /dev/null 2>&1
79+
$HERMES_PATH -emit-binary -out index.android.bundle.hbc index.android.bundle -O -output-source-map > /dev/null 2>&1
7880

7981
cp index.android.bundle.hbc.map index.android.bundle.compiler.map
8082

0 commit comments

Comments
 (0)