From 77cbe6d76db101cd31d5a32b1b485c60d3822474 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 29 Feb 2024 07:17:02 -0800 Subject: [PATCH] Extract RNCORE_CONFIG in a separate variable Summary: This change refactor the RNCORE_CONFIGS in a separate variable to simplify reuse. ## Changelog: [Internal] - Refactor code Reviewed By: dmytrorykun Differential Revision: D54308346 fbshipit-source-id: b9d7c8e0a9b4042f2ab1adeb7aae875264d22499 --- .../codegen/generate-artifacts-executor.js | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor.js b/packages/react-native/scripts/codegen/generate-artifacts-executor.js index c150b1956a6..a89d40cb7f0 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor.js @@ -34,18 +34,19 @@ const REACT_NATIVE_REPOSITORY_ROOT = path.join( ); const REACT_NATIVE_PACKAGE_ROOT_FOLDER = path.join(__dirname, '..', '..'); const CODEGEN_REPO_PATH = `${REACT_NATIVE_REPOSITORY_ROOT}/packages/react-native-codegen`; +const RNCORE_CONFIGS = { + ios: path.join(REACT_NATIVE_PACKAGE_ROOT_FOLDER, 'ReactCommon'), + android: path.join( + REACT_NATIVE_PACKAGE_ROOT_FOLDER, + 'ReactAndroid', + 'build', + 'generated', + 'source', + 'codegen', + ), +}; const CORE_LIBRARIES_WITH_OUTPUT_FOLDER = { - rncore: { - ios: path.join(REACT_NATIVE_PACKAGE_ROOT_FOLDER, 'ReactCommon'), - android: path.join( - REACT_NATIVE_PACKAGE_ROOT_FOLDER, - 'ReactAndroid', - 'build', - 'generated', - 'source', - 'codegen', - ), - }, + rncore: RNCORE_CONFIGS, FBReactNativeSpec: { ios: null, android: path.join(