Skip to content

Commit

Permalink
WIP – Use Hermes directly from the RN pods when creating the tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Jul 18, 2023
1 parent b6df921 commit a5f1d5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion ios-xcframework/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ function archive {
SKIP_INSTALL=NO
}

# Fail early if the expected Hermes XCFramework that should be bundled with React Native cannot be found
HERMES_XCFRAMEWORK=./Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework
if [ ! -d $HERMES_XCFRAMEWORK ]; then
log 'fail' "Could not file required Hermes XCFramework at path: $HERMES_XCFRAMEWORK"
exit 1
fi

BUILD_DIR=./build
DERIVED_DATA_PATH="$BUILD_DIR/derived_data"
ARCHIVES_ROOT="$BUILD_DIR/archives"
Expand Down Expand Up @@ -92,7 +99,7 @@ do
FRAMEWORK_RELATIVE_PATH="Products/Library/Frameworks/$CURRENT_FRAMEWORK_NAME.framework"

if [[ $CURRENT_FRAMEWORK_NAME = 'hermes' ]]; then
log 'no_good' "Skipping creating XCFramework for $CURRENT_FRAMEWORK_NAME"
log 'no_good' "Skipping creating XCFramework for $CURRENT_FRAMEWORK_NAME, we'll use the one bundled with React Native"
continue
fi

Expand Down Expand Up @@ -143,6 +150,7 @@ cp -r "$XCFRAMEWORKS_DIR/Gutenberg.xcframework" "$ARCHIVE_FRAMEWORKS_PATH"
cp -r "$XCFRAMEWORKS_DIR/React.xcframework" "$ARCHIVE_FRAMEWORKS_PATH"
cp -r "$XCFRAMEWORKS_DIR/RNTAztecView.xcframework" "$ARCHIVE_FRAMEWORKS_PATH"
cp -r "$XCFRAMEWORKS_DIR/yoga.xcframework" "$ARCHIVE_FRAMEWORKS_PATH"
cp -r "$HERMES_XCFRAMEWORK" "$ARCHIVE_FRAMEWORKS_PATH"

ARCHIVE_PATH="$XCFRAMEWORKS_DIR/$MAIN_FRAMEWORK_NAME.tar.gz"

Expand Down
3 changes: 2 additions & 1 deletion ios-xcframework/podspec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Pod::Spec.new do |s|
'Frameworks/Gutenberg.xcframework',
'Frameworks/React.xcframework',
'Frameworks/RNTAztecView.xcframework',
'Frameworks/yoga.xcframework'
'Frameworks/yoga.xcframework',
'Frameworks/hermes.xcframework'
]
end

0 comments on commit a5f1d5f

Please sign in to comment.