mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Codegen: Always prepare filesystem
Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fcead14b0e
commit
309ee06ead
@@ -194,7 +194,9 @@ def use_react_native_codegen!(spec, options={})
|
||||
end
|
||||
|
||||
# Prepare filesystem by creating empty files that will be picked up as references by CocoaPods.
|
||||
spec.prepare_command = "mkdir -p #{generated_dirs.join(" ")} && touch #{generated_files.join(" ")}"
|
||||
prepare_command = "mkdir -p #{generated_dirs.join(" ")} && touch -a #{generated_files.join(" ")}"
|
||||
system(prepare_command) # Always run prepare_command when a podspec uses the codegen, as CocoaPods may skip invoking this command in certain scenarios
|
||||
spec.prepare_command = prepare_command
|
||||
|
||||
spec.script_phase = {
|
||||
:name => 'Generate Specs',
|
||||
|
||||
Reference in New Issue
Block a user