From 807dfb4a1bb2923018edee25f12e0b5cede2888f Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 7 May 2025 06:12:06 -0700 Subject: [PATCH] Fix build codegen (#51130) Summary: When testing the release by running the `test-e2e-local` for RNTester on iOS, the script sometimes fails because it expect to have codegen properly built before running the app. This fix makes sure we build the codegen package. ## Changelog: [Internal] - Fix building the codegen Pull Request resolved: https://github.com/facebook/react-native/pull/51130 Test Plan: Tested locally Reviewed By: fabriziocucci Differential Revision: D74248031 Pulled By: cipolleschi fbshipit-source-id: 319f3332c616f7118b673fb7acb63c2e15946b2c --- scripts/release-testing/test-e2e-local.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/release-testing/test-e2e-local.js b/scripts/release-testing/test-e2e-local.js index 35a1399c3a6..168a3979f56 100644 --- a/scripts/release-testing/test-e2e-local.js +++ b/scripts/release-testing/test-e2e-local.js @@ -224,17 +224,16 @@ async function testRNTester( ciArtifacts /*:Unwrap> */, onReleaseBranch /*: boolean */, ) { + // Build Codegen as we're on a empty environment and metro needs it. + // This can be removed once we have codegen hooked in the `yarn build` step. + console.info('[Codegen] >>> Building react-native-codegen...'); + exec('./packages/react-native-codegen/scripts/oss/build.sh'); + // FIXME: make sure that the commands retains colors // (--ansi) doesn't always work // see also https://github.com/shelljs/shelljs/issues/86 pushd('packages/rn-tester'); - // Build Codegen as we're on a empty environment and metro needs it. - // This can be removed once we have codegen hooked in the `yarn build` step. - exec( - '../../gradlew :packages:react-native:ReactAndroid:buildCodegenCLI --quiet', - ); - if (argv.platform === 'ios') { await testRNTesterIOS(ciArtifacts, onReleaseBranch); } else {