mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
85
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46b269dd46 | ||
|
|
0e56bce6ba | ||
|
|
d0c94d6de1 | ||
|
|
28d171993e | ||
|
|
7484e72210 | ||
|
|
58bbbff4d7 | ||
|
|
c45d450502 | ||
|
|
e1d97f4621 | ||
|
|
f303bcaaa5 | ||
|
|
2e06efbf5d | ||
|
|
4cec121a7b | ||
|
|
95fa0dcdc8 | ||
|
|
58a525aa2f | ||
|
|
2373a0003a | ||
|
|
d4eb12f48a | ||
|
|
593ddc7109 | ||
|
|
273df72301 | ||
|
|
b8b9e9ee7d | ||
|
|
50643a300c | ||
|
|
b1b41470e0 | ||
|
|
65975fe37b | ||
|
|
09152303d7 | ||
|
|
af3402c019 | ||
|
|
a2022aff95 | ||
|
|
2617ec5570 | ||
|
|
625d330ed9 | ||
|
|
2d42024d21 | ||
|
|
83a2086548 | ||
|
|
1630b5c743 | ||
|
|
7db3ebe2d1 | ||
|
|
15b55714eb | ||
|
|
2ab13798f9 | ||
|
|
07420ea5a2 | ||
|
|
173587f5ec | ||
|
|
75584641be | ||
|
|
f86bc9512f | ||
|
|
3252855e1d | ||
|
|
89073d46bd | ||
|
|
6bd418b738 | ||
|
|
1f10d62700 | ||
|
|
f938e3214c | ||
|
|
668358c47a | ||
|
|
4783de7a40 | ||
|
|
865aaeda58 | ||
|
|
2a0c175135 | ||
|
|
6a155dd1cf | ||
|
|
52db082576 | ||
|
|
9120930288 | ||
|
|
c9f335a568 | ||
|
|
38b1ddebd5 | ||
|
|
a300a2c057 | ||
|
|
1c0a4e72b1 | ||
|
|
50503b08f8 | ||
|
|
453e00a017 | ||
|
|
fafc71b5cb | ||
|
|
98b302e219 | ||
|
|
7aa3396f53 | ||
|
|
fee2156642 | ||
|
|
534fdc0005 | ||
|
|
609c7c05b1 | ||
|
|
5f11ed9e43 | ||
|
|
1d69fe9d23 | ||
|
|
63d1a1e5eb | ||
|
|
6c1374e065 | ||
|
|
abd96c21ec | ||
|
|
375c88478c | ||
|
|
daf9b29d05 | ||
|
|
c2ebb30389 | ||
|
|
f4b1dd1fa1 | ||
|
|
a0c83803e8 | ||
|
|
528097709a | ||
|
|
efa1e5375a | ||
|
|
d524c151cd | ||
|
|
1481140e68 | ||
|
|
03591318fb | ||
|
|
56e1c8bfdd | ||
|
|
1b891357b2 | ||
|
|
e36b46f0c9 | ||
|
|
b236f9bd82 | ||
|
|
44d4190581 | ||
|
|
88c136ed36 | ||
|
|
e56d4f9528 | ||
|
|
20ca94b0d3 | ||
|
|
37e8fa113e | ||
|
|
492a0c1292 |
@@ -96,8 +96,6 @@ jobs:
|
||||
- run:
|
||||
name: "Run Tests: JavaScript Tests"
|
||||
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
|
||||
- run_e2e:
|
||||
platform: js
|
||||
|
||||
# Optionally, run disabled tests
|
||||
- when:
|
||||
@@ -327,9 +325,9 @@ jobs:
|
||||
destination: rntester-apk
|
||||
|
||||
# -------------------------
|
||||
# JOBS: Test Android Template
|
||||
# JOBS: Test Android HelloWorld
|
||||
# -------------------------
|
||||
test_android_template:
|
||||
test_android_helloworld:
|
||||
executor: reactnativeandroid-large
|
||||
parameters:
|
||||
flavor:
|
||||
@@ -348,37 +346,37 @@ jobs:
|
||||
type: enum
|
||||
enum: ["Hermes", "JSC"]
|
||||
environment:
|
||||
- LC_ALL: C.UTF8
|
||||
- PROJECT_NAME: "AndroidTemplateProject"
|
||||
- YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||
- TARGET_ARCHITECTURE: "arm64-v8a"
|
||||
steps:
|
||||
- checkout_code_with_cache
|
||||
- run_yarn
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Create Android template project
|
||||
name: Build codegen js scripts from flow -> JS
|
||||
command: |
|
||||
REPO_ROOT=$(pwd)
|
||||
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$REPO_ROOT/build/$(cat build/react-native-package-version)\"}"
|
||||
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
|
||||
cd packages/react-native-codegen
|
||||
yarn run build
|
||||
- with_gradle_cache:
|
||||
steps:
|
||||
- run:
|
||||
name: Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
|
||||
name: Build the Helloworld application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
|
||||
command: |
|
||||
cd /tmp/$PROJECT_NAME/android/
|
||||
if [[ << parameters.architecture >> == "NewArch" ]]; then
|
||||
export ORG_GRADLE_PROJECT_newArchEnabled=true
|
||||
else
|
||||
export ORG_GRADLE_PROJECT_newArchEnabled=false
|
||||
cd packages/helloworld/android
|
||||
args=()
|
||||
if [[ << parameters.architecture >> == "OldArch" ]]; then
|
||||
args+=(--arch old)
|
||||
fi
|
||||
if [[ << parameters.jsengine >> == "Hermes" ]]; then
|
||||
export ORG_GRADLE_PROJECT_hermesEnabled=true
|
||||
else
|
||||
export ORG_GRADLE_PROJECT_hermesEnabled=false
|
||||
if [[ << parameters.jsengine >> == "JSC" ]]; then
|
||||
args+=(--jsvm jsc)
|
||||
fi
|
||||
./gradlew assemble<< parameters.flavor >> -Preact.internal.mavenLocalRepo=/root/react-native/maven-local
|
||||
|
||||
if [[ << parameters.flavor >> == "Release" ]]; then
|
||||
args+=(--prod)
|
||||
fi
|
||||
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE"
|
||||
- store_artifacts:
|
||||
path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/
|
||||
destination: template-apk
|
||||
|
||||
@@ -46,14 +46,16 @@
|
||||
- test_android:
|
||||
requires:
|
||||
- build_android
|
||||
- test_android_template:
|
||||
requires:
|
||||
- build_npm_package
|
||||
matrix:
|
||||
parameters:
|
||||
architecture: ["NewArch", "OldArch"]
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
flavor: ["Debug", "Release"]
|
||||
## Disabled to land removing react-native/template. Re-enable once switched over
|
||||
## to Helloworld.
|
||||
# - test_android_template:
|
||||
# requires:
|
||||
# - build_npm_package
|
||||
# matrix:
|
||||
# parameters:
|
||||
# architecture: ["NewArch", "OldArch"]
|
||||
# jsengine: ["Hermes", "JSC"]
|
||||
# flavor: ["Debug", "Release"]
|
||||
- test_ios_helloworld:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
|
||||
@@ -43,15 +43,16 @@
|
||||
- build_hermesc_linux
|
||||
- build_hermes_macos
|
||||
- build_hermesc_windows
|
||||
- test_android:
|
||||
requires:
|
||||
- build_android
|
||||
# - test_e2e_android
|
||||
- test_android_template:
|
||||
requires:
|
||||
- build_npm_package
|
||||
matrix:
|
||||
parameters:
|
||||
architecture: ["NewArch", "OldArch"]
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
flavor: ["Debug", "Release"]
|
||||
## Disabled to land removing react-native/template. Re-enable once switched over
|
||||
## to Helloworld.
|
||||
# - test_android:
|
||||
# requires:
|
||||
# - build_android
|
||||
# - test_android_template:
|
||||
# requires:
|
||||
# - build_npm_package
|
||||
# matrix:
|
||||
# parameters:
|
||||
# architecture: ["NewArch", "OldArch"]
|
||||
# jsengine: ["Hermes", "JSC"]
|
||||
# flavor: ["Debug", "Release"]
|
||||
|
||||
@@ -15,67 +15,6 @@
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
# Release workflow, triggered by `yarn trigger-react-native-release`
|
||||
create_release:
|
||||
when: << pipeline.parameters.run_release_workflow >>
|
||||
jobs:
|
||||
- prepare_release:
|
||||
name: prepare_release
|
||||
version: << pipeline.parameters.release_version >>
|
||||
monorepo_packages_version: << pipeline.parameters.release_monorepo_packages_version >>
|
||||
tag: << pipeline.parameters.release_tag >>
|
||||
dry_run: << pipeline.parameters.release_dry_run >>
|
||||
|
||||
# This job will run only when a tag is published due to all the jobs being filtered.
|
||||
publish_release:
|
||||
jobs:
|
||||
- prepare_hermes_workspace:
|
||||
filters: *only_release_tags
|
||||
- build_android:
|
||||
filters: *only_release_tags
|
||||
name: build_android_for_release
|
||||
release_type: "release"
|
||||
- build_hermesc_linux:
|
||||
filters: *only_release_tags
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_hermesc_apple:
|
||||
filters: *only_release_tags
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_apple_slices_hermes:
|
||||
filters: *only_release_tags
|
||||
requires:
|
||||
- build_hermesc_apple
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
|
||||
- build_hermesc_windows:
|
||||
filters: *only_release_tags
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_hermes_macos:
|
||||
filters: *only_release_tags
|
||||
requires:
|
||||
- build_apple_slices_hermes
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
# This job will trigger when a version tag is pushed (by package_release)
|
||||
- build_npm_package:
|
||||
name: build_and_publish_npm_package
|
||||
release_type: "release"
|
||||
filters: *only_release_tags
|
||||
requires:
|
||||
- build_android_for_release
|
||||
- build_hermesc_linux
|
||||
- build_hermes_macos
|
||||
- build_hermesc_windows
|
||||
- poll_maven:
|
||||
requires:
|
||||
- build_and_publish_npm_package
|
||||
|
||||
analysis:
|
||||
when:
|
||||
and:
|
||||
|
||||
@@ -84,5 +84,5 @@ runs:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ inputs.hermes-version }}-${{ github.run_number }}
|
||||
key: v1-hermes-${{ inputs.hermes-version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
@@ -1,11 +1,27 @@
|
||||
name: create_release
|
||||
description: Creates a new React Native release
|
||||
inputs:
|
||||
version:
|
||||
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
|
||||
required: true
|
||||
is_latest_on_npm:
|
||||
description: "Whether we want to tag this release as latest on NPM"
|
||||
required: true
|
||||
default: "false"
|
||||
dry_run:
|
||||
description: "Whether the job should be executed in dry-run mode or not"
|
||||
default: "false"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Yarn install
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
- name: Configure Git
|
||||
shell: bash
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Creating release commit
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -23,7 +39,7 @@ runs:
|
||||
git tag -a "latest" -m "latest"
|
||||
- name: Pushing release commit
|
||||
shell: bash
|
||||
if: ${{ inputs.dry_run == false }}
|
||||
if: ${{ inputs.dry_run == 'false' }}
|
||||
run: |
|
||||
CURR_BRANCH="$(git branch --show-current)"
|
||||
git push origin "$CURR_BRANCH" --follow-tags
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
name: prepare-hermes-workspace
|
||||
description: This action prepares the hermes workspace with the right hermes and react-native versions.
|
||||
inputs:
|
||||
HERMES_WS_DIR:
|
||||
required: true
|
||||
description: The hermes dir we need to use to setup the workspace
|
||||
HERMES_VERSION_FILE:
|
||||
required: true
|
||||
description: the path to the file that will contain the hermes version
|
||||
BUILD_FROM_SOURCE:
|
||||
description: Whether we need to build from source or not
|
||||
default: true
|
||||
outputs:
|
||||
hermes-version:
|
||||
description: the version of Hermes tied to this run
|
||||
value: ${{ steps.hermes-version.outputs.VERSION }}
|
||||
react-native-version:
|
||||
description: the version of React Native tied to this run
|
||||
value: ${{ steps.react-native-version.outputs.VERSION }}
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Setup hermes version
|
||||
shell: bash
|
||||
id: hermes-version
|
||||
run: |
|
||||
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
|
||||
|
||||
if [ -f "$HERMES_VERSION_FILE" ]; then
|
||||
echo "Hermes Version file found! Using this version for the build:"
|
||||
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Hermes Version file not found!!!"
|
||||
echo "Using the last commit from main for the build:"
|
||||
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
|
||||
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "Hermes commit is $HERMES_TAG_SHA"
|
||||
|
||||
- name: Get react-native version
|
||||
shell: bash
|
||||
id: react-native-version
|
||||
run: |
|
||||
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
|
||||
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "React Native Version is $VERSION"
|
||||
|
||||
- name: Cache hermes workspace
|
||||
id: restore-hermes
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
# It happened while testing that a cache was created from the right folders
|
||||
# but those folders where empty. Thus, the next check ensures that we can work with those caches.
|
||||
- name: Check if cache was meaningful
|
||||
id: meaningful-cache
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ -d /tmp/hermes/hermes ]] && [[ -n "$(ls -A /tmp/hermes/hermes)" ]]; then
|
||||
echo "Found a good hermes cache"
|
||||
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
|
||||
- name: Download Hermes tarball
|
||||
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
|
||||
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
|
||||
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
|
||||
|
||||
echo ${{ steps.hermes-version.outputs.version }}
|
||||
|
||||
- name: Upload Hermes artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
|
||||
enableCrossOsArchive: true
|
||||
+7
-2
@@ -1,8 +1,13 @@
|
||||
name: setup_hermes_workspace
|
||||
description: "Setup hermes workspace"
|
||||
name: restore-hermes-workspace
|
||||
description: "Restore hermes workspace that has been created in Prepare Hermes Workspace"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: /tmp/hermes
|
||||
- name: Set up workspace
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -45,17 +45,20 @@ runs:
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Create Hermes folder
|
||||
shell: bash
|
||||
run: mkdir -p "$HERMES_WS_DIR"
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
hermes-version: ${{ inputs.hermes-version }}
|
||||
react-native-version: ${{ inputs.react-native-version }}
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/
|
||||
- name: Print Downloaded hermes
|
||||
shell: bash
|
||||
run: ls -lR "$HERMES_WS_DIR"
|
||||
- name: Run yarn
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1.170.0
|
||||
with:
|
||||
@@ -78,6 +81,17 @@ runs:
|
||||
args+=(--jsvm jsc)
|
||||
yarn bootstrap ios "${args[@]}" | cat
|
||||
else
|
||||
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
|
||||
# Let's ensure that the tarballs have the right names
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
|
||||
fi
|
||||
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
|
||||
@@ -87,6 +101,7 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
cd packages/helloworld
|
||||
|
||||
args=()
|
||||
if [[ ${{ inputs.flavor }} == "Release" ]]; then
|
||||
args+=(--prod)
|
||||
|
||||
@@ -38,12 +38,11 @@ runs:
|
||||
- name: Run yarn
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
hermes-version: ${{ inputs.hermes-version }}
|
||||
react-native-version: ${{ inputs.react-native-version }}
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: ${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1.170.0
|
||||
with:
|
||||
@@ -82,6 +81,7 @@ runs:
|
||||
if [[ -e $TARBALL_PATH ]]; then
|
||||
tar -xf $TARBALL_PATH
|
||||
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
|
||||
chmod +x ./destroot/bin/hermes
|
||||
./destroot/bin/hermes test.js
|
||||
rm test.js
|
||||
rm -rf destroot
|
||||
|
||||
@@ -18,11 +18,13 @@ on:
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
prepare_release:
|
||||
create_release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
- name: Check if on stable branch
|
||||
id: check_stable_branch
|
||||
run: |
|
||||
@@ -46,3 +48,7 @@ jobs:
|
||||
- name: Execute Prepare Release
|
||||
if: ${{ steps.check_stable_branch.outputs.ON_STABLE_BRANCH && !steps.check_if_tag_exists.outputs.TAG_EXISTS }}
|
||||
uses: ./.github/actions/create-release
|
||||
with:
|
||||
version: ${{ inputs.version }}
|
||||
is_latest_on_npm: ${{ inputs.is_latest_on_npm }}
|
||||
dry_run: ${{ inputs.dry_run }}
|
||||
|
||||
+130
-135
@@ -28,54 +28,19 @@ jobs:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
BUILD_FROM_SOURCE: true
|
||||
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
|
||||
outputs:
|
||||
react-native-version: ${{ steps.react-native-version.outputs.version }}
|
||||
hermes-version: ${{ steps.hermes-version.outputs.version }}
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup hermes version
|
||||
id: hermes-version
|
||||
run: |
|
||||
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
|
||||
|
||||
if [ -f "$HERMES_VERSION_FILE" ]; then
|
||||
echo "Hermes Version file found! Using this version for the build:"
|
||||
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Hermes Version file not found!!!"
|
||||
echo "Using the last commit from main for the build:"
|
||||
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
|
||||
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "Hermes commit is $HERMES_TAG_SHA"
|
||||
- name: Get react-native version
|
||||
id: react-native-version
|
||||
run: |
|
||||
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
|
||||
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "React Native Version is $VERSION"
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache@v4.0.0
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Yarn- Install Dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Download Hermes tarball
|
||||
run: |
|
||||
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
|
||||
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
|
||||
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
|
||||
|
||||
echo ${{ steps.hermes-version.outputs.version }}
|
||||
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
|
||||
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
|
||||
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
|
||||
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-13
|
||||
@@ -86,18 +51,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Hermes apple cache
|
||||
uses: actions/cache@v4.0.0
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
@@ -106,6 +63,18 @@ jobs:
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
. ./utils/build-apple-framework.sh
|
||||
build_host_hermesc_if_needed
|
||||
- name: Upload HermesC Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Cache hermesc apple
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
@@ -114,6 +83,9 @@ jobs:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "13.4"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -125,33 +97,20 @@ jobs:
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore HermesC Artifact
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
FLAVOR="${{ matrix.flavor }}"
|
||||
echo "Flavor is $FLAVOR"
|
||||
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
|
||||
DSYM="/tmp/hermes/dSYM/$FLAVOR"
|
||||
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
|
||||
|
||||
if [[ -d "$OSX_BIN" ]] && \
|
||||
[[ -d "$DSYM" ]] && \
|
||||
[[ -f "$HERMES" ]]; then
|
||||
|
||||
echo "Artifacts are there!"
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Restore Slice From Cache
|
||||
id: restore-slice-cache
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
SLICE=${{ matrix.slice }}
|
||||
@@ -169,11 +128,20 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
# HermesC is used to build hermes, so it has to be executable
|
||||
chmod +x ./build_host_hermesc/bin/hermesc
|
||||
|
||||
if [[ "$SLICE" == "macosx" ]]; then
|
||||
echo "[HERMES] Building Hermes for MacOS"
|
||||
|
||||
chmod +x ./utils/build-mac-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
|
||||
else
|
||||
echo "[HERMES] Building Hermes for iOS: $SLICE"
|
||||
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
|
||||
fi
|
||||
|
||||
@@ -195,9 +163,14 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- name: Save slice cache
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
uses: actions/cache/save@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
@@ -220,14 +193,16 @@ jobs:
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
key: v2-hermes-osx-bin-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
@@ -246,46 +221,46 @@ jobs:
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: yarn install --non-interactive
|
||||
- name: Slice cache macosx
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Move back build folders
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
ls -l ./packages/react-native/sdks/hermes
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
@@ -296,19 +271,23 @@ jobs:
|
||||
mv build_xros_${{ matrix.flavor }} build_xros
|
||||
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
|
||||
- name: Prepare destroot folder
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
chmod +x ./utils/build-apple-framework.sh
|
||||
. ./utils/build-apple-framework.sh
|
||||
prepare_dest_root_for_ci
|
||||
- name: Create fat framework for iOS
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
echo "[HERMES] Creating the universal framework"
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
./utils/build-ios-framework.sh build_framework
|
||||
|
||||
chmod +x ./destroot/bin/hermesc
|
||||
- name: Package the Hermes Apple frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
BUILD_TYPE="${{ matrix.flavor }}"
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
@@ -332,18 +311,8 @@ jobs:
|
||||
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
ls -lR /tmp/hermes/osx-bin/
|
||||
- name: Upload darwin artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Upload osx-bin
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin
|
||||
- name: Create dSYM archive
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
FLAVOR=${{ matrix.flavor }}
|
||||
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
|
||||
@@ -375,10 +344,32 @@ jobs:
|
||||
with:
|
||||
name: hermes-dSYM-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
- name: Upload hermes Runtime artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Upload hermes osx artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
- name: Upload Hermes Artifacts
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v2-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
@@ -387,12 +378,8 @@ jobs:
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client cmake build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
@@ -426,18 +413,25 @@ jobs:
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
@@ -548,6 +542,7 @@ jobs:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
compression-level: 0
|
||||
|
||||
build_npm_package:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
|
||||
@@ -578,12 +573,12 @@ jobs:
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Release
|
||||
path: /tmp/hermes/osx-bin
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
- name: Download osx-bin debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Debug
|
||||
path: /tmp/hermes/osx-bin
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
- name: Download darwin-bin release artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
name: Publish release
|
||||
|
||||
name: Publish Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v0.[0-9]+.[0-9]+(-*)?" # This should match v0.X.Y and v0.X.Y-RC.0
|
||||
- "v0.*.*" # This should match v0.X.Y
|
||||
- "v0.*.*-rc.*" # This should match v0.X.Y-RC.0
|
||||
jobs:
|
||||
set_release_type:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -25,54 +25,19 @@ jobs:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
BUILD_FROM_SOURCE: true
|
||||
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
|
||||
outputs:
|
||||
react-native-version: ${{ steps.react-native-version.outputs.version }}
|
||||
hermes-version: ${{ steps.hermes-version.outputs.version }}
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup hermes version
|
||||
id: hermes-version
|
||||
run: |
|
||||
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
|
||||
|
||||
if [ -f "$HERMES_VERSION_FILE" ]; then
|
||||
echo "Hermes Version file found! Using this version for the build:"
|
||||
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Hermes Version file not found!!!"
|
||||
echo "Using the last commit from main for the build:"
|
||||
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
|
||||
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "Hermes commit is $HERMES_TAG_SHA"
|
||||
- name: Get react-native version
|
||||
id: react-native-version
|
||||
run: |
|
||||
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
|
||||
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "React Native Version is $VERSION"
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache@v4.0.0
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Yarn- Install Dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Download Hermes tarball
|
||||
run: |
|
||||
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
|
||||
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
|
||||
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
|
||||
|
||||
echo ${{ steps.hermes-version.outputs.version }}
|
||||
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
|
||||
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
|
||||
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
|
||||
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-13
|
||||
@@ -83,18 +48,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Hermes apple cache
|
||||
uses: actions/cache@v4.0.0
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
@@ -103,6 +60,18 @@ jobs:
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
. ./utils/build-apple-framework.sh
|
||||
build_host_hermesc_if_needed
|
||||
- name: Upload HermesC Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Cache hermesc apple
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
@@ -111,6 +80,9 @@ jobs:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "13.4"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -122,33 +94,20 @@ jobs:
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore HermesC Artifact
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
FLAVOR="${{ matrix.flavor }}"
|
||||
echo "Flavor is $FLAVOR"
|
||||
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
|
||||
DSYM="/tmp/hermes/dSYM/$FLAVOR"
|
||||
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
|
||||
|
||||
if [[ -d "$OSX_BIN" ]] && \
|
||||
[[ -d "$DSYM" ]] && \
|
||||
[[ -f "$HERMES" ]]; then
|
||||
|
||||
echo "Artifacts are there!"
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Restore Slice From Cache
|
||||
id: restore-slice-cache
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
SLICE=${{ matrix.slice }}
|
||||
@@ -166,11 +125,20 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
# HermesC is used to build hermes, so it has to be executable
|
||||
chmod +x ./build_host_hermesc/bin/hermesc
|
||||
|
||||
if [[ "$SLICE" == "macosx" ]]; then
|
||||
echo "[HERMES] Building Hermes for MacOS"
|
||||
|
||||
chmod +x ./utils/build-mac-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
|
||||
else
|
||||
echo "[HERMES] Building Hermes for iOS: $SLICE"
|
||||
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
|
||||
fi
|
||||
|
||||
@@ -192,9 +160,14 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- name: Save slice cache
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
uses: actions/cache/save@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
@@ -217,14 +190,16 @@ jobs:
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
key: v2-hermes-osx-bin-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
@@ -243,46 +218,46 @@ jobs:
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: yarn install --non-interactive
|
||||
- name: Slice cache macosx
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Move back build folders
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
ls -l ./packages/react-native/sdks/hermes
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
@@ -293,19 +268,23 @@ jobs:
|
||||
mv build_xros_${{ matrix.flavor }} build_xros
|
||||
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
|
||||
- name: Prepare destroot folder
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
chmod +x ./utils/build-apple-framework.sh
|
||||
. ./utils/build-apple-framework.sh
|
||||
prepare_dest_root_for_ci
|
||||
- name: Create fat framework for iOS
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
echo "[HERMES] Creating the universal framework"
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
./utils/build-ios-framework.sh build_framework
|
||||
|
||||
chmod +x ./destroot/bin/hermesc
|
||||
- name: Package the Hermes Apple frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
BUILD_TYPE="${{ matrix.flavor }}"
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
@@ -329,18 +308,8 @@ jobs:
|
||||
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
ls -lR /tmp/hermes/osx-bin/
|
||||
- name: Upload darwin artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Upload osx-bin
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin
|
||||
- name: Create dSYM archive
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
FLAVOR=${{ matrix.flavor }}
|
||||
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
|
||||
@@ -372,10 +341,32 @@ jobs:
|
||||
with:
|
||||
name: hermes-dSYM-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
- name: Upload hermes Runtime artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Upload hermes osx artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
- name: Upload Hermes Artifacts
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v2-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
@@ -384,12 +375,8 @@ jobs:
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client cmake build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
@@ -423,18 +410,25 @@ jobs:
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
@@ -515,7 +509,9 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Set React Native Version
|
||||
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
run: |
|
||||
git config --global --add safe.directory /__w/react-native/react-native
|
||||
node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
- name: Build and publish all the Android Artifacts to /tmp/maven-local
|
||||
@@ -576,12 +572,12 @@ jobs:
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Release
|
||||
path: /tmp/hermes/osx-bin
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
- name: Download osx-bin debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Debug
|
||||
path: /tmp/hermes/osx-bin
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
- name: Download darwin-bin release artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
|
||||
+131
-137
@@ -2,6 +2,7 @@ name: Test All
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@@ -36,52 +37,18 @@ jobs:
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
BUILD_FROM_SOURCE: true
|
||||
outputs:
|
||||
react-native-version: ${{ steps.react-native-version.outputs.version }}
|
||||
hermes-version: ${{ steps.hermes-version.outputs.version }}
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup hermes version
|
||||
id: hermes-version
|
||||
run: |
|
||||
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
|
||||
|
||||
if [ -f "$HERMES_VERSION_FILE" ]; then
|
||||
echo "Hermes Version file found! Using this version for the build:"
|
||||
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Hermes Version file not found!!!"
|
||||
echo "Using the last commit from main for the build:"
|
||||
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
|
||||
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "Hermes commit is $HERMES_TAG_SHA"
|
||||
- name: Get react-native version
|
||||
id: react-native-version
|
||||
run: |
|
||||
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
|
||||
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "React Native Version is $VERSION"
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache@v4.0.0
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Yarn- Install Dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Download Hermes tarball
|
||||
run: |
|
||||
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
|
||||
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
|
||||
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
|
||||
|
||||
echo ${{ steps.hermes-version.outputs.version }}
|
||||
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
|
||||
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
|
||||
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
|
||||
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-13
|
||||
@@ -92,18 +59,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Hermes apple cache
|
||||
uses: actions/cache@v4.0.0
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
@@ -112,6 +71,18 @@ jobs:
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
. ./utils/build-apple-framework.sh
|
||||
build_host_hermesc_if_needed
|
||||
- name: Upload HermesC Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Cache hermesc apple
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
@@ -120,6 +91,9 @@ jobs:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "13.4"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -131,30 +105,19 @@ jobs:
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore HermesC Artifact
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
FLAVOR="${{ matrix.flavor }}"
|
||||
echo "Flavor is $FLAVOR"
|
||||
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
|
||||
DSYM="/tmp/hermes/dSYM/$FLAVOR"
|
||||
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
|
||||
|
||||
if [[ -d "$OSX_BIN" ]] && \
|
||||
[[ -d "$DSYM" ]] && \
|
||||
[[ -f "$HERMES" ]]; then
|
||||
|
||||
echo "Artifacts are there!"
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
fi
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Restore Slice From Cache
|
||||
id: restore-slice-cache
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
@@ -173,11 +136,20 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
# HermesC is used to build hermes, so it has to be executable
|
||||
chmod +x ./build_host_hermesc/bin/hermesc
|
||||
|
||||
if [[ "$SLICE" == "macosx" ]]; then
|
||||
echo "[HERMES] Building Hermes for MacOS"
|
||||
|
||||
chmod +x ./utils/build-mac-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
|
||||
else
|
||||
echo "[HERMES] Building Hermes for iOS: $SLICE"
|
||||
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
|
||||
fi
|
||||
|
||||
@@ -199,8 +171,14 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- name: Save slice cache
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
uses: actions/cache/save@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
@@ -223,14 +201,16 @@ jobs:
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Setup Hermes workspace
|
||||
uses: ./.github/actions/setup_hermes_workspace
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
@@ -249,45 +229,46 @@ jobs:
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: yarn install --non-interactive
|
||||
- name: Slice cache macosx
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
uses: actions/cache@v4.0.0
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Move back build folders
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
ls -l ./packages/react-native/sdks/hermes
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
@@ -298,19 +279,23 @@ jobs:
|
||||
mv build_xros_${{ matrix.flavor }} build_xros
|
||||
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
|
||||
- name: Prepare destroot folder
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
chmod +x ./utils/build-apple-framework.sh
|
||||
. ./utils/build-apple-framework.sh
|
||||
prepare_dest_root_for_ci
|
||||
- name: Create fat framework for iOS
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
echo "[HERMES] Creating the universal framework"
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
./utils/build-ios-framework.sh build_framework
|
||||
|
||||
chmod +x ./destroot/bin/hermesc
|
||||
- name: Package the Hermes Apple frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
BUILD_TYPE="${{ matrix.flavor }}"
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
@@ -334,18 +319,8 @@ jobs:
|
||||
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
ls -lR /tmp/hermes/osx-bin/
|
||||
- name: Upload darwin artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Upload osx-bin
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin
|
||||
- name: Create dSYM archive
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
FLAVOR=${{ matrix.flavor }}
|
||||
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
|
||||
@@ -377,6 +352,25 @@ jobs:
|
||||
with:
|
||||
name: hermes-dSYM-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
- name: Upload hermes Runtime artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Upload hermes osx artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
- name: Upload Hermes Artifacts
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
|
||||
test_ios_rntester_ruby_3_2_0:
|
||||
runs-on: macos-13
|
||||
@@ -446,6 +440,9 @@ jobs:
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
@@ -454,12 +451,8 @@ jobs:
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client cmake build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
@@ -493,18 +486,25 @@ jobs:
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
@@ -651,12 +651,12 @@ jobs:
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Release
|
||||
path: /tmp/hermes/osx-bin
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
- name: Download osx-bin debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Debug
|
||||
path: /tmp/hermes/osx-bin
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
- name: Download darwin-bin release artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
@@ -689,12 +689,6 @@ jobs:
|
||||
path: /tmp/hermes/linux64-bin
|
||||
- name: Show /tmp/hermes directory
|
||||
run: ls -lR /tmp/hermes
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Copy Hermes binaries
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -798,7 +792,7 @@ jobs:
|
||||
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
|
||||
|
||||
test_android_helloworld:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: 4-core-ubuntu
|
||||
needs: prepare_hermes_workspace
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
|
||||
+4
-3
@@ -48,8 +48,8 @@
|
||||
"@definitelytyped/dtslint": "^0.0.127",
|
||||
"@jest/create-cache-key-function": "^29.6.3",
|
||||
"@pkgjs/parseargs": "^0.11.0",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-main",
|
||||
"@react-native/metro-config": "0.75.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-rc.5",
|
||||
"@react-native/metro-config": "0.75.0-rc.5",
|
||||
"@tsconfig/node18": "1.0.1",
|
||||
"@types/react": "^18.2.6",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
@@ -103,5 +103,6 @@
|
||||
},
|
||||
"resolutions": {
|
||||
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -25,7 +25,7 @@
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.75.0-main"
|
||||
"@react-native/codegen": "0.75.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,10 +22,10 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native-community/cli-server-api": "14.0.0-alpha.2",
|
||||
"@react-native-community/cli-tools": "14.0.0-alpha.2",
|
||||
"@react-native/dev-middleware": "0.75.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-main",
|
||||
"@react-native-community/cli-server-api": "14.0.0-alpha.11",
|
||||
"@react-native-community/cli-tools": "14.0.0-alpha.11",
|
||||
"@react-native/dev-middleware": "0.75.0-rc.5",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-rc.5",
|
||||
"chalk": "^4.0.0",
|
||||
"execa": "^5.1.1",
|
||||
"metro": "^0.80.3",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Dev server middleware for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -23,7 +23,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@isaacs/ttlcache": "^1.4.1",
|
||||
"@react-native/debugger-frontend": "0.75.0-main",
|
||||
"@react-native/debugger-frontend": "0.75.0-rc.5",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@babel/eslint-parser": "^7.20.0",
|
||||
"@react-native/eslint-plugin": "0.75.0-main",
|
||||
"@react-native/eslint-plugin": "0.75.0-rc.5",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -31,7 +31,7 @@
|
||||
"@babel/eslint-parser": "^7.20.0",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.20.0",
|
||||
"@babel/preset-flow": "^7.20.0",
|
||||
"@react-native/codegen": "0.75.0-main",
|
||||
"@react-native/codegen": "0.75.0-rc.5",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"reactNativePath": "REACT_NATIVE_PATH",
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"root": "HELLOWORLD_PATH",
|
||||
"dependencies": {},
|
||||
"platforms": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
|
||||
// Autolinking has now moved into the React Native Gradle Plugin
|
||||
pluginManagement { includeBuild("../../react-native-gradle-plugin") }
|
||||
plugins { id("com.facebook.react.settings") }
|
||||
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
|
||||
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand(["/bin/sh", "./scripts/config.sh"]) }
|
||||
|
||||
rootProject.name = 'HelloWorld'
|
||||
include ':app'
|
||||
|
||||
@@ -10,7 +10,7 @@ if linkage != nil
|
||||
end
|
||||
|
||||
target 'HelloWorld' do
|
||||
config = use_native_modules!
|
||||
config = use_native_modules!(['sh', '../scripts/config.sh'])
|
||||
|
||||
use_react_native!(
|
||||
:path => "../../react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "helloworld",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"bootstrap": "node ./cli.js bootstrap",
|
||||
@@ -13,16 +13,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "19.0.0-rc-fb9a90fa48-20240614",
|
||||
"react-native": "1000.0.0"
|
||||
"react-native": "0.75.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@babel/preset-env": "^7.20.0",
|
||||
"@babel/runtime": "^7.20.0",
|
||||
"@react-native/babel-preset": "0.75.0-main",
|
||||
"@react-native/core-cli-utils": "0.75.0-main",
|
||||
"@react-native/eslint-config": "0.75.0-main",
|
||||
"@react-native/metro-config": "0.75.0-main",
|
||||
"@react-native/babel-preset": "0.75.0-rc.5",
|
||||
"@react-native/core-cli-utils": "0.75.0-rc.5",
|
||||
"@react-native/eslint-config": "0.75.0-rc.5",
|
||||
"@react-native/metro-config": "0.75.0-rc.5",
|
||||
"babel-jest": "^29.6.3",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^12.0.0",
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
set -e
|
||||
|
||||
script_dir=$(dirname "$(readlink -f "$0")")
|
||||
|
||||
HELLOWORLD_PATH=$(realpath ../)
|
||||
REACT_NATIVE_PATH=$(realpath ../../react-native)
|
||||
|
||||
sed -e "s|HELLOWORLD_PATH|$HELLOWORLD_PATH|g" -e "s|REACT_NATIVE_PATH|$REACT_NATIVE_PATH|g" "$script_dir/../.react-native.config"
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/hermes-inspector-msggen",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"private": true,
|
||||
"description": "Hermes Inspector Message Generator for React Native",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,8 +26,8 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.75.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-main",
|
||||
"@react-native/js-polyfills": "0.75.0-rc.5",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-rc.5",
|
||||
"metro-config": "^0.80.3",
|
||||
"metro-runtime": "^0.80.3"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Babel preset for React Native applications",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -56,7 +56,7 @@
|
||||
"@babel/plugin-transform-typescript": "^7.5.0",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.0.0",
|
||||
"@babel/template": "^7.0.0",
|
||||
"@react-native/babel-plugin-codegen": "0.75.0-main",
|
||||
"@react-native/babel-plugin-codegen": "0.75.0-rc.5",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"react-refresh": "^0.14.0"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-babel-transformer",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Babel transformer for React Native applications.",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@react-native/babel-preset": "0.75.0-main",
|
||||
"@react-native/babel-preset": "0.75.0-rc.5",
|
||||
"hermes-parser": "0.22.0",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/bots",
|
||||
"description": "React Native Bots",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen-typescript-test",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"private": true,
|
||||
"description": "TypeScript related unit test for @react-native/codegen",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"prepare": "yarn run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.75.0-main"
|
||||
"@react-native/codegen": "0.75.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+2
-2
@@ -136,11 +136,11 @@ function translateFunctionParamToJavaType(
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'FloatTypeAnnotation':
|
||||
return wrapOptional('float', isRequired);
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'DoubleTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'Int32TypeAnnotation':
|
||||
return wrapOptional('int', isRequired);
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'BooleanTypeAnnotation':
|
||||
return wrapOptional('boolean', isRequired);
|
||||
case 'EnumDeclaration':
|
||||
|
||||
+2
-2
@@ -334,9 +334,9 @@ function translateReturnTypeToJniType(
|
||||
case 'DoubleTypeAnnotation':
|
||||
return nullable ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'FloatTypeAnnotation':
|
||||
return nullable ? 'Ljava/lang/Float;' : 'F';
|
||||
return nullable ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'Int32TypeAnnotation':
|
||||
return nullable ? 'Ljava/lang/Integer;' : 'I';
|
||||
return nullable ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'PromiseTypeAnnotation':
|
||||
return 'Lcom/facebook/react/bridge/Promise;';
|
||||
case 'GenericObjectTypeAnnotation':
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+2
@@ -85,6 +85,8 @@ abstract class GeneratePackageListTask : DefaultTask() {
|
||||
val packages = model?.dependencies?.values ?: emptyList()
|
||||
return packages
|
||||
.filter { it.platforms?.android != null }
|
||||
// The pure C++ dependencies won't have a .java/.kt file to import
|
||||
.filterNot { it.platforms?.android?.isPureCxxDependency == true }
|
||||
.associate { it.name to checkNotNull(it.platforms?.android) }
|
||||
}
|
||||
|
||||
|
||||
+27
@@ -177,6 +177,33 @@ class GeneratePackageListTaskTest {
|
||||
assertEquals(android, result["a-dependency"])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun filterAndroidPackages_withIsPureCxxDependencyObject_returnsIt() {
|
||||
val task = createTestTask<GeneratePackageListTask>()
|
||||
val android =
|
||||
ModelAutolinkingDependenciesPlatformAndroidJson(
|
||||
sourceDir = "./a/directory/android",
|
||||
packageImportPath = "import com.facebook.react.aPackage;",
|
||||
packageInstance = "new APackage()",
|
||||
buildTypes = emptyList(),
|
||||
isPureCxxDependency = true)
|
||||
|
||||
val result =
|
||||
task.filterAndroidPackages(
|
||||
ModelAutolinkingConfigJson(
|
||||
reactNativeVersion = "1000.0.0",
|
||||
dependencies =
|
||||
mapOf(
|
||||
"a-pure-cxx-dependency" to
|
||||
ModelAutolinkingDependenciesJson(
|
||||
root = "./a/directory",
|
||||
name = "a-pure-cxx-dependency",
|
||||
platforms =
|
||||
ModelAutolinkingDependenciesPlatformJson(android = android))),
|
||||
project = null))
|
||||
assertEquals(emptyMap<String, ModelAutolinkingDependenciesPlatformAndroidJson>(), result)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun composeFileContent_withNoPackages_returnsValidFile() {
|
||||
val task = createTestTask<GeneratePackageListTask>()
|
||||
|
||||
+35
-10
@@ -13,8 +13,10 @@ import java.math.BigInteger
|
||||
import java.security.MessageDigest
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
import org.gradle.api.GradleException
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.api.initialization.Settings
|
||||
import org.gradle.api.logging.Logging
|
||||
|
||||
abstract class ReactSettingsExtension @Inject constructor(val settings: Settings) {
|
||||
|
||||
@@ -46,13 +48,28 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
) {
|
||||
outputFile.parentFile.mkdirs()
|
||||
val lockFilesChanged = checkAndUpdateLockfiles(lockFiles, outputFolder)
|
||||
if (lockFilesChanged || outputFile.exists().not()) {
|
||||
ProcessBuilder(command)
|
||||
.directory(workingDirectory)
|
||||
.redirectOutput(ProcessBuilder.Redirect.to(outputFile))
|
||||
.redirectError(ProcessBuilder.Redirect.INHERIT)
|
||||
.start()
|
||||
.waitFor(5, TimeUnit.MINUTES)
|
||||
if (lockFilesChanged || outputFile.exists().not() || outputFile.length() != 0L) {
|
||||
val process =
|
||||
ProcessBuilder(command)
|
||||
.directory(workingDirectory)
|
||||
.redirectOutput(ProcessBuilder.Redirect.to(outputFile))
|
||||
.redirectError(ProcessBuilder.Redirect.INHERIT)
|
||||
.start()
|
||||
val finished = process.waitFor(5, TimeUnit.MINUTES)
|
||||
if (!finished || (process.exitValue() != 0)) {
|
||||
val prefixCommand =
|
||||
"ERROR: autolinkLibrariesFromCommand: process ${command.joinToString(" ")}"
|
||||
val message =
|
||||
if (!finished) "${prefixCommand} timed out"
|
||||
else "${prefixCommand} exited with error code: ${process.exitValue()}"
|
||||
val logger = Logging.getLogger("ReactSettingsExtension")
|
||||
logger.error(message)
|
||||
if (outputFile.length() != 0L) {
|
||||
logger.error(outputFile.readText().substring(0, 1024))
|
||||
}
|
||||
outputFile.delete()
|
||||
throw GradleException(message)
|
||||
}
|
||||
}
|
||||
linkLibraries(getLibrariesToAutolink(outputFile))
|
||||
}
|
||||
@@ -112,9 +129,17 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
|
||||
internal fun getLibrariesToAutolink(buildFile: File): Map<String, File> {
|
||||
val model = JsonUtils.fromAutolinkingConfigJson(buildFile)
|
||||
return model?.dependencies?.values?.associate { deps ->
|
||||
":${deps.nameCleansed}" to File(deps.platforms?.android?.sourceDir)
|
||||
} ?: emptyMap()
|
||||
return model
|
||||
?.dependencies
|
||||
?.values
|
||||
// We handle scenarios where there are deps that are
|
||||
// iOS-only or missing the Android configs.
|
||||
?.filter { it.platforms?.android?.sourceDir != null }
|
||||
// We want to skip dependencies that are pure C++ as they won't contain a .gradle file.
|
||||
?.filterNot { it.platforms?.android?.isPureCxxDependency == true }
|
||||
?.associate { deps ->
|
||||
":${deps.nameCleansed}" to File(deps.platforms?.android?.sourceDir)
|
||||
} ?: emptyMap()
|
||||
}
|
||||
|
||||
internal fun computeSha256(lockFile: File) =
|
||||
|
||||
+31
-1
@@ -86,7 +86,8 @@ class ReactSettingsExtensionTest {
|
||||
"cxxModuleCMakeListsModuleName": null,
|
||||
"cxxModuleCMakeListsPath": null,
|
||||
"cxxModuleHeaderName": null,
|
||||
"dependencyConfiguration": "implementation"
|
||||
"dependencyConfiguration": "implementation",
|
||||
"isPureCxxDependency": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,6 +104,35 @@ class ReactSettingsExtensionTest {
|
||||
map[":react-native_oss-library-example"])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getLibrariesToAutolink_withiOSOnlyLibrary_returnsEmptyMap() {
|
||||
val validJsonFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"dependencies": {
|
||||
"@react-native/oss-library-example": {
|
||||
"root": "./node_modules/@react-native/oss-library-example",
|
||||
"name": "@react-native/oss-library-example",
|
||||
"platforms": {
|
||||
"ios": {
|
||||
"podspecPath": "./node_modules/@react-native/oss-library-example/OSSLibraryExample.podspec",
|
||||
"version": "0.0.1",
|
||||
"configurations": [],
|
||||
"scriptPhases": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
val map = getLibrariesToAutolink(validJsonFile)
|
||||
assertEquals(0, map.keys.size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun checkAndUpdateLockfiles_withNothingToCheck_returnsFalse() {
|
||||
val project = ProjectBuilder.builder().build()
|
||||
|
||||
+2
-1
@@ -18,5 +18,6 @@ data class ModelAutolinkingDependenciesPlatformAndroidJson(
|
||||
val cxxModuleCMakeListsModuleName: String? = null,
|
||||
val cxxModuleCMakeListsPath: String? = null,
|
||||
val cxxModuleHeaderName: String? = null,
|
||||
val dependencyConfiguration: String? = null
|
||||
val dependencyConfiguration: String? = null,
|
||||
val isPureCxxDependency: Boolean? = null
|
||||
)
|
||||
|
||||
+7
-1
@@ -216,7 +216,8 @@ class JsonUtilsTest {
|
||||
"cxxModuleCMakeListsModuleName": null,
|
||||
"cxxModuleCMakeListsPath": null,
|
||||
"cxxModuleHeaderName": null,
|
||||
"dependencyConfiguration": "implementation"
|
||||
"dependencyConfiguration": "implementation",
|
||||
"isPureCxxDependency": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,6 +299,11 @@ class JsonUtilsTest {
|
||||
.platforms!!
|
||||
.android!!
|
||||
.dependencyConfiguration)
|
||||
assertFalse(
|
||||
parsed.dependencies!!["@react-native/oss-library-example"]!!
|
||||
.platforms!!
|
||||
.android!!
|
||||
.isPureCxxDependency!!)
|
||||
}
|
||||
|
||||
private fun createJsonFile(@Language("JSON") input: String) =
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-info",
|
||||
"version": "1.0.0",
|
||||
"version": "0.75.0-rc.5",
|
||||
"main": "build/index.js",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "PopupMenu for the Android platform",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@react-native/codegen": "0.75.0-main"
|
||||
"@react-native/codegen": "0.75.0-rc.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^18.2.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/oss-library-example",
|
||||
"version": "0.0.1",
|
||||
"version": "0.75.0-rc.5",
|
||||
"private": true,
|
||||
"description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.",
|
||||
"license": "MIT",
|
||||
@@ -26,8 +26,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@react-native/babel-preset": "0.75.0-main",
|
||||
"react-native": "*"
|
||||
"@react-native/babel-preset": "0.75.0-rc.5",
|
||||
"react-native": "0.75.0-rc.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/test-renderer",
|
||||
"private": true,
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.0-rc.5",
|
||||
"description": "A Test rendering library for React Native",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -61,7 +61,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths,
|
||||
"OTHER_CPLUSPLUSFLAGS" => other_cflags,
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES"
|
||||
}
|
||||
s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
|
||||
|
||||
@@ -43,7 +43,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTBlob"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ const version: $ReadOnly<{
|
||||
patch: number,
|
||||
prerelease: string | null,
|
||||
}> = {
|
||||
major: 1000,
|
||||
minor: 0,
|
||||
major: 0,
|
||||
minor: 75,
|
||||
patch: 0,
|
||||
prerelease: null,
|
||||
prerelease: 'rc.5',
|
||||
};
|
||||
|
||||
module.exports = {version};
|
||||
|
||||
@@ -32,11 +32,7 @@ static NSInteger RCTImageBytesForImage(UIImage *image)
|
||||
return image.images ? image.images.count * singleImageBytes : singleImageBytes;
|
||||
}
|
||||
|
||||
static uint64_t getNextImageRequestCount(void)
|
||||
{
|
||||
static uint64_t requestCounter = 0;
|
||||
return requestCounter++;
|
||||
}
|
||||
static auto currentRequestCount = std::atomic<uint64_t>(0);
|
||||
|
||||
static NSError *addResponseHeadersToError(NSError *originalError, NSHTTPURLResponse *response)
|
||||
{
|
||||
@@ -510,7 +506,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
|
||||
auto cancelled = std::make_shared<std::atomic<int>>(0);
|
||||
__block dispatch_block_t cancelLoad = nil;
|
||||
__block NSLock *cancelLoadLock = [NSLock new];
|
||||
NSString *requestId = [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], getNextImageRequestCount()];
|
||||
NSString *requestId = [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], currentRequestCount++];
|
||||
|
||||
void (^completionHandler)(NSError *, id, id, NSURLResponse *) =
|
||||
^(NSError *error, id imageOrData, id imageMetadata, NSURLResponse *response) {
|
||||
|
||||
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTImage"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
||||
}
|
||||
s.framework = ["Accelerate", "UIKit"]
|
||||
|
||||
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTLinking"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTAnimation"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(" ")
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <atomic>
|
||||
#import <mutex>
|
||||
|
||||
#import <React/RCTLog.h>
|
||||
@@ -20,6 +21,8 @@
|
||||
RCTNetworkTask *_selfReference;
|
||||
}
|
||||
|
||||
static auto currentRequestId = std::atomic<NSUInteger>(0);
|
||||
|
||||
- (instancetype)initWithRequest:(NSURLRequest *)request
|
||||
handler:(id<RCTURLRequestHandler>)handler
|
||||
callbackQueue:(dispatch_queue_t)callbackQueue
|
||||
@@ -28,10 +31,8 @@
|
||||
RCTAssertParam(handler);
|
||||
RCTAssertParam(callbackQueue);
|
||||
|
||||
static NSUInteger requestID = 0;
|
||||
|
||||
if ((self = [super init])) {
|
||||
_requestID = @(requestID++);
|
||||
_requestID = @(currentRequestId++);
|
||||
_request = request;
|
||||
_handler = handler;
|
||||
_callbackQueue = callbackQueue;
|
||||
|
||||
@@ -40,7 +40,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTNetwork"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
||||
}
|
||||
s.frameworks = "MobileCoreServices"
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTPushNotification"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
||||
}
|
||||
s.framework = "UserNotifications"
|
||||
|
||||
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTSettings"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Pod::Spec.new do |s|
|
||||
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
|
||||
s.header_dir = "RCTText"
|
||||
s.framework = ["MobileCoreServices"]
|
||||
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" }
|
||||
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
|
||||
|
||||
s.dependency "Yoga"
|
||||
s.dependency "React-Core/RCTTextHeaders", version
|
||||
|
||||
@@ -29,7 +29,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTTypeSafety"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/Libraries/TypeSafety\""
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ const Platform: PlatformType = {
|
||||
major: number,
|
||||
minor: number,
|
||||
patch: number,
|
||||
prerelease: ?number,
|
||||
prerelease: ?string,
|
||||
|},
|
||||
Version: number,
|
||||
Release: string,
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ type PlatformConstants = {
|
||||
major: number;
|
||||
minor: number;
|
||||
patch: number;
|
||||
prerelease?: number | null | undefined;
|
||||
prerelease?: string | null | undefined;
|
||||
};
|
||||
};
|
||||
interface PlatformStatic {
|
||||
|
||||
@@ -32,7 +32,7 @@ type IOSPlatform = {
|
||||
major: number,
|
||||
minor: number,
|
||||
patch: number,
|
||||
prerelease: ?number,
|
||||
prerelease: ?string,
|
||||
|},
|
||||
systemName: string,
|
||||
isMacCatalyst?: boolean,
|
||||
@@ -65,7 +65,7 @@ type AndroidPlatform = {
|
||||
major: number,
|
||||
minor: number,
|
||||
patch: number,
|
||||
prerelease: ?number,
|
||||
prerelease: ?string,
|
||||
|},
|
||||
Version: number,
|
||||
Release: string,
|
||||
|
||||
@@ -34,7 +34,7 @@ const Platform: PlatformType = {
|
||||
major: number,
|
||||
minor: number,
|
||||
patch: number,
|
||||
prerelease: ?number,
|
||||
prerelease: ?string,
|
||||
|},
|
||||
systemName: string,
|
||||
isMacCatalyst?: boolean,
|
||||
|
||||
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "RCTVibration"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
||||
}
|
||||
s.frameworks = "AudioToolbox"
|
||||
|
||||
@@ -8711,7 +8711,7 @@ type IOSPlatform = {
|
||||
major: number,
|
||||
minor: number,
|
||||
patch: number,
|
||||
prerelease: ?number,
|
||||
prerelease: ?string,
|
||||
|},
|
||||
systemName: string,
|
||||
isMacCatalyst?: boolean,
|
||||
@@ -8735,7 +8735,7 @@ type AndroidPlatform = {
|
||||
major: number,
|
||||
minor: number,
|
||||
patch: number,
|
||||
prerelease: ?number,
|
||||
prerelease: ?string,
|
||||
|},
|
||||
Version: number,
|
||||
Release: string,
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Where is the template?
|
||||
The React Native Template has moved from being shipping inside the [react-native](https://www.npmjs.com/package/react-native) package to it's own package: [@react-native-community/template](https://github.com/react-native-community/template).
|
||||
|
||||
## Why has it moved?
|
||||
The [React Native Frameworks RFC0759](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md#evolving-the-react-native-community-template--cli) provides background information.
|
||||
|
||||
## When was it moved?
|
||||
The 0.75 release.
|
||||
@@ -72,7 +72,7 @@ Pod::Spec.new do |s|
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths,
|
||||
"DEFINES_MODULE" => "YES",
|
||||
"GCC_PREPROCESSOR_DEFINITIONS" => "RCT_METRO_PORT=${RCT_METRO_PORT}",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"FRAMEWORK_SEARCH_PATHS" => frameworks_search_paths.join(" ")
|
||||
}
|
||||
s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
|
||||
|
||||
@@ -21,10 +21,10 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(1000),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(75),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
RCTVersionPrerelease: @"rc.5",
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
|
||||
@@ -78,9 +78,7 @@ RCT_EXPORT_MODULE(PlatformConstants)
|
||||
{.minor = [versions[@"minor"] doubleValue],
|
||||
.major = [versions[@"major"] doubleValue],
|
||||
.patch = [versions[@"patch"] doubleValue],
|
||||
.prerelease = [versions[@"prerelease"] isKindOfClass:[NSNull class]]
|
||||
? std::optional<double>{}
|
||||
: [versions[@"prerelease"] doubleValue]}),
|
||||
.prerelease = [versions[@"prerelease"] isKindOfClass:[NSNull class]] ? nullptr : versions[@"prerelease"]}),
|
||||
#if TARGET_OS_MACCATALYST
|
||||
.isMacCatalyst = true,
|
||||
#else
|
||||
|
||||
@@ -44,7 +44,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = "CoreModules"
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(" ")
|
||||
}
|
||||
s.framework = "UIKit"
|
||||
|
||||
@@ -60,7 +60,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths,
|
||||
"OTHER_CFLAGS" => "$(inherited) " + folly_compiler_flags + new_arch_flags,
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20"
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
|
||||
}.merge!(ENV['USE_FRAMEWORKS'] != nil ? {
|
||||
"PUBLIC_HEADERS_FOLDER_PATH" => "#{module_name}.framework/Headers/#{header_dir}"
|
||||
}: {})
|
||||
|
||||
@@ -61,12 +61,20 @@ static SEL selectorForType(NSString *type)
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isBridgeMode
|
||||
{
|
||||
// If we are in bridge mode, the bridge is RCTBridge
|
||||
// If we are bridgeless, the bridge is RCTBridgeProxy
|
||||
return [_bridge isKindOfClass:[RCTBridge class]];
|
||||
}
|
||||
|
||||
- (RCTViewManager *)manager
|
||||
{
|
||||
if (!_manager && _bridge) {
|
||||
if (!_manager && [self isBridgeMode]) {
|
||||
_manager = [_bridge moduleForClass:_managerClass];
|
||||
} else if (!_manager && !_bridgelessViewManager) {
|
||||
_bridgelessViewManager = [_managerClass new];
|
||||
_bridgelessViewManager.bridge = _bridge;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTDidInitializeModuleNotification
|
||||
object:nil
|
||||
userInfo:@{@"module" : _bridgelessViewManager}];
|
||||
@@ -265,8 +273,8 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
|
||||
type == NSSelectorFromString(@"RCTDirectEventBlock:") ||
|
||||
type == NSSelectorFromString(@"RCTCapturingEventBlock:")) {
|
||||
// Special case for event handlers
|
||||
setterBlock =
|
||||
createEventSetter(name, setter, self.eventInterceptor, _bridge ? _bridge.eventDispatcher : _eventDispatcher);
|
||||
setterBlock = createEventSetter(
|
||||
name, setter, self.eventInterceptor, [self isBridgeMode] ? _bridge.eventDispatcher : _eventDispatcher);
|
||||
} else {
|
||||
// Ordinary property handlers
|
||||
NSMethodSignature *typeSignature = [[RCTConvert class] methodSignatureForSelector:type];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Make sure we never publish ReactAndroid/build (Gradle output)
|
||||
# or ReactAndroid/.cxx (CMake output) to npm.
|
||||
# Those folders are huge (> 100MB)!
|
||||
build/
|
||||
/build/
|
||||
.cxx/
|
||||
# Exclude buck config/jars for third-party libraries
|
||||
src/main/third-party/
|
||||
|
||||
@@ -2323,12 +2323,19 @@ public class com/facebook/react/devsupport/ReleaseDevSupportManager : com/facebo
|
||||
|
||||
public class com/facebook/react/devsupport/StackTraceHelper {
|
||||
public static final field COLUMN_KEY Ljava/lang/String;
|
||||
public static final field FILE_KEY Ljava/lang/String;
|
||||
public static final field ID_KEY Ljava/lang/String;
|
||||
public static final field IS_FATAL_KEY Ljava/lang/String;
|
||||
public static final field LINE_NUMBER_KEY Ljava/lang/String;
|
||||
public static final field MESSAGE_KEY Ljava/lang/String;
|
||||
public static final field METHOD_NAME_KEY Ljava/lang/String;
|
||||
public static final field STACK_KEY Ljava/lang/String;
|
||||
public fun <init> ()V
|
||||
public static fun convertJavaStackTrace (Ljava/lang/Throwable;)[Lcom/facebook/react/devsupport/interfaces/StackFrame;
|
||||
public static fun convertJsStackTrace (Lcom/facebook/react/bridge/ReadableArray;)[Lcom/facebook/react/devsupport/interfaces/StackFrame;
|
||||
public static fun convertJsStackTrace (Ljava/lang/String;)[Lcom/facebook/react/devsupport/interfaces/StackFrame;
|
||||
public static fun convertJsStackTrace (Lorg/json/JSONArray;)[Lcom/facebook/react/devsupport/interfaces/StackFrame;
|
||||
public static fun convertParsedError (Lcom/facebook/react/interfaces/exceptionmanager/ReactJsExceptionHandler$ParsedError;)Lcom/facebook/react/bridge/JavaOnlyMap;
|
||||
public static fun formatFrameSource (Lcom/facebook/react/devsupport/interfaces/StackFrame;)Ljava/lang/String;
|
||||
public static fun formatStackTrace (Ljava/lang/String;[Lcom/facebook/react/devsupport/interfaces/StackFrame;)Ljava/lang/String;
|
||||
}
|
||||
@@ -3390,6 +3397,7 @@ public final class com/facebook/react/modules/i18nmanager/I18nUtil {
|
||||
}
|
||||
|
||||
public final class com/facebook/react/modules/i18nmanager/I18nUtil$Companion {
|
||||
public final fun DEPRECATED$getInstance ()Lcom/facebook/react/modules/i18nmanager/I18nUtil;
|
||||
public final fun getInstance ()Lcom/facebook/react/modules/i18nmanager/I18nUtil;
|
||||
}
|
||||
|
||||
@@ -3779,8 +3787,8 @@ public abstract class com/facebook/react/runtime/JSRuntimeFactory {
|
||||
}
|
||||
|
||||
public class com/facebook/react/runtime/ReactHostImpl : com/facebook/react/ReactHost {
|
||||
public fun <init> (Landroid/content/Context;Lcom/facebook/react/runtime/ReactHostDelegate;Lcom/facebook/react/fabric/ComponentFactory;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lcom/facebook/react/interfaces/exceptionmanager/ReactJsExceptionHandler;ZZ)V
|
||||
public fun <init> (Landroid/content/Context;Lcom/facebook/react/runtime/ReactHostDelegate;Lcom/facebook/react/fabric/ComponentFactory;ZLcom/facebook/react/interfaces/exceptionmanager/ReactJsExceptionHandler;Z)V
|
||||
public fun <init> (Landroid/content/Context;Lcom/facebook/react/runtime/ReactHostDelegate;Lcom/facebook/react/fabric/ComponentFactory;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;ZZ)V
|
||||
public fun <init> (Landroid/content/Context;Lcom/facebook/react/runtime/ReactHostDelegate;Lcom/facebook/react/fabric/ComponentFactory;ZZ)V
|
||||
public fun addBeforeDestroyListener (Lkotlin/jvm/functions/Function0;)V
|
||||
public fun addReactInstanceEventListener (Lcom/facebook/react/ReactInstanceEventListener;)V
|
||||
public fun createSurface (Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;)Lcom/facebook/react/interfaces/fabric/ReactSurface;
|
||||
@@ -6480,6 +6488,7 @@ public final class com/facebook/react/views/imagehelper/ResourceDrawableIdHelper
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/imagehelper/ResourceDrawableIdHelper$Companion {
|
||||
public final fun DEPRECATED$getInstance ()Lcom/facebook/react/views/imagehelper/ResourceDrawableIdHelper;
|
||||
public final fun getInstance ()Lcom/facebook/react/views/imagehelper/ResourceDrawableIdHelper;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,22 @@ val preparePrefab by
|
||||
Pair("../ReactCommon/react/renderer/graphics/", "react/renderer/graphics/"),
|
||||
Pair("../ReactCommon/react/renderer/graphics/platform/android/", ""),
|
||||
)),
|
||||
PrefabPreprocessingEntry(
|
||||
"react_render_consistency",
|
||||
Pair(
|
||||
"../ReactCommon/react/renderer/consistency/", "react/renderer/consistency/")),
|
||||
PrefabPreprocessingEntry(
|
||||
"react_featureflags",
|
||||
Pair("../ReactCommon/react/featureflags/", "react/featureflags/")),
|
||||
PrefabPreprocessingEntry(
|
||||
"react_performance_timeline",
|
||||
Pair(
|
||||
"../ReactCommon/react/performance/timeline/", "react/performance/timeline/")),
|
||||
PrefabPreprocessingEntry(
|
||||
"react_render_observers_events",
|
||||
Pair(
|
||||
"../ReactCommon/react/renderer/observers/events/",
|
||||
"react/renderer/observers/events/")),
|
||||
PrefabPreprocessingEntry(
|
||||
"rrc_root",
|
||||
Pair(
|
||||
@@ -694,6 +710,18 @@ android {
|
||||
create("react_render_graphics") {
|
||||
headers = File(prefabHeadersDir, "react_render_graphics").absolutePath
|
||||
}
|
||||
create("react_render_consistency") {
|
||||
headers = File(prefabHeadersDir, "react_render_consistency").absolutePath
|
||||
}
|
||||
create("react_featureflags") {
|
||||
headers = File(prefabHeadersDir, "react_featureflags").absolutePath
|
||||
}
|
||||
create("react_performance_timeline") {
|
||||
headers = File(prefabHeadersDir, "react_performance_timeline").absolutePath
|
||||
}
|
||||
create("react_render_observers_events") {
|
||||
headers = File(prefabHeadersDir, "react_render_observers_events").absolutePath
|
||||
}
|
||||
create("rrc_image") { headers = File(prefabHeadersDir, "rrc_image").absolutePath }
|
||||
create("rrc_root") { headers = File(prefabHeadersDir, "rrc_root").absolutePath }
|
||||
create("rrc_view") { headers = File(prefabHeadersDir, "rrc_view").absolutePath }
|
||||
|
||||
@@ -87,6 +87,11 @@ add_library(react_nativemodule_core ALIAS ReactAndroid::react_nativemodule_core)
|
||||
add_library(react_render_imagemanager ALIAS ReactAndroid::react_render_imagemanager)
|
||||
add_library(rrc_image ALIAS ReactAndroid::rrc_image)
|
||||
add_library(rrc_legacyviewmanagerinterop ALIAS ReactAndroid::rrc_legacyviewmanagerinterop)
|
||||
add_library(reactnativejni ALIAS ReactAndroid::reactnativejni)
|
||||
add_library(react_render_consistency ALIAS ReactAndroid::react_render_consistency)
|
||||
add_library(react_performance_timeline ALIAS ReactAndroid::react_performance_timeline)
|
||||
add_library(react_render_observers_events ALIAS ReactAndroid::react_render_observers_events)
|
||||
add_library(react_featureflags ALIAS ReactAndroid::react_featureflags)
|
||||
|
||||
find_package(fbjni REQUIRED CONFIG)
|
||||
add_library(fbjni ALIAS fbjni::fbjni)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0
|
||||
VERSION_NAME=0.75.0-rc.5
|
||||
react.internal.publishingGroup=com.facebook.react
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+4
@@ -20,12 +20,14 @@ import java.util.Locale
|
||||
public object AndroidUnicodeUtils {
|
||||
|
||||
@DoNotStrip
|
||||
@JvmStatic
|
||||
public fun localeCompare(left: String?, right: String?): Int {
|
||||
val collator = Collator.getInstance()
|
||||
return collator.compare(left, right)
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@JvmStatic
|
||||
public fun dateFormat(unixtimeMs: Double, formatDate: Boolean, formatTime: Boolean): String {
|
||||
val format =
|
||||
when {
|
||||
@@ -39,6 +41,7 @@ public object AndroidUnicodeUtils {
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@JvmStatic
|
||||
public fun convertToCase(input: String, targetCase: Int, useCurrentLocale: Boolean): String {
|
||||
// Note Java's case conversions use the user's locale. For example "I".toLowerCase()
|
||||
// will produce a dotless i. From Java's docs: "To obtain correct results for locale
|
||||
@@ -52,6 +55,7 @@ public object AndroidUnicodeUtils {
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@JvmStatic
|
||||
public fun normalize(input: String?, form: Int): String =
|
||||
when (form) {
|
||||
FORM_C -> Normalizer.normalize(input, Normalizer.Form.NFC)
|
||||
|
||||
+4
-1
@@ -106,7 +106,10 @@ public interface CatalystInstance : MemoryPressureListener, JSInstance, JSBundle
|
||||
* Returns a hybrid object that contains a pointer to a JS CallInvoker, which is used to schedule
|
||||
* work on the JS Thread. Required for TurboModuleManager initialization.
|
||||
*/
|
||||
@get:Deprecated("") public val jSCallInvokerHolder: CallInvokerHolder
|
||||
@get:Deprecated("Use ReactContext.getJSCallInvokerHolder instead")
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getJSCallInvokerHolder") // This is needed to keep backward compatibility
|
||||
public val jsCallInvokerHolder: CallInvokerHolder
|
||||
|
||||
/**
|
||||
* Returns a hybrid object that contains a pointer to a NativeMethodCallInvoker, which is used to
|
||||
|
||||
+4
-4
@@ -12,6 +12,10 @@ package com.facebook.react.bridge
|
||||
* pass one of multiple types down to the native layer.
|
||||
*/
|
||||
public interface Dynamic {
|
||||
public val type: ReadableType
|
||||
|
||||
public val isNull: Boolean
|
||||
|
||||
public fun asArray(): ReadableArray
|
||||
|
||||
public fun asBoolean(): Boolean
|
||||
@@ -24,9 +28,5 @@ public interface Dynamic {
|
||||
|
||||
public fun asString(): String
|
||||
|
||||
public fun getType(): ReadableType
|
||||
|
||||
public fun isNull(): Boolean
|
||||
|
||||
public fun recycle(): Unit
|
||||
}
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.bridge;
|
||||
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
|
||||
import com.facebook.react.common.annotations.StableReactNativeAPI;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/*
|
||||
* IMPORTANT: Do not migrate this interface to Kotlin as you'll create a breaking change for React Native
|
||||
* libraries written in Kotlin.
|
||||
*/
|
||||
|
||||
/**
|
||||
* A native module whose API can be provided to JS catalyst instances. {@link NativeModule}s whose
|
||||
* implementation is written in Java should extend {@link BaseJavaModule} or {@link
|
||||
* ReactContextBaseJavaModule}. {@link NativeModule}s whose implementation is written in C++ must
|
||||
* not provide any Java code (so they can be reused on other platforms), and instead should register
|
||||
* themselves using {@link CxxModuleWrapper}.
|
||||
*/
|
||||
@StableReactNativeAPI
|
||||
@DoNotStrip
|
||||
public interface NativeModule {
|
||||
|
||||
/**
|
||||
* @return the name of this module. This will be the name used to {@code require()} this module
|
||||
* from javascript.
|
||||
*/
|
||||
// IMPORTANT: Do not migrate this interface to Kotlin as you'll create a breaking change
|
||||
// for React Native libraries written in Kotlin
|
||||
@Nonnull
|
||||
String getName();
|
||||
|
||||
/** This method is called after {@link ReactApplicationContext} has been created. */
|
||||
void initialize();
|
||||
|
||||
/** Allow NativeModule to clean up. Called before React Native instance is destroyed. */
|
||||
void invalidate();
|
||||
|
||||
/**
|
||||
* Return true if you intend to override some other native module that was registered e.g. as part
|
||||
* of a different package (such as the core one). Trying to override without returning true from
|
||||
* this method is considered an error and will throw an exception during initialization. By
|
||||
* default all modules return false.
|
||||
*/
|
||||
@DeprecatedInNewArchitecture()
|
||||
default boolean canOverrideExistingModule() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow NativeModule to clean up. Called before {CatalystInstance#onHostDestroy}
|
||||
*
|
||||
* @deprecated use {@link #invalidate()} instead.
|
||||
*/
|
||||
@Deprecated(since = "Use invalidate method instead", forRemoval = true)
|
||||
default void onCatalystInstanceDestroy() {}
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
||||
import com.facebook.react.common.annotations.StableReactNativeAPI
|
||||
|
||||
/**
|
||||
* A native module whose API can be provided to JS catalyst instances. [NativeModule]s whose
|
||||
* implementation is written in Kotlin should extend [BaseJavaModule] or
|
||||
* [ReactContextBaseJavaModule]. [NativeModule]s whose implementation is written in C++ must not
|
||||
* provide any Kotlin code (so they can be reused on other platforms), and instead should register
|
||||
* themselves using [CxxModuleWrapper].
|
||||
*/
|
||||
@StableReactNativeAPI
|
||||
@DoNotStrip
|
||||
public interface NativeModule {
|
||||
|
||||
/**
|
||||
* @return the name of this module. This will be the name used to `require()` this module from
|
||||
* javascript.
|
||||
*/
|
||||
public fun getName(): String
|
||||
|
||||
/** This method is called after [ReactApplicationContext] has been created. */
|
||||
public fun initialize(): Unit
|
||||
|
||||
/** Allow NativeModule to clean up. Called before React Native instance is destroyed. */
|
||||
public fun invalidate(): Unit
|
||||
|
||||
/**
|
||||
* Return true if you intend to override some other native module that was registered e.g. as part
|
||||
* of a different package (such as the core one). Trying to override without returning true from
|
||||
* this method is considered an error and will throw an exception during initialization. By
|
||||
* default all modules return false.
|
||||
*/
|
||||
@DeprecatedInNewArchitecture() public fun canOverrideExistingModule(): Boolean = false
|
||||
|
||||
/**
|
||||
* Allow NativeModule to clean up. Called before [CatalystInstance.onHostDestroy]
|
||||
*
|
||||
* @deprecated use [NativeModule.invalidate()] instead.
|
||||
*/
|
||||
@Deprecated(
|
||||
"Use invalidate method instead",
|
||||
replaceWith = ReplaceWith("invalidate()"),
|
||||
level = DeprecationLevel.WARNING)
|
||||
public fun onCatalystInstanceDestroy(): Unit = Unit
|
||||
}
|
||||
+2
-2
@@ -16,6 +16,8 @@ import kotlin.collections.Map
|
||||
* Kotlin.
|
||||
*/
|
||||
public interface ReadableMap {
|
||||
public val entryIterator: Iterator<Map.Entry<String, Any>>
|
||||
|
||||
public fun getArray(name: String): ReadableArray?
|
||||
|
||||
public fun getBoolean(name: String): Boolean
|
||||
@@ -24,8 +26,6 @@ public interface ReadableMap {
|
||||
|
||||
public fun getDynamic(name: String): Dynamic
|
||||
|
||||
public fun getEntryIterator(): Iterator<Map.Entry<String, Any>>
|
||||
|
||||
public fun getInt(name: String): Int
|
||||
|
||||
public fun getLong(name: String): Long
|
||||
|
||||
+23
-23
@@ -110,36 +110,36 @@ public open class ReadableNativeMap protected constructor(hybridData: HybridData
|
||||
|
||||
override fun getDynamic(name: String): Dynamic = DynamicFromMap.create(this, name)
|
||||
|
||||
override fun getEntryIterator(): Iterator<Map.Entry<String, Any>> {
|
||||
synchronized(this) {
|
||||
val iteratorKeys = keys
|
||||
val iteratorValues = importValues()
|
||||
jniPassCounter++
|
||||
return object : Iterator<Map.Entry<String, Any>> {
|
||||
var currentIndex = 0
|
||||
override val entryIterator: Iterator<Map.Entry<String, Any>>
|
||||
get() =
|
||||
synchronized(this) {
|
||||
val iteratorKeys = keys
|
||||
val iteratorValues = importValues()
|
||||
jniPassCounter++
|
||||
return object : Iterator<Map.Entry<String, Any>> {
|
||||
var currentIndex = 0
|
||||
|
||||
override fun hasNext(): Boolean {
|
||||
return currentIndex < iteratorKeys.size
|
||||
}
|
||||
override fun hasNext(): Boolean {
|
||||
return currentIndex < iteratorKeys.size
|
||||
}
|
||||
|
||||
override fun next(): Map.Entry<String, Any> {
|
||||
val index = currentIndex++
|
||||
return object : MutableMap.MutableEntry<String, Any> {
|
||||
override val key: String
|
||||
get() = iteratorKeys[index]
|
||||
override fun next(): Map.Entry<String, Any> {
|
||||
val index = currentIndex++
|
||||
return object : MutableMap.MutableEntry<String, Any> {
|
||||
override val key: String
|
||||
get() = iteratorKeys[index]
|
||||
|
||||
override val value: Any
|
||||
get() = iteratorValues[index]
|
||||
override val value: Any
|
||||
get() = iteratorValues[index]
|
||||
|
||||
override fun setValue(newValue: Any): Any {
|
||||
throw UnsupportedOperationException(
|
||||
"Can't set a value while iterating over a ReadableNativeMap")
|
||||
override fun setValue(newValue: Any): Any {
|
||||
throw UnsupportedOperationException(
|
||||
"Can't set a value while iterating over a ReadableNativeMap")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun keySetIterator(): ReadableMapKeySetIterator {
|
||||
val iteratorKeys = keys
|
||||
|
||||
-4
@@ -17,7 +17,6 @@ import com.facebook.react.bridge.ReactContext
|
||||
import com.facebook.react.common.annotations.UnstableReactNativeAPI
|
||||
import com.facebook.react.common.build.ReactBuildConfig
|
||||
import com.facebook.react.fabric.ComponentFactory
|
||||
import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler
|
||||
import com.facebook.react.runtime.JSCInstance
|
||||
import com.facebook.react.runtime.ReactHostImpl
|
||||
import com.facebook.react.runtime.cxxreactpackage.CxxReactPackage
|
||||
@@ -74,8 +73,6 @@ public object DefaultReactHost {
|
||||
reactPackages = packageList,
|
||||
jsRuntimeFactory = jsRuntimeFactory,
|
||||
turboModuleManagerDelegateBuilder = defaultTmmDelegateBuilder)
|
||||
// TODO: T180971255 Improve default exception handler
|
||||
val reactJsExceptionHandler = ReactJsExceptionHandler { _ -> }
|
||||
val componentFactory = ComponentFactory()
|
||||
DefaultComponentsRegistry.register(componentFactory)
|
||||
// TODO: T164788699 find alternative of accessing ReactHostImpl for initialising reactHost
|
||||
@@ -85,7 +82,6 @@ public object DefaultReactHost {
|
||||
defaultReactHostDelegate,
|
||||
componentFactory,
|
||||
true /* allowPackagerServerAccess */,
|
||||
reactJsExceptionHandler,
|
||||
useDevSupport,
|
||||
)
|
||||
.apply {
|
||||
|
||||
+35
-2
@@ -8,12 +8,17 @@
|
||||
package com.facebook.react.devsupport;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.react.bridge.JavaOnlyArray;
|
||||
import com.facebook.react.bridge.JavaOnlyMap;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableType;
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
import com.facebook.react.devsupport.interfaces.StackFrame;
|
||||
import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler.ParsedError;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.json.JSONArray;
|
||||
@@ -23,8 +28,15 @@ import org.json.JSONObject;
|
||||
/** Helper class converting JS and Java stack traces into arrays of {@link StackFrame} objects. */
|
||||
public class StackTraceHelper {
|
||||
|
||||
public static final java.lang.String COLUMN_KEY = "column";
|
||||
public static final java.lang.String LINE_NUMBER_KEY = "lineNumber";
|
||||
public static final String COLUMN_KEY = "column";
|
||||
public static final String LINE_NUMBER_KEY = "lineNumber";
|
||||
public static final String FILE_KEY = "file";
|
||||
public static final String METHOD_NAME_KEY = "methodName";
|
||||
|
||||
public static final String MESSAGE_KEY = "message";
|
||||
public static final String STACK_KEY = "stack";
|
||||
public static final String ID_KEY = "id";
|
||||
public static final String IS_FATAL_KEY = "isFatal";
|
||||
|
||||
private static final Pattern STACK_FRAME_PATTERN1 =
|
||||
Pattern.compile("^(?:(.*?)@)?(.*?)\\:([0-9]+)\\:([0-9]+)$");
|
||||
@@ -246,4 +258,25 @@ public class StackTraceHelper {
|
||||
|
||||
return stackTrace.toString();
|
||||
}
|
||||
|
||||
public static JavaOnlyMap convertParsedError(ParsedError error) {
|
||||
List<ParsedError.StackFrame> frames = error.getFrames();
|
||||
List<ReadableMap> readableMapList = new ArrayList<>();
|
||||
for (ParsedError.StackFrame frame : frames) {
|
||||
JavaOnlyMap map = new JavaOnlyMap();
|
||||
map.putDouble(COLUMN_KEY, frame.getColumnNumber());
|
||||
map.putDouble(LINE_NUMBER_KEY, frame.getLineNumber());
|
||||
map.putString(FILE_KEY, (String) frame.getFileName());
|
||||
map.putString(METHOD_NAME_KEY, (String) frame.getMethodName());
|
||||
readableMapList.add(map);
|
||||
}
|
||||
|
||||
JavaOnlyMap data = new JavaOnlyMap();
|
||||
data.putString(MESSAGE_KEY, error.getMessage());
|
||||
data.putArray(STACK_KEY, JavaOnlyArray.from(readableMapList));
|
||||
data.putInt(ID_KEY, error.getExceptionId());
|
||||
data.putBoolean(IS_FATAL_KEY, error.isFatal());
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -86,5 +86,16 @@ public class I18nUtil private constructor() {
|
||||
private const val KEY_FOR_PREFS_FORCERTL = "RCTI18nUtil_forceRTL"
|
||||
private const val KEY_FOR_PERFS_MAKE_RTL_FLIP_LEFT_AND_RIGHT_STYLES =
|
||||
"RCTI18nUtil_makeRTLFlipLeftAndRightStyles"
|
||||
|
||||
/**
|
||||
* We're just re-adding this to reduce a breaking change for libraries in React Native 0.75.
|
||||
*
|
||||
* @deprecated Use instance instead
|
||||
*/
|
||||
@Deprecated(
|
||||
"Use .instance instead, this API is only for backward compat", ReplaceWith("instance"))
|
||||
@JvmName(
|
||||
"DEPRECATED\$getInstance") // We intentionally don't want to expose this accessor to Java.
|
||||
public fun getInstance(): I18nUtil = instance
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -15,8 +15,8 @@ import java.util.Map;
|
||||
|
||||
public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 1000,
|
||||
"minor", 0,
|
||||
"major", 0,
|
||||
"minor", 75,
|
||||
"patch", 0,
|
||||
"prerelease", null);
|
||||
"prerelease", "rc.5");
|
||||
}
|
||||
|
||||
+3
-1
@@ -90,7 +90,9 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
|
||||
override public val javaScriptContextHolder: JavaScriptContextHolder
|
||||
get() = reactHost.getJavaScriptContextHolder()!!
|
||||
|
||||
override public val jSCallInvokerHolder: CallInvokerHolder
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getJSCallInvokerHolder") // This is needed to keep backward compatibility
|
||||
override public val jsCallInvokerHolder: CallInvokerHolder
|
||||
get() = reactHost.getJSCallInvokerHolder()!!
|
||||
|
||||
override public val nativeMethodCallInvokerHolder: NativeMethodCallInvokerHolder
|
||||
|
||||
-7
@@ -57,7 +57,6 @@ import com.facebook.react.devsupport.interfaces.DevSupportManager.PausedInDebugg
|
||||
import com.facebook.react.fabric.ComponentFactory;
|
||||
import com.facebook.react.fabric.FabricUIManager;
|
||||
import com.facebook.react.interfaces.TaskInterface;
|
||||
import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler;
|
||||
import com.facebook.react.interfaces.fabric.ReactSurface;
|
||||
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
|
||||
import com.facebook.react.modules.appearance.AppearanceModule;
|
||||
@@ -102,7 +101,6 @@ public class ReactHostImpl implements ReactHost {
|
||||
private final Context mContext;
|
||||
private final ReactHostDelegate mReactHostDelegate;
|
||||
private final ComponentFactory mComponentFactory;
|
||||
private final ReactJsExceptionHandler mReactJsExceptionHandler;
|
||||
private final DevSupportManager mDevSupportManager;
|
||||
private final Executor mBGExecutor;
|
||||
private final Executor mUIExecutor;
|
||||
@@ -145,7 +143,6 @@ public class ReactHostImpl implements ReactHost {
|
||||
ReactHostDelegate delegate,
|
||||
ComponentFactory componentFactory,
|
||||
boolean allowPackagerServerAccess,
|
||||
ReactJsExceptionHandler reactJsExceptionHandler,
|
||||
boolean useDevSupport) {
|
||||
this(
|
||||
context,
|
||||
@@ -153,7 +150,6 @@ public class ReactHostImpl implements ReactHost {
|
||||
componentFactory,
|
||||
Executors.newSingleThreadExecutor(),
|
||||
Task.UI_THREAD_EXECUTOR,
|
||||
reactJsExceptionHandler,
|
||||
allowPackagerServerAccess,
|
||||
useDevSupport);
|
||||
}
|
||||
@@ -164,7 +160,6 @@ public class ReactHostImpl implements ReactHost {
|
||||
ComponentFactory componentFactory,
|
||||
Executor bgExecutor,
|
||||
Executor uiExecutor,
|
||||
ReactJsExceptionHandler reactJsExceptionHandler,
|
||||
boolean allowPackagerServerAccess,
|
||||
boolean useDevSupport) {
|
||||
mContext = context;
|
||||
@@ -172,7 +167,6 @@ public class ReactHostImpl implements ReactHost {
|
||||
mComponentFactory = componentFactory;
|
||||
mBGExecutor = bgExecutor;
|
||||
mUIExecutor = uiExecutor;
|
||||
mReactJsExceptionHandler = reactJsExceptionHandler;
|
||||
mQueueThreadExceptionHandler = ReactHostImpl.this::handleHostException;
|
||||
mMemoryPressureRouter = new MemoryPressureRouter(context);
|
||||
mAllowPackagerServerAccess = allowPackagerServerAccess;
|
||||
@@ -1074,7 +1068,6 @@ public class ReactHostImpl implements ReactHost {
|
||||
mComponentFactory,
|
||||
devSupportManager,
|
||||
mQueueThreadExceptionHandler,
|
||||
mReactJsExceptionHandler,
|
||||
mUseDevSupport,
|
||||
getOrCreateReactHostInspectorTarget());
|
||||
mReactInstance = instance;
|
||||
|
||||
+29
-2
@@ -10,6 +10,8 @@ package com.facebook.react.runtime;
|
||||
import android.content.res.AssetManager;
|
||||
import android.view.View;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.fbreact.specs.NativeExceptionsManagerSpec;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.infer.annotation.ThreadConfined;
|
||||
import com.facebook.infer.annotation.ThreadSafe;
|
||||
@@ -21,6 +23,7 @@ import com.facebook.react.ViewManagerOnDemandReactPackage;
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.JSBundleLoader;
|
||||
import com.facebook.react.bridge.JSBundleLoaderDelegate;
|
||||
import com.facebook.react.bridge.JavaOnlyMap;
|
||||
import com.facebook.react.bridge.JavaScriptContextHolder;
|
||||
import com.facebook.react.bridge.NativeArray;
|
||||
import com.facebook.react.bridge.NativeMap;
|
||||
@@ -35,6 +38,7 @@ import com.facebook.react.bridge.queue.QueueThreadExceptionHandler;
|
||||
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
|
||||
import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl;
|
||||
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
|
||||
import com.facebook.react.devsupport.StackTraceHelper;
|
||||
import com.facebook.react.devsupport.interfaces.DevSupportManager;
|
||||
import com.facebook.react.fabric.Binding;
|
||||
import com.facebook.react.fabric.BindingImpl;
|
||||
@@ -110,7 +114,6 @@ final class ReactInstance {
|
||||
ComponentFactory componentFactory,
|
||||
DevSupportManager devSupportManager,
|
||||
QueueThreadExceptionHandler exceptionHandler,
|
||||
ReactJsExceptionHandler reactExceptionManager,
|
||||
boolean useDevSupport,
|
||||
@Nullable ReactHostInspectorTarget reactHostInspectorTarget) {
|
||||
mBridgelessReactContext = bridgelessReactContext;
|
||||
@@ -154,6 +157,7 @@ final class ReactInstance {
|
||||
// Notify JS if profiling is enabled
|
||||
boolean isProfiling =
|
||||
Systrace.isTracing(Systrace.TRACE_TAG_REACT_APPS | Systrace.TRACE_TAG_REACT_JS_VM_CALLS);
|
||||
|
||||
mHybridData =
|
||||
initHybrid(
|
||||
jsRuntimeFactory,
|
||||
@@ -161,7 +165,7 @@ final class ReactInstance {
|
||||
nativeModulesMessageQueueThread,
|
||||
mJavaTimerManager,
|
||||
jsTimerExecutor,
|
||||
reactExceptionManager,
|
||||
new ReactJsExceptionHandlerImpl(nativeModulesMessageQueueThread),
|
||||
bindingsInstaller,
|
||||
isProfiling,
|
||||
reactHostInspectorTarget);
|
||||
@@ -313,6 +317,29 @@ final class ReactInstance {
|
||||
return mQueueConfiguration;
|
||||
}
|
||||
|
||||
private class ReactJsExceptionHandlerImpl implements ReactJsExceptionHandler {
|
||||
private final MessageQueueThread mNativemodulesmessagequeuethread;
|
||||
|
||||
ReactJsExceptionHandlerImpl(MessageQueueThread nativeModulesMessageQueueThread) {
|
||||
this.mNativemodulesmessagequeuethread = nativeModulesMessageQueueThread;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportJsException(ParsedError error) {
|
||||
JavaOnlyMap data = StackTraceHelper.convertParsedError(error);
|
||||
|
||||
// Simulate async native module method call
|
||||
mNativemodulesmessagequeuethread.runOnQueue(
|
||||
() -> {
|
||||
NativeExceptionsManagerSpec exceptionsManager =
|
||||
(NativeExceptionsManagerSpec)
|
||||
Assertions.assertNotNull(
|
||||
mTurboModuleManager.getModule(NativeExceptionsManagerSpec.NAME));
|
||||
exceptionsManager.reportException(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void loadJSBundle(JSBundleLoader bundleLoader) {
|
||||
// Load the JS bundle
|
||||
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstance.loadJSBundle");
|
||||
|
||||
+3
-3
@@ -24,7 +24,7 @@ internal object FilterHelper {
|
||||
filters ?: return null
|
||||
var chainedEffects: RenderEffect? = null
|
||||
for (i in 0 until filters.size()) {
|
||||
val filter = filters.getMap(i).getEntryIterator().next()
|
||||
val filter = filters.getMap(i).entryIterator.next()
|
||||
val filterName = filter.key
|
||||
val amount = (filter.value as Double).toFloat()
|
||||
|
||||
@@ -51,7 +51,7 @@ internal object FilterHelper {
|
||||
// New ColorMatrix objects represent the identity matrix
|
||||
val resultColorMatrix = ColorMatrix()
|
||||
for (i in 0 until filters.size()) {
|
||||
val filter = filters.getMap(i).getEntryIterator().next()
|
||||
val filter = filters.getMap(i).entryIterator.next()
|
||||
val filterName = filter.key
|
||||
val amount = (filter.value as Double).toFloat()
|
||||
|
||||
@@ -78,7 +78,7 @@ internal object FilterHelper {
|
||||
public fun isOnlyColorMatrixFilters(filters: ReadableArray?): Boolean {
|
||||
filters ?: return false
|
||||
for (i in 0 until filters.size()) {
|
||||
val filter = filters.getMap(i).getEntryIterator().next()
|
||||
val filter = filters.getMap(i).entryIterator.next()
|
||||
val filterName = filter.key
|
||||
if (filterName == "blur") {
|
||||
return false
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ public class LengthPercentage(
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
public fun setFromDynamic(dynamic: Dynamic): LengthPercentage? {
|
||||
return when (dynamic.getType()) {
|
||||
return when (dynamic.type) {
|
||||
ReadableType.Number -> {
|
||||
val value = dynamic.asDouble()
|
||||
if (value >= 0f) {
|
||||
@@ -54,7 +54,7 @@ public class LengthPercentage(
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
FLog.w(ReactConstants.TAG, "Unsupported type for radius property: ${dynamic.getType()}")
|
||||
FLog.w(ReactConstants.TAG, "Unsupported type for radius property: ${dynamic.type}")
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -67,5 +67,15 @@ public class ResourceDrawableIdHelper private constructor() {
|
||||
@JvmStatic
|
||||
public val instance: ResourceDrawableIdHelper
|
||||
get() = resourceDrawableIdHelper
|
||||
|
||||
/**
|
||||
* We're just re-adding this to reduce a breaking change for libraries in React Native 0.75.
|
||||
*
|
||||
* @deprecated Use instance instead
|
||||
*/
|
||||
@Deprecated("Use .instance instead, this API is for backward compat", ReplaceWith("instance"))
|
||||
@JvmName(
|
||||
"DEPRECATED\$getInstance") // We intentionally don't want to expose this accessor to Java.
|
||||
public fun getInstance(): ResourceDrawableIdHelper = instance
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ target_link_libraries(
|
||||
rninstance
|
||||
fabricjni
|
||||
react_featureflagsjni
|
||||
react_render_runtimescheduler
|
||||
turbomodulejsijni
|
||||
fb
|
||||
jsi
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user