mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Codegen: exclude NativeModules that are not for the specific platform
Summary: If a native module schema has `excludedPlatforms` defined, honor it and skip the module that doesn't belong to the platform. E.g. NativeImagePickerIOS shouldn't generate anything for Android codegen output. Similarly, IntentAndroid shouldn't generate anything for iOS codegen output. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D24373092 fbshipit-source-id: cfeb455a18c92f60191d988af2e9ce7ea5021304
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ec094e75bd
commit
76098831fd
+4
@@ -282,8 +282,12 @@ module.exports = {
|
||||
Object.keys(nativeModules).forEach(codegenModuleName => {
|
||||
const {
|
||||
aliases,
|
||||
excludedPlatforms,
|
||||
spec: {properties},
|
||||
} = nativeModules[codegenModuleName];
|
||||
if (excludedPlatforms != null && excludedPlatforms.includes('android')) {
|
||||
return;
|
||||
}
|
||||
const resolveAlias = createAliasResolver(aliases);
|
||||
const className = `${codegenModuleName}Spec`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user