@@ -115,10 +115,7 @@ def resources_pod(project_root, target_platform, platforms)
115115 Pathname . new ( app_dir ) . relative_path_from ( project_root ) . to_s
116116end
117117
118- def use_react_native! ( project_root , react_native , options )
119- version = package_version ( react_native . to_s ) . segments
120- version = v ( version [ 0 ] , version [ 1 ] , version [ 2 ] )
121-
118+ def use_react_native! ( project_root , react_native , version , options )
122119 require_relative ( react_native_pods ( version ) )
123120
124121 include_react_native! ( **options ,
@@ -154,7 +151,7 @@ def make_project!(project_root, target_platform, options)
154151 end
155152 when 'ReactTestAppTests'
156153 target . build_configurations . each do |config |
157- project [ 'uitestsBuildSettings ' ] . each do |setting , value |
154+ project [ 'testsBuildSettings ' ] . each do |setting , value |
158155 config . build_settings [ setting ] = value
159156 end
160157 end
@@ -192,17 +189,17 @@ def use_test_app_internal!(target_platform, options)
192189 xcodeproj = 'ReactTestApp.xcodeproj'
193190 project_root = Pod ::Config . instance . installation_root
194191 project_target = make_project! ( project_root , target_platform , options )
195- xcodeproj_dst , platforms = project_target . values_at ( :xcodeproj_path , :platforms )
192+ xcodeproj_dst , platforms , react_native_path , react_native_version = project_target . values_at (
193+ :xcodeproj_path , :platforms , :react_native_path , :react_native_version
194+ )
196195
197- if project_target [ :use_new_arch ] || project_target [ : react_native_version] >= v ( 0 , 73 , 0 )
196+ if project_target [ :use_new_arch ] || react_native_version >= v ( 0 , 73 , 0 )
198197 install! 'cocoapods' , :deterministic_uuids => false
199198 end
200199
201200 # As of 0.75, we should use `use_native_modules!` from `react-native` instead
202- if project_target [ :react_native_version ] < v ( 0 , 75 , 0 )
203- require_relative ( autolink_script_path ( project_root ,
204- project_target [ :react_native_path ] ,
205- project_target [ :react_native_version ] ) )
201+ if react_native_version < v ( 0 , 75 , 0 )
202+ require_relative ( autolink_script_path ( project_root , react_native_path , react_native_version ) )
206203 end
207204
208205 begin
@@ -218,7 +215,9 @@ def use_test_app_internal!(target_platform, options)
218215 react_native_post_install = nil
219216
220217 target 'ReactTestApp' do
221- react_native_post_install = use_react_native! ( project_root , project_target [ :react_native_path ] ,
218+ react_native_post_install = use_react_native! ( project_root ,
219+ react_native_path ,
220+ react_native_version ,
222221 options )
223222
224223 pod 'ReactNativeHost' , :path => resolve_module_relative ( '@rnx-kit/react-native-host' )
0 commit comments