Skip to content

Commit

Permalink
Fix unstable RCTAppDelegate podspec
Browse files Browse the repository at this point in the history
Summary:
This change should fix [#39971](#39971), computing the relative path from the App path to the pod installation root and using that instead of the absolute path to the `react-native.config.js` file

## Changelog
[Internal] - Stabilize RCTAppDelegate podspec

Differential Revision: D50323710
  • Loading branch information
Riccardo Cipolleschi authored and facebook-github-bot committed Oct 16, 2023
1 parent e643a53 commit b8b9450
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Pod::Spec.new do |s|
s.dependency "React-debug"
s.dependency "React-rendererdebug"

relative_path_from = Pathname.new(ENV['APP_PATH']).relative_path_from(Pod::Config.instance.installation_root)

s.script_phases = {
:name => "Generate Legacy Components Interop",
:script => "
Expand All @@ -125,7 +127,7 @@ source $WITH_ENVIRONMENT
${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{ENV['APP_PATH']} -o ${REACT_NATIVE_PATH}/Libraries/AppDelegate
",
:execution_position => :before_compile,
:input_files => ["#{ENV['APP_PATH']}/react-native.config.js"],
:input_files => ["#{relative_path_from}/react-native.config.js"],
:output_files => ["${REACT_NATIVE_PATH}/Libraries/AppDelegate/RCTLegacyInteropComponents.mm"],
}
end
Expand Down

0 comments on commit b8b9450

Please sign in to comment.