react-native-macos 0.76.9 → 0.76.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Blob/RCTBlobManager.h +0 -0
- package/Libraries/Blob/RCTBlobManager.mm +0 -0
- package/Libraries/Components/TextInput/TextInputState.js +5 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +0 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Lists/FillRateHelper.js +3 -3
- package/Libraries/Lists/FlatList.d.ts +1 -1
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/Lists/SectionList.d.ts +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +2 -2
- package/Libraries/Lists/ViewabilityHelper.js +3 -3
- package/Libraries/Lists/VirtualizeUtils.js +2 -2
- package/Libraries/Lists/VirtualizedList.js +3 -3
- package/Libraries/Lists/VirtualizedListContext.js +2 -2
- package/Libraries/Lists/VirtualizedSectionList.js +3 -3
- package/Libraries/Modal/Modal.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +0 -0
- package/Libraries/Text/Text.d.ts +1 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/React/Base/RCTJavaScriptLoader.h +0 -0
- package/React/Base/RCTJavaScriptLoader.mm +0 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTLogBoxView.mm +4 -1
- package/React/DevSupport/RCTPausedInDebuggerOverlayController.mm +82 -14
- package/React/Views/RCTViewKeyboardEvent.m +24 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/local-cli/cli.js +0 -0
- package/package.json +5 -4
- package/scripts/compose-source-maps.js +0 -0
- package/scripts/featureflags/README.md +156 -0
- package/scripts/featureflags/index.js +14 -0
- package/scripts/ios-configure-glog.sh +0 -0
- package/scripts/node-binary.sh +0 -0
- package/scripts/packager.sh +0 -0
- package/scripts/react-native-xcode.sh +0 -0
- package/scripts/react_native_pods_utils/script_phases.sh +0 -0
- package/scripts/xcode/ccache-clang++.sh +0 -0
- package/scripts/xcode/ccache-clang.sh +0 -0
- package/scripts/xcode/with-environment.sh +0 -0
- package/types/index.d.ts +1 -1
- package/scripts/cocoapods/autolinking.rb +0 -206
- package/scripts/cocoapods/autolinking_utils.rb +0 -25
- package/scripts/cocoapods/codegen.rb +0 -59
- package/scripts/cocoapods/codegen_script_phase_extractor.rb +0 -13
- package/scripts/cocoapods/codegen_utils.rb +0 -363
- package/scripts/cocoapods/fabric.rb +0 -18
- package/scripts/cocoapods/helpers.rb +0 -148
- package/scripts/cocoapods/jsengine.rb +0 -33
- package/scripts/cocoapods/local_podspec_patch.rb +0 -51
- package/scripts/cocoapods/new_architecture.rb +0 -193
- package/scripts/cocoapods/privacy_manifest_utils.rb +0 -194
- package/scripts/cocoapods/runtime.rb +0 -18
- package/scripts/cocoapods/spm.rb +0 -94
- package/scripts/cocoapods/utils.rb +0 -723
- package/scripts/codegen/codegen-utils.js +0 -51
- package/scripts/codegen/generate-artifacts-executor.js +0 -815
- package/scripts/codegen/generate-specs-cli-executor.js +0 -128
- package/scripts/codegen/templates/RCTModulesConformingToProtocolsProviderH.template +0 -18
- package/scripts/codegen/templates/RCTModulesConformingToProtocolsProviderMM.template +0 -33
- package/sdks/hermes-engine/hermes-engine.podspec +0 -161
- package/sdks/hermes-engine/hermes-utils.rb +0 -285
- package/sdks/hermes-engine/utils/build-apple-framework.sh +0 -225
- package/sdks/hermes-engine/utils/build-hermes-xcode.sh +0 -100
- package/sdks/hermes-engine/utils/build-hermesc-xcode.sh +0 -18
- package/sdks/hermes-engine/utils/build-ios-framework.sh +0 -85
- package/sdks/hermes-engine/utils/build-mac-framework.sh +0 -22
- package/sdks/hermes-engine/utils/copy-hermes-xcode.sh +0 -7
- package/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh +0 -32
- package/sdks/hermes-engine/utils/replace_hermes_version.js +0 -106
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
# Defines functions for building various Hermes frameworks.
|
|
8
|
-
# See build-ios-framework.sh and build-mac-framework.sh for usage examples.
|
|
9
|
-
|
|
10
|
-
CURR_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
11
|
-
|
|
12
|
-
IMPORT_HERMESC_PATH=${HERMES_OVERRIDE_HERMESC_PATH:-$PWD/build_host_hermesc/ImportHermesc.cmake}
|
|
13
|
-
BUILD_TYPE=${BUILD_TYPE:-Debug}
|
|
14
|
-
|
|
15
|
-
HERMES_PATH="$CURR_SCRIPT_DIR/.."
|
|
16
|
-
REACT_NATIVE_PATH=${REACT_NATIVE_PATH:-$CURR_SCRIPT_DIR/../../..}
|
|
17
|
-
|
|
18
|
-
NUM_CORES=$(sysctl -n hw.ncpu)
|
|
19
|
-
|
|
20
|
-
PLATFORMS=("macosx" "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator")
|
|
21
|
-
|
|
22
|
-
if [[ -z "$JSI_PATH" ]]; then
|
|
23
|
-
JSI_PATH="$REACT_NATIVE_PATH/ReactCommon/jsi"
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
function use_env_var_or_ruby_prop {
|
|
27
|
-
if [[ -n "$1" ]]; then
|
|
28
|
-
echo "$1"
|
|
29
|
-
else
|
|
30
|
-
ruby -rcocoapods-core -rjson -e "puts Pod::Specification.from_file('hermes-engine.podspec').$2"
|
|
31
|
-
fi
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function use_env_var {
|
|
35
|
-
if [[ -n "$1" ]]; then
|
|
36
|
-
echo "$1"
|
|
37
|
-
else
|
|
38
|
-
echo "error: Missing $2 environment variable"
|
|
39
|
-
exit 1
|
|
40
|
-
fi
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function get_release_version {
|
|
44
|
-
use_env_var_or_ruby_prop "${RELEASE_VERSION}" "version"
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function get_ios_deployment_target {
|
|
48
|
-
use_env_var "${IOS_DEPLOYMENT_TARGET}" "IOS_DEPLOYMENT_TARGET"
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function get_visionos_deployment_target {
|
|
52
|
-
use_env_var "${XROS_DEPLOYMENT_TARGET}" "XROS_DEPLOYMENT_TARGET"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function get_mac_deployment_target {
|
|
56
|
-
use_env_var "${MAC_DEPLOYMENT_TARGET}" "MAC_DEPLOYMENT_TARGET"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
# Build host hermes compiler for internal bytecode
|
|
60
|
-
function build_host_hermesc {
|
|
61
|
-
echo "Building hermesc"
|
|
62
|
-
pushd "$HERMES_PATH" > /dev/null || exit 1
|
|
63
|
-
cmake -S . -B build_host_hermesc -DJSI_DIR="$JSI_PATH"
|
|
64
|
-
cmake --build ./build_host_hermesc --target hermesc -j "${NUM_CORES}"
|
|
65
|
-
popd > /dev/null || exit 1
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
# Utility function to configure an Apple framework
|
|
69
|
-
function configure_apple_framework {
|
|
70
|
-
local enable_debugger cmake_build_type xcode_15_flags xcode_major_version
|
|
71
|
-
|
|
72
|
-
if [[ $BUILD_TYPE == "Debug" ]]; then
|
|
73
|
-
enable_debugger="true"
|
|
74
|
-
else
|
|
75
|
-
enable_debugger="false"
|
|
76
|
-
fi
|
|
77
|
-
if [[ $BUILD_TYPE == "Debug" ]]; then
|
|
78
|
-
# JS developers aren't VM developers.
|
|
79
|
-
# Therefore we're passing as build type Release, to provide a faster build.
|
|
80
|
-
cmake_build_type="Release"
|
|
81
|
-
else
|
|
82
|
-
cmake_build_type="MinSizeRel"
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
|
-
xcode_15_flags=""
|
|
86
|
-
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
87
|
-
if [[ $xcode_major_version -ge 15 ]]; then
|
|
88
|
-
xcode_15_flags="LINKER:-ld_classic"
|
|
89
|
-
fi
|
|
90
|
-
|
|
91
|
-
pushd "$HERMES_PATH" > /dev/null || exit 1
|
|
92
|
-
cmake -S . -B "build_$1" \
|
|
93
|
-
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
94
|
-
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$1" \
|
|
95
|
-
-DCMAKE_OSX_ARCHITECTURES:STRING="$2" \
|
|
96
|
-
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$3" \
|
|
97
|
-
-DHERMES_ENABLE_DEBUGGER:BOOLEAN="$enable_debugger" \
|
|
98
|
-
-DHERMES_ENABLE_INTL:BOOLEAN=true \
|
|
99
|
-
-DHERMES_ENABLE_LIBFUZZER:BOOLEAN=false \
|
|
100
|
-
-DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \
|
|
101
|
-
-DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \
|
|
102
|
-
-DHERMES_ENABLE_BITCODE:BOOLEAN=false \
|
|
103
|
-
-DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \
|
|
104
|
-
-DHERMES_BUILD_SHARED_JSI:BOOLEAN=false \
|
|
105
|
-
-DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \
|
|
106
|
-
-DIMPORT_HERMESC:PATH="$IMPORT_HERMESC_PATH" \
|
|
107
|
-
-DJSI_DIR="$JSI_PATH" \
|
|
108
|
-
-DHERMES_RELEASE_VERSION="for RN $(get_release_version)" \
|
|
109
|
-
-DCMAKE_BUILD_TYPE="$cmake_build_type"
|
|
110
|
-
popd > /dev/null || exit 1
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function build_host_hermesc_if_needed {
|
|
114
|
-
if [[ ! -f "$IMPORT_HERMESC_PATH" ]]; then
|
|
115
|
-
build_host_hermesc
|
|
116
|
-
else
|
|
117
|
-
echo "[HermesC] Skipping! Found an existent hermesc already at: $IMPORT_HERMESC_PATH"
|
|
118
|
-
fi
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
# Utility function to build an Apple framework
|
|
122
|
-
function build_apple_framework {
|
|
123
|
-
# Only build host HermesC if no file found at $IMPORT_HERMESC_PATH
|
|
124
|
-
build_host_hermesc_if_needed
|
|
125
|
-
|
|
126
|
-
# Confirm ImportHermesc.cmake is now available.
|
|
127
|
-
[ ! -f "$IMPORT_HERMESC_PATH" ] &&
|
|
128
|
-
echo "Host hermesc is required to build apple frameworks!"
|
|
129
|
-
|
|
130
|
-
# $1: platform, $2: architectures, $3: deployment target
|
|
131
|
-
echo "Building $BUILD_TYPE framework for $1 with architectures: $2"
|
|
132
|
-
configure_apple_framework "$1" "$2" "$3"
|
|
133
|
-
|
|
134
|
-
pushd "$HERMES_PATH" > /dev/null || exit 1
|
|
135
|
-
mkdir -p "destroot/Library/Frameworks/$1"
|
|
136
|
-
cmake --build "./build_$1" --target libhermes -j "${NUM_CORES}"
|
|
137
|
-
cp -R "./build_$1"/API/hermes/hermes.framework* "destroot/Library/Frameworks/$1"
|
|
138
|
-
|
|
139
|
-
# In a MacOS build, also produce the hermes and hermesc CLI tools.
|
|
140
|
-
if [[ $1 == macosx ]]; then
|
|
141
|
-
cmake --build "./build_$1" --target hermesc hermes -j "${NUM_CORES}"
|
|
142
|
-
mkdir -p destroot/bin
|
|
143
|
-
cp "./build_$1/bin"/* "destroot/bin"
|
|
144
|
-
fi
|
|
145
|
-
|
|
146
|
-
# Copy over Hermes and JSI API headers.
|
|
147
|
-
mkdir -p destroot/include/hermes/Public
|
|
148
|
-
cp public/hermes/Public/*.h destroot/include/hermes/Public
|
|
149
|
-
|
|
150
|
-
mkdir -p destroot/include/hermes
|
|
151
|
-
cp API/hermes/*.h destroot/include/hermes
|
|
152
|
-
|
|
153
|
-
mkdir -p destroot/include/hermes/cdp
|
|
154
|
-
cp API/hermes/cdp/*.h destroot/include/hermes/cdp
|
|
155
|
-
|
|
156
|
-
mkdir -p destroot/include/hermes/inspector
|
|
157
|
-
cp API/hermes/inspector/*.h destroot/include/hermes/inspector
|
|
158
|
-
|
|
159
|
-
mkdir -p destroot/include/hermes/inspector/chrome
|
|
160
|
-
cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome
|
|
161
|
-
|
|
162
|
-
mkdir -p destroot/include/jsi
|
|
163
|
-
cp "$JSI_PATH"/jsi/*.h destroot/include/jsi
|
|
164
|
-
popd > /dev/null || exit 1
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function prepare_dest_root_for_ci {
|
|
168
|
-
mkdir -p "destroot/bin"
|
|
169
|
-
for platform in "${PLATFORMS[@]}"; do
|
|
170
|
-
mkdir -p "destroot/Library/Frameworks/$platform"
|
|
171
|
-
cp -R "./build_$platform/API/hermes/hermes.framework"* "destroot/Library/Frameworks/$platform"
|
|
172
|
-
done
|
|
173
|
-
|
|
174
|
-
cp "./build_macosx/bin/"* "destroot/bin"
|
|
175
|
-
|
|
176
|
-
# Copy over Hermes and JSI API headers.
|
|
177
|
-
mkdir -p destroot/include/hermes/Public
|
|
178
|
-
cp public/hermes/Public/*.h destroot/include/hermes/Public
|
|
179
|
-
|
|
180
|
-
mkdir -p destroot/include/hermes
|
|
181
|
-
cp API/hermes/*.h destroot/include/hermes
|
|
182
|
-
|
|
183
|
-
mkdir -p destroot/include/hermes/cdp
|
|
184
|
-
cp API/hermes/cdp/*.h destroot/include/hermes/cdp
|
|
185
|
-
|
|
186
|
-
mkdir -p destroot/include/hermes/inspector
|
|
187
|
-
cp API/hermes/inspector/*.h destroot/include/hermes/inspector
|
|
188
|
-
|
|
189
|
-
mkdir -p destroot/include/hermes/inspector/chrome
|
|
190
|
-
cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome
|
|
191
|
-
|
|
192
|
-
mkdir -p destroot/include/jsi
|
|
193
|
-
cp "$JSI_PATH"/jsi/*.h destroot/include/jsi
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
# Accepts an array of frameworks and will place all of
|
|
197
|
-
# the architectures into an universal folder and then remove
|
|
198
|
-
# the merged frameworks from destroot
|
|
199
|
-
function create_universal_framework {
|
|
200
|
-
pushd "$HERMES_PATH/destroot/Library/Frameworks" > /dev/null || exit 1
|
|
201
|
-
|
|
202
|
-
local platforms=("$@")
|
|
203
|
-
local args=""
|
|
204
|
-
|
|
205
|
-
echo "Creating universal framework for platforms: ${platforms[*]}"
|
|
206
|
-
|
|
207
|
-
for i in "${!platforms[@]}"; do
|
|
208
|
-
local platform="${platforms[$i]}"
|
|
209
|
-
local hermes_framework_path="${platform}/hermes.framework"
|
|
210
|
-
args+="-framework $hermes_framework_path "
|
|
211
|
-
done
|
|
212
|
-
|
|
213
|
-
mkdir -p universal
|
|
214
|
-
# shellcheck disable=SC2086
|
|
215
|
-
if xcodebuild -create-xcframework $args -output "universal/hermes.xcframework"
|
|
216
|
-
then
|
|
217
|
-
# # Remove the thin iOS hermes.frameworks that are now part of the universal
|
|
218
|
-
# XCFramework
|
|
219
|
-
for platform in "${platforms[@]}"; do
|
|
220
|
-
rm -r "$platform"
|
|
221
|
-
done
|
|
222
|
-
fi
|
|
223
|
-
|
|
224
|
-
popd > /dev/null || exit 1
|
|
225
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
set -x
|
|
8
|
-
|
|
9
|
-
release_version="$1"; shift
|
|
10
|
-
hermesc_path="$1"; shift
|
|
11
|
-
jsi_path="$1"; shift
|
|
12
|
-
|
|
13
|
-
# Based on platform name returns the framework copy destination. Used later by `vendored_frameworks` in Podspec.
|
|
14
|
-
# Fallbacks to "ios" if platform is not recognized.
|
|
15
|
-
function get_platform_copy_destination {
|
|
16
|
-
if [[ $1 == "macosx" ]]; then
|
|
17
|
-
echo "macosx"
|
|
18
|
-
return
|
|
19
|
-
elif [[ $1 == "xros" || $1 == "xrsimulator" ]]; then
|
|
20
|
-
echo "xros"
|
|
21
|
-
return
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
echo "ios"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function get_deployment_target {
|
|
28
|
-
if [[ $1 == "macosx" ]]; then
|
|
29
|
-
echo "${MACOSX_DEPLOYMENT_TARGET}"
|
|
30
|
-
return
|
|
31
|
-
elif [[ $1 == "xrsimulator" || $1 == "xros" ]]; then
|
|
32
|
-
echo "${XROS_DEPLOYMENT_TARGET}"
|
|
33
|
-
return
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
echo "${IPHONEOS_DEPLOYMENT_TARGET}"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
enable_debugger="false"
|
|
40
|
-
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
|
41
|
-
enable_debugger="true"
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
cmake_build_type=""
|
|
45
|
-
if [[ $CONFIGURATION == "Debug" ]]; then
|
|
46
|
-
# JS developers aren't VM developers.
|
|
47
|
-
# Therefore we're passing as build type Release, to provide a faster build.
|
|
48
|
-
cmake_build_type="Release"
|
|
49
|
-
else
|
|
50
|
-
cmake_build_type="MinSizeRel"
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
deployment_target=$(get_deployment_target $PLATFORM_NAME)
|
|
54
|
-
|
|
55
|
-
xcode_15_flags=""
|
|
56
|
-
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
57
|
-
if [[ $xcode_major_version -ge 15 ]]; then
|
|
58
|
-
echo "########### Using LINKER:-ld_classic ###########"
|
|
59
|
-
xcode_15_flags="LINKER:-ld_classic"
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
architectures=$( echo "$ARCHS" | tr " " ";" )
|
|
63
|
-
|
|
64
|
-
echo "Configure Apple framework"
|
|
65
|
-
|
|
66
|
-
"$CMAKE_BINARY" \
|
|
67
|
-
-S "${PODS_ROOT}/hermes-engine" \
|
|
68
|
-
-B "${PODS_ROOT}/hermes-engine/build/${PLATFORM_NAME}" \
|
|
69
|
-
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
70
|
-
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$PLATFORM_NAME" \
|
|
71
|
-
-DCMAKE_OSX_ARCHITECTURES:STRING="$architectures" \
|
|
72
|
-
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$deployment_target" \
|
|
73
|
-
-DHERMES_ENABLE_DEBUGGER:BOOLEAN="$enable_debugger" \
|
|
74
|
-
-DHERMES_ENABLE_INTL:BOOLEAN=true \
|
|
75
|
-
-DHERMES_ENABLE_LIBFUZZER:BOOLEAN=false \
|
|
76
|
-
-DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \
|
|
77
|
-
-DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \
|
|
78
|
-
-DHERMES_ENABLE_BITCODE:BOOLEAN=false \
|
|
79
|
-
-DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \
|
|
80
|
-
-DHERMES_BUILD_SHARED_JSI:BOOLEAN=false \
|
|
81
|
-
-DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \
|
|
82
|
-
-DIMPORT_HERMESC:PATH="${hermesc_path}" \
|
|
83
|
-
-DJSI_DIR="$jsi_path" \
|
|
84
|
-
-DHERMES_RELEASE_VERSION="for RN $release_version" \
|
|
85
|
-
-DCMAKE_BUILD_TYPE="$cmake_build_type"
|
|
86
|
-
|
|
87
|
-
echo "Build Apple framework"
|
|
88
|
-
|
|
89
|
-
"$CMAKE_BINARY" \
|
|
90
|
-
--build "${PODS_ROOT}/hermes-engine/build/${PLATFORM_NAME}" \
|
|
91
|
-
--target libhermes \
|
|
92
|
-
-j "$(sysctl -n hw.ncpu)"
|
|
93
|
-
|
|
94
|
-
echo "Copy Apple framework to destroot/Library/Frameworks"
|
|
95
|
-
|
|
96
|
-
platform_copy_destination=$(get_platform_copy_destination $PLATFORM_NAME)
|
|
97
|
-
|
|
98
|
-
cp -pfR \
|
|
99
|
-
"${PODS_ROOT}/hermes-engine/build/${PLATFORM_NAME}/API/hermes/hermes.framework" \
|
|
100
|
-
"${PODS_ROOT}/hermes-engine/destroot/Library/Frameworks/${platform_copy_destination}"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
set -x -e
|
|
8
|
-
|
|
9
|
-
hermesc_dir_path="$1"; shift
|
|
10
|
-
jsi_path="$1"
|
|
11
|
-
|
|
12
|
-
# This script is supposed to be executed from Xcode "run script" phase.
|
|
13
|
-
# Xcode sets up its build environment based on the build target (iphone, iphonesimulator, macodsx).
|
|
14
|
-
# We want to make sure that hermesc is built for mac.
|
|
15
|
-
# So we clean the environment with env -i, and explicitly set SDKROOT to macosx
|
|
16
|
-
SDKROOT=$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
|
|
17
|
-
env -i SDKROOT="$SDKROOT" "$CMAKE_BINARY" -S "${PODS_ROOT}/hermes-engine" -B "$hermesc_dir_path" -DJSI_DIR="$jsi_path"
|
|
18
|
-
env -i SDKROOT="$SDKROOT" "$CMAKE_BINARY" --build "$hermesc_dir_path" --target hermesc -j "$(sysctl -n hw.ncpu)"
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
if [ "$CI" ]; then
|
|
8
|
-
set -x
|
|
9
|
-
fi
|
|
10
|
-
set -e
|
|
11
|
-
|
|
12
|
-
# Given a specific target, retrieve the right architecture for it
|
|
13
|
-
# $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator
|
|
14
|
-
function get_architecture {
|
|
15
|
-
if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
|
|
16
|
-
echo "arm64"
|
|
17
|
-
elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then
|
|
18
|
-
echo "x86_64;arm64"
|
|
19
|
-
elif [[ $1 == "catalyst" ]]; then
|
|
20
|
-
echo "x86_64;arm64"
|
|
21
|
-
else
|
|
22
|
-
echo "Error: unknown architecture passed $1"
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function get_deployment_target {
|
|
28
|
-
if [[ $1 == "xros" || $1 == "xrsimulator" ]]; then
|
|
29
|
-
echo "$(get_visionos_deployment_target)"
|
|
30
|
-
else
|
|
31
|
-
echo "$(get_ios_deployment_target)"
|
|
32
|
-
fi
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
# build a single framework
|
|
36
|
-
# $1 is the target to build
|
|
37
|
-
function build_framework {
|
|
38
|
-
if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
|
|
39
|
-
deployment_target=$(get_deployment_target "$1")
|
|
40
|
-
|
|
41
|
-
architecture=$(get_architecture "$1")
|
|
42
|
-
|
|
43
|
-
build_apple_framework "$1" "$architecture" "$deployment_target"
|
|
44
|
-
else
|
|
45
|
-
echo "Skipping; Clean \"destroot\" to rebuild".
|
|
46
|
-
fi
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
# group the frameworks together to create a universal framework
|
|
50
|
-
function build_universal_framework {
|
|
51
|
-
if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
|
|
52
|
-
create_universal_framework "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator"
|
|
53
|
-
else
|
|
54
|
-
echo "Skipping; Clean \"destroot\" to rebuild".
|
|
55
|
-
fi
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
# single function that builds sequentially iphoneos, iphonesimulator and catalyst
|
|
59
|
-
# this is used to preserve backward compatibility
|
|
60
|
-
function create_framework {
|
|
61
|
-
if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
|
|
62
|
-
build_framework "iphoneos"
|
|
63
|
-
build_framework "iphonesimulator"
|
|
64
|
-
build_framework "catalyst"
|
|
65
|
-
build_framework "xros"
|
|
66
|
-
build_framework "xrsimulator"
|
|
67
|
-
|
|
68
|
-
build_universal_framework
|
|
69
|
-
else
|
|
70
|
-
echo "Skipping; Clean \"destroot\" to rebuild".
|
|
71
|
-
fi
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
CURR_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
76
|
-
# shellcheck source=xplat/js/react-native-github/sdks/hermes-engine/utils/build-apple-framework.sh
|
|
77
|
-
. "${CURR_SCRIPT_DIR}/build-apple-framework.sh"
|
|
78
|
-
|
|
79
|
-
if [[ -z $1 ]]; then
|
|
80
|
-
create_framework
|
|
81
|
-
elif [[ $1 == "build_framework" ]]; then
|
|
82
|
-
build_universal_framework
|
|
83
|
-
else
|
|
84
|
-
build_framework "$1"
|
|
85
|
-
fi
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
if [ "$CI" ]; then
|
|
8
|
-
set -x
|
|
9
|
-
fi
|
|
10
|
-
set -e
|
|
11
|
-
|
|
12
|
-
# shellcheck source=xplat/js/react-native-github/sdks/hermes-engine/utils/build-apple-framework.sh
|
|
13
|
-
CURR_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
14
|
-
. "${CURR_SCRIPT_DIR}/build-apple-framework.sh"
|
|
15
|
-
|
|
16
|
-
if [ ! -d destroot/Library/Frameworks/macosx/hermes.framework ]; then
|
|
17
|
-
mac_deployment_target=$(get_mac_deployment_target)
|
|
18
|
-
|
|
19
|
-
build_apple_framework "macosx" "x86_64;arm64" "$mac_deployment_target"
|
|
20
|
-
else
|
|
21
|
-
echo "Skipping; Clean \"destroot\" to rebuild".
|
|
22
|
-
fi
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
echo "This file is no-op now. Remove \"[RN] Copy Hermes Framework\" script phase from your main target if you don't want to see this message."
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
set -x
|
|
8
|
-
|
|
9
|
-
# CocoaPods requires vendored frameworks to exist before `pod install` is run,
|
|
10
|
-
# and to be proper Moch-O binaries in order to auto-link them to the user's Xcode project.
|
|
11
|
-
# This script creates dummy hermes.framework for macosx and ios.
|
|
12
|
-
# They are then get rewritten by `build-hermes-xcode.sh` during Xcode build.
|
|
13
|
-
|
|
14
|
-
rm -rf destroot
|
|
15
|
-
|
|
16
|
-
mkdir -p destroot/Library/Frameworks
|
|
17
|
-
|
|
18
|
-
pushd destroot/Library/Frameworks > /dev/null || exit 1
|
|
19
|
-
|
|
20
|
-
echo '' > dummy.c
|
|
21
|
-
|
|
22
|
-
platforms=( "macosx" "ios" "xros" ) # Add other platforms here if needed
|
|
23
|
-
|
|
24
|
-
for platform in "${platforms[@]}"
|
|
25
|
-
do
|
|
26
|
-
mkdir -p "${platform}/hermes.framework"
|
|
27
|
-
clang dummy.c -dynamiclib -o "${platform}/hermes.framework/hermes"
|
|
28
|
-
done
|
|
29
|
-
|
|
30
|
-
rm dummy.c
|
|
31
|
-
|
|
32
|
-
popd > /dev/null || exit 1
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const {execSync} = require('child_process');
|
|
13
|
-
const fs = require('fs');
|
|
14
|
-
const yargs = require('yargs');
|
|
15
|
-
|
|
16
|
-
const LAST_BUILD_FILENAME = '.last_build_configuration';
|
|
17
|
-
|
|
18
|
-
function validateBuildConfiguration(configuration) {
|
|
19
|
-
if (!['Debug', 'Release'].includes(configuration)) {
|
|
20
|
-
throw new Error(`Invalid configuration ${configuration}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function validateVersion(version) {
|
|
25
|
-
if (version == null || version === '') {
|
|
26
|
-
throw new Error('Version cannot be empty');
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function shouldReplaceHermesConfiguration(configuration) {
|
|
31
|
-
const fileExists = fs.existsSync(LAST_BUILD_FILENAME);
|
|
32
|
-
|
|
33
|
-
if (fileExists) {
|
|
34
|
-
console.log(`Found ${LAST_BUILD_FILENAME} file`);
|
|
35
|
-
const oldConfiguration = fs.readFileSync(LAST_BUILD_FILENAME).toString();
|
|
36
|
-
if (oldConfiguration === configuration) {
|
|
37
|
-
console.log(
|
|
38
|
-
'Same config of the previous build. No need to replace Hermes engine',
|
|
39
|
-
);
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Assumption: if there is no stored last build, we assume that it was build for debug.
|
|
45
|
-
if (!fileExists && configuration === 'Debug') {
|
|
46
|
-
console.log(
|
|
47
|
-
'No previous build detected, but Debug Configuration. No need to replace Hermes engine',
|
|
48
|
-
);
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function replaceHermesConfiguration(configuration, version, podsRoot) {
|
|
56
|
-
const tarballURLPath = `${podsRoot}/hermes-engine-artifacts/hermes-ios-${version.toLowerCase()}-${configuration.toLowerCase()}.tar.gz`;
|
|
57
|
-
|
|
58
|
-
const finalLocation = 'hermes-engine';
|
|
59
|
-
console.log('Preparing the final location');
|
|
60
|
-
fs.rmSync(finalLocation, {force: true, recursive: true});
|
|
61
|
-
fs.mkdirSync(finalLocation, {recursive: true});
|
|
62
|
-
|
|
63
|
-
console.log('Extracting the tarball');
|
|
64
|
-
execSync(`tar -xf ${tarballURLPath} -C ${finalLocation}`);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function updateLastBuildConfiguration(configuration) {
|
|
68
|
-
fs.writeFileSync(LAST_BUILD_FILENAME, configuration);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function main(configuration, version, podsRoot) {
|
|
72
|
-
validateBuildConfiguration(configuration);
|
|
73
|
-
validateVersion(version);
|
|
74
|
-
|
|
75
|
-
if (!shouldReplaceHermesConfiguration(configuration)) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
replaceHermesConfiguration(configuration, version, podsRoot);
|
|
80
|
-
updateLastBuildConfiguration(configuration);
|
|
81
|
-
console.log('Done replacing hermes-engine');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// This script is executed in the Pods folder, which is usually not synched to Github, so it should be ok
|
|
85
|
-
const argv = yargs
|
|
86
|
-
.option('c', {
|
|
87
|
-
alias: 'configuration',
|
|
88
|
-
description:
|
|
89
|
-
'Configuration to use to download the right Hermes version. Allowed values are "Debug" and "Release".',
|
|
90
|
-
})
|
|
91
|
-
.option('r', {
|
|
92
|
-
alias: 'reactNativeVersion',
|
|
93
|
-
description:
|
|
94
|
-
'The Version of React Native associated with the Hermes tarball.',
|
|
95
|
-
})
|
|
96
|
-
.option('p', {
|
|
97
|
-
alias: 'podsRoot',
|
|
98
|
-
description: 'The path to the Pods root folder',
|
|
99
|
-
})
|
|
100
|
-
.usage('Usage: $0 -c Debug -r <version> -p <path/to/react-native>').argv;
|
|
101
|
-
|
|
102
|
-
const configuration = argv.configuration;
|
|
103
|
-
const version = argv.reactNativeVersion;
|
|
104
|
-
const podsRoot = argv.podsRoot;
|
|
105
|
-
|
|
106
|
-
main(configuration, version, podsRoot);
|