Skip to content

Create scripts for building patched React Native - #9

Merged
hsource merged 2 commits into
mainfrom
harry-build
Nov 19, 2025
Merged

Create scripts for building patched React Native#9
hsource merged 2 commits into
mainfrom
harry-build

Conversation

@hsource

@hsource hsource commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator

Motivation

As part of Task 1.1: Build React Native 0.81 in an empty test project, we need to make sure we can build a fork of React Native that builds with a test project.

This PR creates scripts that can be used with the instructions there to build a fork of React Native.

Changes

Before starting, I did these steps: How did we figure out the steps for “Create scripts for building patched React Native”

Build scripts

  • Add scripts/build-package.js to build iOS artifacts
    • Downloads and expands Hermes source if missing
    • Copies Hermes engine files to the Hermes source folder
    • Builds types and FBReactNativeSpec
    • Builds Hermes and hermesc binaries for macOS
    • Copies built binaries to sdks/hermesc/osx-bin
  • Add scripts/move-react-native-package.sh to move react-native package files to root
    • Moves all root files to a saved-root-files directory
    • Moves contents of packages/react-native to root
    • Updates .gitignore to remove /packages/react-native/ from paths and allow required files
    • Supports --reverse flag to undo the move

Gradle configuration

  • Add publishAllToGitLab task in build.gradle.kts to publish Android artifacts to GitLab Maven repository
  • Add GitLab Maven repository configuration in packages/react-native/ReactAndroid/publish.gradle
    • Configures authentication using gitlabPrivateToken property
    • Points to GitLab project packages endpoint

Testing

  1. Follow instructions in Part 3b: upload Android JARs and create tag to install to run the scripts
  2. Install the package using yarn add wanderlog/react-native#v0.81.5-wanderlog.11
  3. Clean the build pushd android && ./gradlew clean && popd && cd ios && xcodebuild clean -workspace wanderlog.xcworkspace -scheme wanderlog`
  4. Run yarn android and yarn ios and verify they work

@julesyoungberg julesyoungberg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One comment about potentially adding a dry-run option to the script for moving files.

Docs also look good. Might be a typo at the start of Part 3b under 'Why we need to do this': 'When building the an Android the app directly builds them using the React Native JARs.'

Also, would it be worth creating a script out of the codeblock at the end of Part 3b?

Comment thread scripts/move-react-native-package.sh
@hsource
hsource merged this pull request into main Nov 19, 2025
40 of 45 checks passed
hsource added a commit that referenced this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants