mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
166
Commits
@@ -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:
|
||||
@@ -288,7 +286,10 @@ jobs:
|
||||
- packages/react-native/ReactAndroid/hermes-engine/build/
|
||||
- packages/react-native/ReactAndroid/src/main/jni/prebuilt/
|
||||
- packages/react-native-gradle-plugin/.gradle/
|
||||
- packages/react-native-gradle-plugin/build/
|
||||
- packages/react-native-gradle-plugin/react-native-gradle-plugin/build/
|
||||
- packages/react-native-gradle-plugin/settings-plugin/build/
|
||||
- packages/react-native-gradle-plugin/shared/build/
|
||||
- packages/react-native-gradle-plugin/shared-testutil/build/
|
||||
- packages/react-native-codegen/lib/
|
||||
|
||||
# -------------------------
|
||||
@@ -327,9 +328,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 +349,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"]
|
||||
|
||||
@@ -61,7 +61,7 @@ references:
|
||||
dependency_versions:
|
||||
xcode_version: &xcode_version "15.2"
|
||||
nodelts_image: &nodelts_image "cimg/node:20.2.0"
|
||||
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.12.1"
|
||||
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.18.2"
|
||||
nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers"
|
||||
|
||||
# -------------------------
|
||||
|
||||
@@ -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: |
|
||||
@@ -16,14 +32,14 @@ runs:
|
||||
GIT_PAGER=cat git show HEAD
|
||||
- name: Update "latest" tag if needed
|
||||
shell: bash
|
||||
if: ${{ inputs.tag == 'latest' }}
|
||||
if: ${{ inputs.is_latest_on_npm == 'true' }}
|
||||
run: |
|
||||
git tag -d "latest"
|
||||
git push origin :latest
|
||||
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.3.1
|
||||
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
|
||||
@@ -134,7 +134,7 @@ runs:
|
||||
XCRESULT_PATH=$(find . -name '*.xcresult')
|
||||
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2.2.4
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
with:
|
||||
name: xcresults
|
||||
@@ -146,7 +146,7 @@ runs:
|
||||
platform: ios
|
||||
- name: Store test results
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
uses: actions/upload-artifact@v2.2.4
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: test-results
|
||||
path: ./reports/junit
|
||||
|
||||
@@ -18,11 +18,15 @@ 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 }}
|
||||
fetch-tags: 'true'
|
||||
fetch-depth: 0
|
||||
- name: Check if on stable branch
|
||||
id: check_stable_branch
|
||||
run: |
|
||||
@@ -46,3 +50,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 }}
|
||||
|
||||
+156
-146
@@ -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: v5-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,12 +163,21 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- 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 }}.tar.gz
|
||||
- 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 }}
|
||||
key: v5-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 }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-13
|
||||
@@ -220,14 +197,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: |
|
||||
@@ -246,46 +225,57 @@ 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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
ls -l .
|
||||
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
|
||||
- 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 +286,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 +326,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 +359,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: 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
|
||||
|
||||
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 +393,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:
|
||||
@@ -416,7 +418,7 @@ jobs:
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -426,18 +428,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:
|
||||
@@ -497,7 +506,7 @@ jobs:
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
@@ -533,7 +542,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
@@ -543,11 +552,12 @@ jobs:
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
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 +588,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: v5-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,12 +160,21 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- 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 }}.tar.gz
|
||||
- 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 }}
|
||||
key: v5-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 }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-13
|
||||
@@ -217,14 +194,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: |
|
||||
@@ -243,46 +222,57 @@ 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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
ls -l .
|
||||
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
|
||||
- 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 +283,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 +323,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 +356,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: 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
|
||||
|
||||
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 +390,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:
|
||||
@@ -413,7 +415,7 @@ jobs:
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -423,18 +425,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:
|
||||
@@ -494,7 +503,7 @@ jobs:
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
@@ -515,7 +524,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
|
||||
@@ -530,7 +541,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
@@ -540,7 +551,7 @@ jobs:
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
@@ -570,18 +581,21 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Create /tmp/hermes/osx-bin directory
|
||||
run: mkdir -p /tmp/hermes/osx-bin
|
||||
- name: Download osx-bin release artifacts
|
||||
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:
|
||||
@@ -698,6 +712,50 @@ jobs:
|
||||
with:
|
||||
name: react-native-package
|
||||
path: build
|
||||
- name: Publish @react-native-community/template
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
shell: bash
|
||||
id: publish-to-npm
|
||||
run: |
|
||||
COMMIT_MSG=$(git log -n1 --pretty=%B);
|
||||
if grep -q '#publish-packages-to-npm&latest' <<< "$COMMIT_MSG"; then
|
||||
echo "TAG=latest" >> $GITHUB_OUTPUT
|
||||
IS_LATEST=true
|
||||
else
|
||||
IS_LATEST=false
|
||||
fi
|
||||
# Go from v0.75.0-rc.4 -> 0.75-stable, which is the template's branching scheme
|
||||
VERSION=$(grep -oE '\d+\.\d+' <<< "${{ github.ref_name }}" | { read version; echo "$version-stable"; })
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
curl -L https://api.github.com/repos/react-native-community/template/actions/workflows/release.yaml/dispatches
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
|
||||
-d "{\"ref\":\"$VERSION\",\"inputs\":{\"version\":\"${{ github.ref_name }}\",\"is_latest_on_npm\":\"$IS_LATEST\"}}"
|
||||
- name: Wait for template to be published
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
timeout-minutes: 3
|
||||
shell: bash
|
||||
env:
|
||||
VERSION: ${{ steps.publish-to-npm.outputs.VERSION }}
|
||||
TAG: ${{ steps.publish-to-npm.outputs.TAG }}
|
||||
run: |
|
||||
echo "Waiting until @react-native-community/template is published to npm"
|
||||
while true; do
|
||||
if curl -o /dev/null -s -f "https://registry.npmjs.org/@react-native-community/template/$VERSION"; then
|
||||
echo "Confirm that @react-native-community/template@$VERSION is published on npm"
|
||||
break
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
while [ "$TAG" == "latest" ]; do
|
||||
CURRENT=$(curl -s "https://registry.npmjs.org/react-native/latest" | jq -r '.version');
|
||||
if [ "$CURRENT" == "$VERSION" ]; then
|
||||
echo "Confirm that @react-native-community/template@latest == $VERSION on npm"
|
||||
break
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
- name: Update rn-diff-purge to generate upgrade-support diff
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
run: |
|
||||
|
||||
+158
-148
@@ -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: v5-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,11 +171,21 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- 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 }}.tar.gz
|
||||
- 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 }}
|
||||
key: v5-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 }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-13
|
||||
@@ -223,14 +205,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: v4-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 +233,58 @@ 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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
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 }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
ls -l .
|
||||
|
||||
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
|
||||
- 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 +295,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 +335,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 +368,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: v4-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 +456,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 +467,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:
|
||||
@@ -483,7 +492,7 @@ jobs:
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -493,18 +502,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:
|
||||
@@ -564,7 +580,7 @@ jobs:
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
@@ -600,7 +616,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
@@ -610,7 +626,7 @@ jobs:
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
@@ -651,12 +667,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 +705,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 +808,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
|
||||
|
||||
+5
-7
@@ -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.4",
|
||||
"@react-native/metro-config": "0.75.4",
|
||||
"@tsconfig/node18": "1.0.1",
|
||||
"@types/react": "^18.2.6",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
@@ -60,6 +60,7 @@
|
||||
"babel-preset-fbjs": "^3.4.0",
|
||||
"chalk": "^4.0.0",
|
||||
"clang-format": "^1.8.0",
|
||||
"commander": "^9.4.1",
|
||||
"connect": "^3.6.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
@@ -92,16 +93,13 @@
|
||||
"nullthrows": "^1.1.1",
|
||||
"prettier": "2.8.8",
|
||||
"prettier-plugin-hermes-parser": "0.22.0",
|
||||
"react": "19.0.0-rc-fb9a90fa48-20240614",
|
||||
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
|
||||
"react": "18.3.1",
|
||||
"react-test-renderer": "18.3.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"shelljs": "^0.8.5",
|
||||
"signedsource": "^1.0.0",
|
||||
"supports-color": "^7.1.0",
|
||||
"typescript": "5.0.4",
|
||||
"ws": "^6.2.2"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"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.4",
|
||||
"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.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,17 +22,16 @@
|
||||
"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.1.0",
|
||||
"@react-native-community/cli-tools": "14.1.0",
|
||||
"@react-native/dev-middleware": "0.75.4",
|
||||
"@react-native/metro-babel-transformer": "0.75.4",
|
||||
"chalk": "^4.0.0",
|
||||
"execa": "^5.1.1",
|
||||
"metro": "^0.80.3",
|
||||
"metro-config": "^0.80.3",
|
||||
"metro-core": "^0.80.3",
|
||||
"node-fetch": "^2.2.0",
|
||||
"querystring": "^0.2.1",
|
||||
"readline": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import querystring from 'querystring';
|
||||
|
||||
export default function parseKeyValueParamArray(
|
||||
keyValueArray: $ReadOnlyArray<string>,
|
||||
): Record<string, string> {
|
||||
@@ -23,8 +21,11 @@ export default function parseKeyValueParamArray(
|
||||
if (item.indexOf('&') !== -1) {
|
||||
throw new Error('Parameter cannot include "&" but found: ' + item);
|
||||
}
|
||||
Object.assign(result, querystring.parse(item));
|
||||
const params = new URLSearchParams(item);
|
||||
params.forEach((value, key) => {
|
||||
// $FlowExpectedError[prop-missing]
|
||||
result[key] = value;
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"@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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"bootstrap": "node ./cli.js bootstrap",
|
||||
@@ -12,24 +12,24 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "19.0.0-rc-fb9a90fa48-20240614",
|
||||
"react-native": "1000.0.0"
|
||||
"react": "18.3.1",
|
||||
"react-native": "0.75.4"
|
||||
},
|
||||
"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.4",
|
||||
"@react-native/core-cli-utils": "0.75.4",
|
||||
"@react-native/eslint-config": "0.75.4",
|
||||
"@react-native/metro-config": "0.75.4",
|
||||
"babel-jest": "^29.6.3",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^12.0.0",
|
||||
"commander": "^9.4.1",
|
||||
"eslint": "^8.19.0",
|
||||
"jest": "^29.6.3",
|
||||
"listr2": "^8.2.1",
|
||||
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
|
||||
"react-test-renderer": "18.3.1",
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"@react-native/metro-babel-transformer": "0.75.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"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.4",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen-typescript-test",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"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.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -35,7 +35,8 @@
|
||||
"invariant": "^2.2.4",
|
||||
"jscodeshift": "^0.14.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"nullthrows": "^1.1.1"
|
||||
"nullthrows": "^1.1.1",
|
||||
"yargs": "^17.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
@@ -52,8 +53,7 @@
|
||||
"hermes-estree": "0.22.0",
|
||||
"micromatch": "^4.0.4",
|
||||
"prettier": "2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"yargs": "^17.6.2"
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/preset-env": "^7.1.6"
|
||||
|
||||
+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':
|
||||
|
||||
@@ -2,3 +2,4 @@ build/
|
||||
app-plugin/build/
|
||||
settings-plugin/build/
|
||||
shared/build/
|
||||
shared-testutil/build/
|
||||
@@ -5,6 +5,7 @@ guava = "31.0.1-jre"
|
||||
javapoet = "1.13.0"
|
||||
junit = "4.13.2"
|
||||
kotlin = "1.9.24"
|
||||
assertj = "3.25.1"
|
||||
|
||||
[libraries]
|
||||
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||
@@ -13,6 +14,7 @@ gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
|
||||
guava = { module = "com.google.guava:guava", version.ref = "guava" }
|
||||
javapoet = { module = "com.squareup:javapoet", version.ref = "javapoet" }
|
||||
junit = {module = "junit:junit", version.ref = "junit" }
|
||||
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
|
||||
|
||||
[plugins]
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -32,6 +32,7 @@
|
||||
"README.md",
|
||||
"react-native-gradle-plugin",
|
||||
"settings-plugin",
|
||||
"shared"
|
||||
"shared",
|
||||
"shared-testutil"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import org.gradle.api.internal.classpath.ModuleRegistry
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.configurationcache.extensions.serviceOf
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
@@ -50,14 +49,8 @@ dependencies {
|
||||
implementation(libs.javapoet)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
|
||||
testRuntimeOnly(
|
||||
files(
|
||||
serviceOf<ModuleRegistry>()
|
||||
.getModule("gradle-tooling-api-builders")
|
||||
.classpath
|
||||
.asFiles
|
||||
.first()))
|
||||
testImplementation(libs.assertj)
|
||||
testImplementation(project(":shared-testutil"))
|
||||
}
|
||||
|
||||
// We intentionally don't build for Java 17 as users will see a cryptic bytecode version
|
||||
@@ -72,7 +65,8 @@ tasks.withType<KotlinCompile>().configureEach {
|
||||
apiVersion = "1.6"
|
||||
// See comment above on JDK 11 support
|
||||
jvmTarget = "11"
|
||||
allWarningsAsErrors = true
|
||||
allWarningsAsErrors =
|
||||
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
-12
@@ -184,19 +184,24 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
|
||||
internal fun getGradleDependenciesToApply(inputFile: File): MutableList<Pair<String, String>> {
|
||||
val model = JsonUtils.fromAutolinkingConfigJson(inputFile)
|
||||
val result = mutableListOf<Pair<String, String>>()
|
||||
model?.dependencies?.values?.forEach { deps ->
|
||||
val nameCleansed = deps.nameCleansed
|
||||
val dependencyConfiguration = deps.platforms?.android?.dependencyConfiguration
|
||||
val buildTypes = deps.platforms?.android?.buildTypes ?: emptyList()
|
||||
if (buildTypes.isEmpty()) {
|
||||
result.add((dependencyConfiguration ?: "implementation") to ":$nameCleansed")
|
||||
} else {
|
||||
buildTypes.forEach { buildType ->
|
||||
result.add(
|
||||
(dependencyConfiguration ?: "${buildType}Implementation") to ":$nameCleansed")
|
||||
model
|
||||
?.dependencies
|
||||
?.values
|
||||
?.filter { it.platforms?.android !== null }
|
||||
?.filterNot { it.platforms?.android?.isPureCxxDependency == true }
|
||||
?.forEach { deps ->
|
||||
val nameCleansed = deps.nameCleansed
|
||||
val dependencyConfiguration = deps.platforms?.android?.dependencyConfiguration
|
||||
val buildTypes = deps.platforms?.android?.buildTypes ?: emptyList()
|
||||
if (buildTypes.isEmpty()) {
|
||||
result.add((dependencyConfiguration ?: "implementation") to ":$nameCleansed")
|
||||
} else {
|
||||
buildTypes.forEach { buildType ->
|
||||
result.add(
|
||||
(dependencyConfiguration ?: "${buildType}Implementation") to ":$nameCleansed")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
+13
-2
@@ -30,10 +30,19 @@ abstract class GeneratePackageListTask : DefaultTask() {
|
||||
|
||||
@TaskAction
|
||||
fun taskAction() {
|
||||
val model = JsonUtils.fromAutolinkingConfigJson(autolinkInputFile.get().asFile)
|
||||
val model =
|
||||
JsonUtils.fromAutolinkingConfigJson(autolinkInputFile.get().asFile)
|
||||
?: error(
|
||||
"""
|
||||
RNGP - Autolinking: Could not parse autolinking config file:
|
||||
${autolinkInputFile.get().asFile.absolutePath}
|
||||
|
||||
The file is either missing or not containing valid JSON so the build won't succeed.
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
val packageName =
|
||||
model?.project?.android?.packageName
|
||||
model.project?.android?.packageName
|
||||
?: error(
|
||||
"RNGP - Autolinking: Could not find project.android.packageName in react-native config output! Could not autolink packages without this field.")
|
||||
|
||||
@@ -85,6 +94,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) }
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -113,6 +113,7 @@ internal object NdkConfiguratorUtils {
|
||||
"**/libreact_utils.so",
|
||||
"**/librrc_image.so",
|
||||
"**/librrc_legacyviewmanagerinterop.so",
|
||||
"**/librrc_textinput.so",
|
||||
"**/librrc_view.so",
|
||||
"**/libruntimeexecutor.so",
|
||||
"**/libturbomodulejsijni.so",
|
||||
|
||||
+80
-12
@@ -8,8 +8,8 @@
|
||||
package com.facebook.react
|
||||
|
||||
import com.facebook.react.ReactExtension.Companion.getGradleDependenciesToApply
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.intellij.lang.annotations.Language
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
@@ -30,7 +30,7 @@ class ReactExtensionTest {
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertEquals(0, deps.size)
|
||||
assertThat(deps).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -57,8 +57,7 @@ class ReactExtensionTest {
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertEquals(1, deps.size)
|
||||
assertTrue("implementation" to ":react-native_oss-library-example" in deps)
|
||||
assertThat(deps).containsExactly("implementation" to ":react-native_oss-library-example")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -86,8 +85,7 @@ class ReactExtensionTest {
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertEquals(1, deps.size)
|
||||
assertTrue("compileOnly" to ":react-native_oss-library-example" in deps)
|
||||
assertThat(deps).containsExactly("compileOnly" to ":react-native_oss-library-example")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -115,9 +113,10 @@ class ReactExtensionTest {
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertEquals(2, deps.size)
|
||||
assertTrue("debugImplementation" to ":react-native_oss-library-example" in deps)
|
||||
assertTrue("releaseImplementation" to ":react-native_oss-library-example" in deps)
|
||||
assertThat(deps)
|
||||
.containsExactly(
|
||||
"debugImplementation" to ":react-native_oss-library-example",
|
||||
"releaseImplementation" to ":react-native_oss-library-example")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -154,9 +153,78 @@ class ReactExtensionTest {
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertEquals(2, deps.size)
|
||||
assertTrue("implementation" to ":react-native_oss-library-example" in deps)
|
||||
assertTrue("implementation" to ":react-native_another-library-for-testing" in deps)
|
||||
assertThat(deps)
|
||||
.containsExactly(
|
||||
"implementation" to ":react-native_oss-library-example",
|
||||
"implementation" to ":react-native_another-library-for-testing")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getGradleDependenciesToApply_withiOSOnlyLibrary_returnsEmptyDepsMap() {
|
||||
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/oss-library-example.podspec",
|
||||
"version": "0.0.0",
|
||||
"configurations": [],
|
||||
"scriptPhases": []
|
||||
},
|
||||
"android": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertThat(deps).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getGradleDependenciesToApply_withIsPureCxxDeps_filtersCorrectly() {
|
||||
val validJsonFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"dependencies": {
|
||||
"@react-native/oss-library-example": {
|
||||
"root": "./node_modules/@react-native/android-example",
|
||||
"name": "@react-native/android-example",
|
||||
"platforms": {
|
||||
"android": {
|
||||
"sourceDir": "src/main/java",
|
||||
"packageImportPath": "com.facebook.react"
|
||||
}
|
||||
}
|
||||
},
|
||||
"@react-native/another-library-for-testing": {
|
||||
"root": "./node_modules/@react-native/cxx-testing",
|
||||
"name": "@react-native/cxx-testing",
|
||||
"platforms": {
|
||||
"android": {
|
||||
"sourceDir": "src/main/java",
|
||||
"packageImportPath": "com.facebook.react",
|
||||
"isPureCxxDependency": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertThat(deps).containsExactly("implementation" to ":react-native_android-example")
|
||||
}
|
||||
|
||||
private fun createJsonFile(@Language("JSON") input: String) =
|
||||
|
||||
+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>()
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import org.gradle.api.internal.classpath.ModuleRegistry
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.configurationcache.extensions.serviceOf
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
@@ -40,14 +39,7 @@ dependencies {
|
||||
implementation(libs.javapoet)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
|
||||
testRuntimeOnly(
|
||||
files(
|
||||
serviceOf<ModuleRegistry>()
|
||||
.getModule("gradle-tooling-api-builders")
|
||||
.classpath
|
||||
.asFiles
|
||||
.first()))
|
||||
testImplementation(project(":shared-testutil"))
|
||||
}
|
||||
|
||||
// We intentionally don't build for Java 17 as users will see a cryptic bytecode version
|
||||
@@ -62,7 +54,8 @@ tasks.withType<KotlinCompile>().configureEach {
|
||||
apiVersion = "1.6"
|
||||
// See comment above on JDK 11 support
|
||||
jvmTarget = "11"
|
||||
allWarningsAsErrors = true
|
||||
allWarningsAsErrors =
|
||||
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+105
-14
@@ -7,14 +7,18 @@
|
||||
|
||||
package com.facebook.react
|
||||
|
||||
import com.facebook.react.model.ModelAutolinkingConfigJson
|
||||
import com.facebook.react.utils.JsonUtils
|
||||
import com.facebook.react.utils.windowsAwareCommandLine
|
||||
import java.io.File
|
||||
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) {
|
||||
|
||||
@@ -23,6 +27,11 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
private val outputFolder =
|
||||
settings.layout.rootDirectory.file("build/generated/autolinking/").asFile
|
||||
|
||||
private val defaultConfigCommand: List<String> =
|
||||
windowsAwareCommandLine(listOf("npx", "@react-native-community/cli", "config")).map {
|
||||
it.toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to autolink libraries using an external command as source of truth.
|
||||
*
|
||||
@@ -37,23 +46,30 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
*/
|
||||
@JvmOverloads
|
||||
public fun autolinkLibrariesFromCommand(
|
||||
command: List<String> = listOf("npx", "@react-native-community/cli", "config"),
|
||||
command: List<String> = defaultConfigCommand,
|
||||
workingDirectory: File? = settings.layout.rootDirectory.dir("../").asFile,
|
||||
lockFiles: FileCollection =
|
||||
settings.layout.rootDirectory
|
||||
.dir("../")
|
||||
.files("yarn.lock", "package-lock.json", "package.json")
|
||||
.files("yarn.lock", "package-lock.json", "package.json", "react-native.config.js")
|
||||
) {
|
||||
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)
|
||||
}
|
||||
|
||||
val updateConfig =
|
||||
object : GenerateConfig {
|
||||
private val pb =
|
||||
ProcessBuilder(command)
|
||||
.directory(workingDirectory)
|
||||
.redirectOutput(ProcessBuilder.Redirect.to(outputFile))
|
||||
.redirectError(ProcessBuilder.Redirect.INHERIT)
|
||||
|
||||
override fun command(): List<String> = pb.command()
|
||||
|
||||
override fun start(): Process = pb.start()
|
||||
}
|
||||
|
||||
checkAndUpdateCache(updateConfig, outputFile, outputFolder, lockFiles)
|
||||
|
||||
linkLibraries(getLibrariesToAutolink(outputFile))
|
||||
}
|
||||
|
||||
@@ -84,9 +100,73 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
}
|
||||
}
|
||||
|
||||
internal interface GenerateConfig {
|
||||
fun command(): List<String>
|
||||
|
||||
fun start(): Process
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val md = MessageDigest.getInstance("SHA-256")
|
||||
|
||||
/**
|
||||
* Determine if our cache is out-of-date
|
||||
*
|
||||
* @param cacheJsonConfig Our current cached autolinking.json config, which may exist
|
||||
* @param cacheFolder The folder we store our cached SHAs and config
|
||||
* @param lockFiles The [FileCollection] of the lockfiles to check.
|
||||
* @return `true` if the cache needs to be rebuilt, `false` otherwise
|
||||
*/
|
||||
internal fun isCacheDirty(
|
||||
cacheJsonConfig: File,
|
||||
cacheFolder: File,
|
||||
lockFiles: FileCollection,
|
||||
): Boolean {
|
||||
if (cacheJsonConfig.exists().not() || cacheJsonConfig.length() == 0L) {
|
||||
return true
|
||||
}
|
||||
val lockFilesChanged = checkAndUpdateLockfiles(lockFiles, cacheFolder)
|
||||
if (lockFilesChanged) {
|
||||
return true
|
||||
}
|
||||
return isConfigModelInvalid(JsonUtils.fromAutolinkingConfigJson(cacheJsonConfig))
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to update the settings cache only if it's entries are dirty
|
||||
*
|
||||
* @param updateJsonConfig A [GenerateConfig] to update the project's autolinking config
|
||||
* @param cacheJsonConfig Our current cached autolinking.json config, which may exist
|
||||
* @param cacheFolder The folder we store our cached SHAs and config
|
||||
* @param lockFiles The [FileCollection] of the lockfiles to check.
|
||||
*/
|
||||
internal fun checkAndUpdateCache(
|
||||
updateJsonConfig: GenerateConfig,
|
||||
cacheJsonConfig: File,
|
||||
cacheFolder: File,
|
||||
lockFiles: FileCollection,
|
||||
) {
|
||||
if (isCacheDirty(cacheJsonConfig, cacheFolder, lockFiles)) {
|
||||
val process = updateJsonConfig.start()
|
||||
|
||||
val finished = process.waitFor(5, TimeUnit.MINUTES)
|
||||
if (!finished || (process.exitValue() != 0)) {
|
||||
val command = updateJsonConfig.command().joinToString(" ")
|
||||
val prefixCommand = "ERROR: autolinkLibrariesFromCommand: process $command"
|
||||
val message =
|
||||
if (!finished) "$prefixCommand timed out"
|
||||
else "$prefixCommand exited with error code: ${process.exitValue()}"
|
||||
val logger = Logging.getLogger("ReactSettingsExtension")
|
||||
logger.error(message)
|
||||
if (cacheJsonConfig.length() != 0L) {
|
||||
logger.error(cacheJsonConfig.readText().substring(0, 1024))
|
||||
}
|
||||
cacheJsonConfig.delete()
|
||||
throw GradleException(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to check if the provided lockfiles have been updated or not. This function
|
||||
* will both check and update the lockfiles hashes if necessary.
|
||||
@@ -112,12 +192,23 @@ 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) =
|
||||
String.format("%032x", BigInteger(1, md.digest(lockFile.readBytes())))
|
||||
|
||||
internal fun isConfigModelInvalid(model: ModelAutolinkingConfigJson?) =
|
||||
model?.project?.android?.packageName == null
|
||||
}
|
||||
}
|
||||
|
||||
+268
-1
@@ -7,10 +7,12 @@
|
||||
|
||||
package com.facebook.react
|
||||
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.checkAndUpdateCache
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.checkAndUpdateLockfiles
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.computeSha256
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.getLibrariesToAutolink
|
||||
import groovy.test.GroovyTestCase.assertEquals
|
||||
import com.facebook.react.ReactSettingsExtension.GenerateConfig
|
||||
import java.io.File
|
||||
import org.gradle.testfixtures.ProjectBuilder
|
||||
import org.intellij.lang.annotations.Language
|
||||
@@ -86,7 +88,8 @@ class ReactSettingsExtensionTest {
|
||||
"cxxModuleCMakeListsModuleName": null,
|
||||
"cxxModuleCMakeListsPath": null,
|
||||
"cxxModuleHeaderName": null,
|
||||
"dependencyConfiguration": "implementation"
|
||||
"dependencyConfiguration": "implementation",
|
||||
"isPureCxxDependency": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,6 +106,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()
|
||||
@@ -206,6 +238,241 @@ class ReactSettingsExtensionTest {
|
||||
File(buildFolder, "package-lock.json.sha").readText())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun skipUpdateIfConfigInCacheIsValid() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder = tempFolder.newFolder("build")
|
||||
val generatedFolder = tempFolder.newFolder("build", "generated")
|
||||
val outputFile =
|
||||
File(generatedFolder, "autolinking.json").apply {
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"root": "/",
|
||||
"reactNativePath": "/node_modules/react-native",
|
||||
"reactNativeVersion": "0.75",
|
||||
"dependencies": {},
|
||||
"healthChecks": [],
|
||||
"platforms": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
},
|
||||
"assets": [],
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {
|
||||
"sourceDir": "/",
|
||||
"appName": "app",
|
||||
"packageName": "com.TestApp",
|
||||
"applicationId": "com.TestApp",
|
||||
"mainActivity": ".MainActivity",
|
||||
"assets": []
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfileCollection = project.files("yarn.lock")
|
||||
|
||||
// Prebuild the shas with the invalid empty autolinking.json
|
||||
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
|
||||
|
||||
val monitoredUpdateConfig = createMonitoredUpdateConfig()
|
||||
|
||||
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
|
||||
|
||||
// The autolinking.json file is valid, SHA's are untouched therefore config should NOT be
|
||||
// refreshed
|
||||
assertThat(monitoredUpdateConfig.run).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun checkAndUpdateConfigIfEmpty() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder = tempFolder.newFolder("build")
|
||||
val generatedFolder = tempFolder.newFolder("build", "generated")
|
||||
val outputFile = File(generatedFolder, "autolinking.json").apply { writeText("") }
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfileCollection = project.files("yarn.lock")
|
||||
|
||||
// Prebuild the shas with the invalid empty autolinking.json
|
||||
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
|
||||
|
||||
val monitoredUpdateConfig = createMonitoredUpdateConfig()
|
||||
|
||||
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
|
||||
|
||||
// The autolinking.json file is invalid and should be refreshed
|
||||
assertThat(monitoredUpdateConfig.run).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun checkAndUpdateConfigIfCachedConfigInvalid() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder = tempFolder.newFolder("build")
|
||||
val generatedFolder = tempFolder.newFolder("build", "generated")
|
||||
val outputFile =
|
||||
File(generatedFolder, "autolinking.json").apply {
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfileCollection = project.files("yarn.lock")
|
||||
|
||||
// Prebuild the shas with the invalid empty autolinking.json
|
||||
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
|
||||
|
||||
val monitoredUpdateConfig = createMonitoredUpdateConfig()
|
||||
|
||||
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
|
||||
|
||||
// The autolinking.json file is invalid and should be refreshed
|
||||
assertThat(monitoredUpdateConfig.run).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withMissingAutolinkingFile_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val emptyConfigFile = File(tempFolder.newFolder("build", "autolinking"), "autolinking.json")
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(emptyConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withInvalidAutolinkingFile_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withMissingDependenciesInJson_returnsFalse() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withExistingEmptyDependenciesInJson_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"dependencies": {}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withExistingDependenciesInJson_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
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())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
private fun createJsonFile(@Language("JSON") input: String) =
|
||||
tempFolder.newFile().apply { writeText(input) }
|
||||
|
||||
private fun createMonitoredUpdateConfig() =
|
||||
object : GenerateConfig {
|
||||
var run = false
|
||||
|
||||
override fun start(): Process {
|
||||
run = true
|
||||
return ProcessBuilder("true").start()
|
||||
}
|
||||
|
||||
override fun command(): List<String> = listOf("true")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ include(
|
||||
":react-native-gradle-plugin",
|
||||
":settings-plugin",
|
||||
":shared",
|
||||
":shared-testutil",
|
||||
)
|
||||
|
||||
rootProject.name = "gradle-plugins-root"
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins { alias(libs.plugins.kotlin.jvm) }
|
||||
|
||||
repositories { mavenCentral() }
|
||||
|
||||
group = "com.facebook.react"
|
||||
|
||||
dependencies { implementation(libs.junit) }
|
||||
|
||||
java { targetCompatibility = JavaVersion.VERSION_11 }
|
||||
|
||||
kotlin { jvmToolchain(17) }
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
apiVersion = "1.6"
|
||||
jvmTarget = "11"
|
||||
allWarningsAsErrors =
|
||||
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
testLogging {
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
showExceptions = true
|
||||
showCauses = true
|
||||
showStackTraces = true
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ dependencies {
|
||||
implementation(libs.gson)
|
||||
implementation(libs.guava)
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(project(":shared-testutil"))
|
||||
}
|
||||
|
||||
java { targetCompatibility = JavaVersion.VERSION_11 }
|
||||
@@ -28,7 +29,8 @@ tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
apiVersion = "1.6"
|
||||
jvmTarget = "11"
|
||||
allWarningsAsErrors = true
|
||||
allWarningsAsErrors =
|
||||
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+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
|
||||
)
|
||||
|
||||
+17
-2
@@ -21,8 +21,23 @@ object JsonUtils {
|
||||
}
|
||||
|
||||
fun fromAutolinkingConfigJson(input: File): ModelAutolinkingConfigJson? =
|
||||
input.bufferedReader().use {
|
||||
runCatching { gsonConverter.fromJson(it, ModelAutolinkingConfigJson::class.java) }
|
||||
input.bufferedReader().use { reader ->
|
||||
runCatching {
|
||||
// We sanitize the output of the `config` command as it could contain debug logs
|
||||
// such as:
|
||||
//
|
||||
// > AwesomeProject@0.0.1 npx
|
||||
// > rnc-cli config
|
||||
//
|
||||
// which will render the JSON invalid.
|
||||
val content =
|
||||
reader
|
||||
.readLines()
|
||||
.filterNot { line -> line.startsWith(">") }
|
||||
.joinToString("\n")
|
||||
.trim()
|
||||
gsonConverter.fromJson(content, ModelAutolinkingConfigJson::class.java)
|
||||
}
|
||||
.getOrNull()
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ package com.facebook.react.utils
|
||||
import com.facebook.react.utils.KotlinStdlibCompatUtils.lowercaseCompat
|
||||
import java.io.File
|
||||
|
||||
internal object Os {
|
||||
object Os {
|
||||
|
||||
fun isWindows(): Boolean =
|
||||
System.getProperty("os.name")?.lowercaseCompat()?.contains("windows") ?: false
|
||||
+3
-3
@@ -7,17 +7,17 @@
|
||||
|
||||
package com.facebook.react.utils
|
||||
|
||||
internal fun windowsAwareCommandLine(vararg args: Any): List<Any> =
|
||||
fun windowsAwareCommandLine(vararg args: Any): List<Any> =
|
||||
windowsAwareCommandLine(args.toList())
|
||||
|
||||
internal fun windowsAwareCommandLine(args: List<Any>): List<Any> =
|
||||
fun windowsAwareCommandLine(args: List<Any>): List<Any> =
|
||||
if (Os.isWindows()) {
|
||||
listOf("cmd", "/c") + args
|
||||
} else {
|
||||
args
|
||||
}
|
||||
|
||||
internal fun windowsAwareBashCommandLine(
|
||||
fun windowsAwareBashCommandLine(
|
||||
vararg args: String,
|
||||
bashWindowsHome: String? = null
|
||||
): List<String> =
|
||||
+55
-1
@@ -185,6 +185,54 @@ class JsonUtilsTest {
|
||||
assertEquals("implementation", parsed.project!!.android!!.dependencyConfiguration)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fromAutolinkingConfigJson_withInfoLogs_sanitizeAndParseIt() {
|
||||
@Suppress("JsonStandardCompliance")
|
||||
val validJson =
|
||||
createJsonFile(
|
||||
"""
|
||||
|
||||
> AwesomeProject@0.0.1 npx
|
||||
> rnc-cli config
|
||||
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"project": {
|
||||
"ios": {
|
||||
"sourceDir": "./packages/rn-tester",
|
||||
"xcodeProject": {
|
||||
"name": "RNTesterPods.xcworkspace",
|
||||
"isWorkspace": true
|
||||
},
|
||||
"automaticPodsInstallation": false
|
||||
},
|
||||
"android": {
|
||||
"sourceDir": "./packages/rn-tester",
|
||||
"appName": "RN-Tester",
|
||||
"packageName": "com.facebook.react.uiapp",
|
||||
"applicationId": "com.facebook.react.uiapp",
|
||||
"mainActivity": ".RNTesterActivity",
|
||||
"watchModeCommandParams": [
|
||||
"--mode HermesDebug"
|
||||
],
|
||||
"dependencyConfiguration": "implementation"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
val parsed = JsonUtils.fromAutolinkingConfigJson(validJson)!!
|
||||
|
||||
assertThat("./packages/rn-tester").isEqualTo(parsed.project!!.android!!.sourceDir)
|
||||
assertThat("RN-Tester").isEqualTo(parsed.project!!.android!!.appName)
|
||||
assertThat("com.facebook.react.uiapp").isEqualTo(parsed.project!!.android!!.packageName)
|
||||
assertThat("com.facebook.react.uiapp").isEqualTo(parsed.project!!.android!!.applicationId)
|
||||
assertThat(".RNTesterActivity").isEqualTo(parsed.project!!.android!!.mainActivity)
|
||||
assertThat("--mode HermesDebug")
|
||||
.isEqualTo(parsed.project!!.android!!.watchModeCommandParams!![0])
|
||||
assertThat("implementation").isEqualTo(parsed.project!!.android!!.dependencyConfiguration)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fromAutolinkingConfigJson_withDependenciesSpecified_canParseIt() {
|
||||
val validJson =
|
||||
@@ -216,7 +264,8 @@ class JsonUtilsTest {
|
||||
"cxxModuleCMakeListsModuleName": null,
|
||||
"cxxModuleCMakeListsPath": null,
|
||||
"cxxModuleHeaderName": null,
|
||||
"dependencyConfiguration": "implementation"
|
||||
"dependencyConfiguration": "implementation",
|
||||
"isPureCxxDependency": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,6 +347,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.4",
|
||||
"main": "build/index.js",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
@@ -17,11 +17,11 @@
|
||||
"directory": "packages/react-native-info"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-community/cli-config": "^13.6.4",
|
||||
"@react-native-community/cli-platform-apple": "^13.6.4",
|
||||
"@react-native-community/cli-tools": "^13.6.4",
|
||||
"@react-native-community/cli-types": "^13.6.4",
|
||||
"commander": "^12.0.0",
|
||||
"@react-native-community/cli-config": "14.1.0",
|
||||
"@react-native-community/cli-platform-apple": "14.1.0",
|
||||
"@react-native-community/cli-tools": "14.1.0",
|
||||
"@react-native-community/cli-types": "14.1.0",
|
||||
"commander": "^9.4.1",
|
||||
"fs-extra": "^11.2.0",
|
||||
"yaml": "^2.4.1"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"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.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^18.2.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/oss-library-example",
|
||||
"version": "0.0.1",
|
||||
"version": "0.75.4",
|
||||
"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.4",
|
||||
"react-native": "0.75.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/test-renderer",
|
||||
"private": true,
|
||||
"version": "0.75.0-main",
|
||||
"version": "0.75.4",
|
||||
"description": "A Test rendering library for React Native",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -26,7 +26,7 @@ use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
|
||||
new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED" : "")
|
||||
is_fabric_enabled = true #is_new_arch_enabled || ENV["RCT_FABRIC_ENABLED"]
|
||||
hermes_flag = (use_hermes ? " -DUSE_HERMES" : "")
|
||||
other_cflags = "$(inherited)" + folly_compiler_flags + new_arch_enabled_flag + hermes_flag
|
||||
other_cflags = "$(inherited) " + folly_compiler_flags + new_arch_enabled_flag + hermes_flag
|
||||
|
||||
header_search_paths = [
|
||||
"$(PODS_TARGET_SRCROOT)/../../ReactCommon",
|
||||
@@ -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\""}
|
||||
|
||||
@@ -72,9 +72,10 @@ RCT_EXPORT_METHOD(readAsDataURL
|
||||
nil);
|
||||
} else {
|
||||
NSString *type = [RCTConvert NSString:blob[@"type"]];
|
||||
NSString *text = [NSString stringWithFormat:@"data:%@;base64,%@",
|
||||
type != nil && [type length] > 0 ? type : @"application/octet-stream",
|
||||
[data base64EncodedStringWithOptions:0]];
|
||||
NSString *text = [NSString
|
||||
stringWithFormat:@"data:%@;base64,%@",
|
||||
![type isEqual:[NSNull null]] && [type length] > 0 ? type : @"application/octet-stream",
|
||||
[data base64EncodedStringWithOptions:0]];
|
||||
|
||||
resolve(text);
|
||||
}
|
||||
|
||||
@@ -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,9 +14,9 @@ const version: $ReadOnly<{
|
||||
patch: number,
|
||||
prerelease: string | null,
|
||||
}> = {
|
||||
major: 1000,
|
||||
minor: 0,
|
||||
patch: 0,
|
||||
major: 0,
|
||||
minor: 75,
|
||||
patch: 4,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
+27141
-16426
File diff suppressed because it is too large
Load Diff
+1630
-2675
File diff suppressed because it is too large
Load Diff
+1682
-2945
File diff suppressed because it is too large
Load Diff
+27607
-16730
File diff suppressed because it is too large
Load Diff
+1652
-2709
File diff suppressed because it is too large
Load Diff
+1733
-2980
File diff suppressed because it is too large
Load Diff
@@ -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(' ')
|
||||
}
|
||||
|
||||
|
||||
+17
-15
@@ -182,21 +182,23 @@ type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T
|
||||
|
||||
export interface TransformsStyle {
|
||||
transform?:
|
||||
| MaximumOneOf<
|
||||
PerspectiveTransform &
|
||||
RotateTransform &
|
||||
RotateXTransform &
|
||||
RotateYTransform &
|
||||
RotateZTransform &
|
||||
ScaleTransform &
|
||||
ScaleXTransform &
|
||||
ScaleYTransform &
|
||||
TranslateXTransform &
|
||||
TranslateYTransform &
|
||||
SkewXTransform &
|
||||
SkewYTransform &
|
||||
MatrixTransform
|
||||
>[]
|
||||
| Readonly<
|
||||
MaximumOneOf<
|
||||
PerspectiveTransform &
|
||||
RotateTransform &
|
||||
RotateXTransform &
|
||||
RotateYTransform &
|
||||
RotateZTransform &
|
||||
ScaleTransform &
|
||||
ScaleXTransform &
|
||||
ScaleYTransform &
|
||||
TranslateXTransform &
|
||||
TranslateYTransform &
|
||||
SkewXTransform &
|
||||
SkewYTransform &
|
||||
MatrixTransform
|
||||
>[]
|
||||
>
|
||||
| string
|
||||
| undefined;
|
||||
transformOrigin?: Array<string | number> | string | undefined;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -651,8 +651,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
- (NSString *)returnKeyTypeToString:(UIReturnKeyType)returnKeyType
|
||||
{
|
||||
switch (returnKeyType) {
|
||||
case UIReturnKeyDefault:
|
||||
return @"Default";
|
||||
case UIReturnKeyGo:
|
||||
return @"Go";
|
||||
case UIReturnKeyNext:
|
||||
@@ -680,7 +678,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
{
|
||||
returnKeyTypesSet = [NSSet setWithObjects:@(UIReturnKeyDone),
|
||||
@(UIReturnKeyGo),
|
||||
@(UIReturnKeyDefault),
|
||||
@(UIReturnKeyNext),
|
||||
@(UIReturnKeySearch),
|
||||
@(UIReturnKeySend),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user