From d13be5723ff2d60bf815659f49f11988144f3997 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 3 Apr 2025 02:53:49 -0700 Subject: [PATCH] Exclude __mocks__ folder from codegen podspec generation Summary: We should not be adding files inside Jest's __mocks__ folder inside the generated podspec. This takes care of it. Context: https://github.com/reactwg/react-native-new-architecture/discussions/282 Changelog: [Internal] [Changed] - Exclude __mocks__ folder from codegen podspec generation Reviewed By: fabriziocucci Differential Revision: D72318736 fbshipit-source-id: 73a8c3f3cd84794ead9e7ce622f7ac4299d943f1 --- .../generate-artifacts-executor/generateReactCodegenPodspec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js index dc0b057d9e3..8ec3091e732 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js @@ -60,7 +60,7 @@ function getInputFiles(appPath, appPkgJSon) { )[0]; const jsFiles = '-name "Native*.js" -or -name "*NativeComponent.js"'; const tsFiles = '-name "Native*.ts" -or -name "*NativeComponent.ts"'; - const findCommand = `find ${path.join(appPath, jsSrcsDir)} -type f \\( ${jsFiles} -or ${tsFiles} \\)`; + const findCommand = `find ${path.join(appPath, jsSrcsDir)} -type f -not -path "*/__mocks__/*" -and \\( ${jsFiles} -or ${tsFiles} \\)`; const list = String(execSync(findCommand)) .trim() .split('\n')