From 42b01a32a137f18ae9fd2f00914f2edb0e107421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Mon, 7 Mar 2022 06:44:25 -0800 Subject: [PATCH] Use relative installation root instead of absolute to avoid embedding absolute paths in pods project (#33187) Summary: Use relative installation root instead of absolute to avoid embedding absolute paths in pods project Also removes a leading space from each path. Before: 155846827-94c474b7-8a79-45fc-a900-8860a94fb318 After: Screenshot 2022-02-26 at 15 58 32 ## Changelog [iOS] [Fixed] - Remove absolute paths from pods project Pull Request resolved: https://github.com/facebook/react-native/pull/33187 Test Plan: Pod install and view in Xcode FBReactNativeSpec -> Build Phases -> [CP-User] Generate Specs Reviewed By: ShikaSD Differential Revision: D34549541 Pulled By: dmitryrykun fbshipit-source-id: 2926b093fb87f50ef9988e23fce593348f00077d --- .../NativeModuleExample/ScreenshotManager.podspec | 2 +- .../xcshareddata/xcschemes/RNTester.xcscheme | 2 +- .../xcschemes/RNTesterIntegrationTests.xcscheme | 2 +- .../xcshareddata/xcschemes/RNTesterUnitTests.xcscheme | 2 +- scripts/react_native_pods.rb | 7 ++++--- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec index 1faa313fa62506..6399ab175887bf 100644 --- a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec +++ b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec @@ -25,7 +25,7 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,mm,swift}" s.requires_arc = true - s.dependency "React" + s.dependency "React-Core" s.dependency "RCT-Folly", folly_version # s.dependency "..." diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme b/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme index 2731ada4d7698e..ec1fa4d285851e 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme +++ b/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme @@ -3,7 +3,7 @@ LastUpgradeVersion = "1210" version = "1.3"> { :js_srcs_pattern => "Native*.js", - :generated_dir => "#{Pod::Config.instance.installation_root}/#{output_dir_module}/#{library_name}", + :generated_dir => "#{relative_installation_root}/#{output_dir_module}/#{library_name}", :generated_files => [ "#{library_name}.h", "#{library_name}-generated.mm" @@ -561,7 +562,7 @@ def use_react_native_codegen!(spec, options={}) }, "components" => { :js_srcs_pattern => "*NativeComponent.js", - :generated_dir => "#{Pod::Config.instance.installation_root}/#{output_dir_component}/#{library_name}", + :generated_dir => "#{relative_installation_root}/#{output_dir_component}/#{library_name}", :generated_files => [ "ComponentDescriptors.h", "EventEmitters.cpp", @@ -610,7 +611,7 @@ def use_react_native_codegen!(spec, options={}) spec.script_phase = { :name => 'Generate Specs', :input_files => input_files, # This also needs to be relative to Xcode - :output_files => ["${DERIVED_FILE_DIR}/codegen-#{library_name}.log"].concat(generated_files.map { |filename| " ${PODS_TARGET_SRCROOT}/#{filename}"} ), + :output_files => ["${DERIVED_FILE_DIR}/codegen-#{library_name}.log"].concat(generated_files.map { |filename| "${PODS_TARGET_SRCROOT}/#{filename}"} ), # The final generated files will be created when this script is invoked at Xcode build time. :script => get_script_phases_no_codegen_discovery( react_native_path: react_native_path,