@@ -100,35 +100,20 @@ function cleanupEmptyFilesAndFolders(filepath /*: string */) {
100
100
function readGeneratedAutolinkingOutput (
101
101
baseOutputPath /*: string */ ,
102
102
) /*: $FlowFixMe */ {
103
- // When run from Xcode, the generated file can be found via `RCT_SCRIPT_OUTPUT_DIR` consistently
104
- if ( process . env . RCT_SCRIPT_OUTPUT_DIR ) {
105
- const xcodeAutolinkingGeneratedPath = path . resolve (
106
- process . env . RCT_SCRIPT_OUTPUT_DIR ,
107
- 'build/generated/autolinking/autolinking.json' ,
108
- ) ;
109
- if ( fs . existsSync ( xcodeAutolinkingGeneratedPath ) ) {
110
- // $FlowFixMe[unsupported-syntax]
111
- return require ( xcodeAutolinkingGeneratedPath ) ;
112
- }
113
- codegenLog (
114
- `Could not find generated autolinking output at: ${ xcodeAutolinkingGeneratedPath } ` ,
115
- ) ;
116
- }
117
-
118
- // Otherwise, we expect to find it in the output path iself, when it's been generated in Cocoapods
119
- const podsAutolinkingGeneratedPath = path . resolve (
103
+ // NOTE: Generated by scripts/cocoapods/autolinking.rb in list_native_modules (called by use_native_modules)
104
+ const autolinkingGeneratedPath = path . resolve (
120
105
baseOutputPath ,
121
106
'build/generated/autolinking/autolinking.json' ,
122
107
) ;
123
- if ( fs . existsSync ( podsAutolinkingGeneratedPath ) ) {
108
+ if ( fs . existsSync ( autolinkingGeneratedPath ) ) {
124
109
// $FlowFixMe[unsupported-syntax]
125
- return require ( podsAutolinkingGeneratedPath ) ;
110
+ return require ( autolinkingGeneratedPath ) ;
111
+ } else {
112
+ codegenLog (
113
+ `Could not find generated autolinking output at: ${ autolinkingGeneratedPath } ` ,
114
+ ) ;
115
+ return null ;
126
116
}
127
- codegenLog (
128
- `Could not find generated autolinking output at: ${ podsAutolinkingGeneratedPath } ` ,
129
- ) ;
130
-
131
- return null ;
132
117
}
133
118
134
119
function readReactNativeConfig (
0 commit comments