From 1d89fad8245e6a6d50cb73192f4252ff074d5b65 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Thu, 18 Jan 2024 22:52:24 -0800 Subject: [PATCH] Ignore TM specs with out-of-tree platform suffix (#42360) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42360 In cases where you merge out-of-tree platforms like react-native-windows with react-native mobile JS files, codegen awareness of the Windows suffix is useful. This helps prevent the creation of generated code for iOS and Android in mixed out-of-tree platform folders. ## Changelog [Internal] Reviewed By: mdvacca Differential Revision: D52873212 fbshipit-source-id: ad6b1471e63d68057f54c79141123fb15f8aab5e --- packages/react-native-codegen/src/parsers/utils.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react-native-codegen/src/parsers/utils.js b/packages/react-native-codegen/src/parsers/utils.js index 77d62848e4a..77c30275951 100644 --- a/packages/react-native-codegen/src/parsers/utils.js +++ b/packages/react-native-codegen/src/parsers/utils.js @@ -85,6 +85,12 @@ function verifyPlatforms( return; } + if (name.endsWith('Windows')) { + excludedPlatforms.add('iOS'); + excludedPlatforms.add('android'); + return; + } + if (name.endsWith('Cxx')) { cxxOnly = true; excludedPlatforms.add('iOS');