2021-12-31 02:08:43 +03:00
# Copyright (c) Meta Platforms, Inc. and affiliates.
2019-10-16 20:03:47 +03:00
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
2021-10-26 06:47:13 +03:00
require 'pathname'
2021-12-16 03:10:03 +03:00
require_relative './react_native_pods_utils/script_phases.rb'
2021-10-26 06:47:13 +03:00
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
2021-11-12 08:54:44 +03:00
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'
$CODEGEN_MODULE_DIR = '.'
2021-12-14 21:13:31 +03:00
$REACT_CODEGEN_PODSPEC_GENERATED = false
$REACT_CODEGEN_DISCOVERY_DONE = false
2021-12-17 10:40:22 +03:00
DEFAULT_OTHER_CPLUSPLUSFLAGS = '$(inherited)'
NEW_ARCH_OTHER_CPLUSPLUSFLAGS = '$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
2021-10-19 01:32:45 +03:00
2019-04-23 15:44:07 +03:00
def use_react_native! ( options = { } )
2020-12-30 03:08:29 +03:00
# The prefix to react-native
2019-04-23 15:44:07 +03:00
prefix = options [ :path ] || = " ../node_modules/react-native "
2019-07-02 01:12:56 +03:00
2019-05-16 07:55:26 +03:00
# Include Fabric dependencies
fabric_enabled = options [ :fabric_enabled ] || = false
2019-07-02 01:12:56 +03:00
2019-04-23 15:44:07 +03:00
# Include DevSupport dependency
production = options [ :production ] || = false
2020-08-27 11:16:30 +03:00
# Include Hermes dependencies
hermes_enabled = options [ :hermes_enabled ] || = false
2021-12-17 10:40:22 +03:00
# Codegen Discovery is required when enabling new architecture.
if ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1'
Pod :: UI . puts 'Setting USE_CODEGEN_DISCOVERY=1'
ENV [ 'USE_CODEGEN_DISCOVERY' ] = '1'
end
2021-11-04 20:44:33 +03:00
if ` /usr/sbin/sysctl -n hw.optional.arm64 2>&1 ` . to_i == 1 && ! RUBY_PLATFORM . include? ( 'arm64' )
2021-09-30 04:13:50 +03:00
Pod :: UI . warn 'Do not use "pod install" from inside Rosetta2 (x86_64 emulation on arm64).'
Pod :: UI . warn ' - Emulated x86_64 is slower than native arm64'
Pod :: UI . warn ' - May result in mixed architectures in rubygems (eg: ffi_c.bundle files may be x86_64 with an arm64 interpreter)'
Pod :: UI . warn 'Run "env /usr/bin/arch -arm64 /bin/bash --login" then try again.'
end
2019-04-23 15:44:07 +03:00
# The Pods which should be included in all projects
2019-07-02 01:12:56 +03:00
pod 'FBLazyVector' , :path = > " #{ prefix } /Libraries/FBLazyVector "
2021-02-02 01:36:52 +03:00
pod 'FBReactNativeSpec' , :path = > " #{ prefix } /React/FBReactNativeSpec "
2019-07-02 01:12:56 +03:00
pod 'RCTRequired' , :path = > " #{ prefix } /Libraries/RCTRequired "
2019-07-13 00:24:55 +03:00
pod 'RCTTypeSafety' , :path = > " #{ prefix } /Libraries/TypeSafety "
2019-04-23 15:44:07 +03:00
pod 'React' , :path = > " #{ prefix } / "
CocoaPods frameworks compatibility: Step 2 (#25619)
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.
It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.
The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .
There are still a few breaking changes which I hope will be acceptable:
- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.
Still to do:
- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by https://github.com/facebook/react-native/pull/25619/commits/33573511f02f3502a28bad48e085e9a4b8608302.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �
## Changelog
[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619
Test Plan:
### FB
```
buck build catalyst
```
### Sample Project
Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.
You can see that it works with these steps:
1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`
The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.
### RNTesterPods
`RNTesterPodsPods` can now work with or without `use_frameworks!`.
1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.
Reviewed By: PeteTheHeat
Differential Revision: D16465247
Pulled By: PeteTheHeat
fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
2019-07-25 08:26:42 +03:00
pod 'React-Core' , :path = > " #{ prefix } / "
2019-07-02 01:12:56 +03:00
pod 'React-CoreModules' , :path = > " #{ prefix } /React/CoreModules "
2019-04-23 15:44:07 +03:00
pod 'React-RCTActionSheet' , :path = > " #{ prefix } /Libraries/ActionSheetIOS "
pod 'React-RCTAnimation' , :path = > " #{ prefix } /Libraries/NativeAnimation "
pod 'React-RCTBlob' , :path = > " #{ prefix } /Libraries/Blob "
pod 'React-RCTImage' , :path = > " #{ prefix } /Libraries/Image "
pod 'React-RCTLinking' , :path = > " #{ prefix } /Libraries/LinkingIOS "
pod 'React-RCTNetwork' , :path = > " #{ prefix } /Libraries/Network "
pod 'React-RCTSettings' , :path = > " #{ prefix } /Libraries/Settings "
pod 'React-RCTText' , :path = > " #{ prefix } /Libraries/Text "
pod 'React-RCTVibration' , :path = > " #{ prefix } /Libraries/Vibration "
2019-07-25 21:42:49 +03:00
pod 'React-Core/RCTWebSocket' , :path = > " #{ prefix } / "
2019-05-03 23:25:56 +03:00
2019-04-23 15:44:07 +03:00
unless production
2019-07-25 21:42:49 +03:00
pod 'React-Core/DevSupport' , :path = > " #{ prefix } / "
2019-04-23 15:44:07 +03:00
end
2022-03-11 23:47:51 +03:00
pod 'React-bridging' , :path = > " #{ prefix } /ReactCommon/react/bridging "
2019-04-23 15:44:07 +03:00
pod 'React-cxxreact' , :path = > " #{ prefix } /ReactCommon/cxxreact "
pod 'React-jsi' , :path = > " #{ prefix } /ReactCommon/jsi "
pod 'React-jsiexecutor' , :path = > " #{ prefix } /ReactCommon/jsiexecutor "
pod 'React-jsinspector' , :path = > " #{ prefix } /ReactCommon/jsinspector "
Get CallInvokers from the bridge
Summary:
## Context
For now, assume TurboModules doesn't exist.
**What happens when we call an async NativeModule method?**
Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events:
- **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`.
- **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`.
- **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls.
**So, what's the difference between flushed and emptied?**
> Note: These are two terms I just made up, but the distinction is important.
If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied".
**Why does any of this matter?**
1. TurboModules exist.
2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on:
- **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++.
- **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed.
In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`.
**So, what does this diff do?**
1. Make `Instance` responsible for creating the JS `CallInvoker`.
2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`.
3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending.
Changelog:
[Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules
Reviewed By: mdvacca
Differential Revision: D20717931
fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875
2020-04-01 21:36:50 +03:00
pod 'React-callinvoker' , :path = > " #{ prefix } /ReactCommon/callinvoker "
2020-05-09 02:10:38 +03:00
pod 'React-runtimeexecutor' , :path = > " #{ prefix } /ReactCommon/runtimeexecutor "
Rename <ReactCommon/NativeModulePerfLogger.h> to <reactperflogger/NativeModulePerfLogger.h>
Summary:
## Motivation
This rename will fix the following CircleCI build failures:
- [test_ios_unit_frameworks](https://circleci.com/gh/facebook/react-native/150473?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)
- [test_ios_detox_frameworks](https://circleci.com/gh/facebook/react-native/150474?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)
## Investigation
We have 4 podspec targets that map to the same header namespace (i.e: `header_dir`) `ReactCommon`:
- **New:** `React-perflogger`: Directory is `ReactCommon/preflogger`, and contains `NativeModulePerfLogger.{h,cpp}`.
- `React-runtimeexecutor`: Directory is `ReactCommon/runtimeexecutor`, and contains only `RuntimeExecutor.h`
- `React-callinvoker`: Directory is `ReactCommon/callinvoker`, and contains only `CallInvoker.h`
- `ReactCommon/turbomodule/core`: Directory is `ReactCommon/turbomodule`, and contains C++ files, as well has header files.
**The problem:**
We couldn't import headers from `React-perflogger` in `ReactCommon/turbomodule/core` files.
**The cause:**
I'm not entirely sure why, but I was able to discern the following two rules by playing around with the podspecs:
1. If your podspec target has a cpp file, it'll generate a framework when `USE_FRAMEWORKS=1`.
2. Two different frameworks cannot map to the same `module_name` or `header_dir`. (Why? No clue. But something breaks silently when this is the case).
So, this is what happened when I landed `React-perflogger` (D21443610):
1. The TurboModules code generates the `ReactCommon` framework that uses the `ReactCommon` header namespace.
2. `React-runtimeexecutor` and `React-callinvoker` also used the `ReactCommon` header namespace. However, neither generate a framework because of Rule 1.
3. When I comitted `React-perflogger`, I introduced a second framework that competed with the `ReactCommon` framework (i.e: TurboModules code) for the `ReactCommon` header namespace. Rule 2 violation.
## Thoughts on renaming
- `<perflogger/NativeModulePerfLogger.h>` is too generic, and the `perflogger` namepsace is used internally within FB.
- `<react/perflogger/NativeModulePerfLogger.h>` matches our fabric header format, but I'm pretty sure that slashes aren't allowed in `header_dir`: I tested this and it didn't work. IIRC, only alphanumeric and underscore are valid characters for `header_dir` or `module_name`. So, I opted to just use `reactperflogger`.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D21598852
fbshipit-source-id: 60da5d0f7758eaf13907a080b7d8756688f40723
2020-05-16 01:21:25 +03:00
pod 'React-perflogger' , :path = > " #{ prefix } /ReactCommon/reactperflogger "
2021-08-19 06:13:17 +03:00
pod 'React-logger' , :path = > " #{ prefix } /ReactCommon/logger "
2019-07-13 08:34:14 +03:00
pod 'ReactCommon/turbomodule/core' , :path = > " #{ prefix } /ReactCommon "
2020-02-07 13:49:03 +03:00
pod 'Yoga' , :path = > " #{ prefix } /ReactCommon/yoga " , :modular_headers = > true
2019-04-23 15:44:07 +03:00
pod 'DoubleConversion' , :podspec = > " #{ prefix } /third-party-podspecs/DoubleConversion.podspec "
pod 'glog' , :podspec = > " #{ prefix } /third-party-podspecs/glog.podspec "
2021-07-17 01:11:34 +03:00
pod 'boost' , :podspec = > " #{ prefix } /third-party-podspecs/boost.podspec "
2020-08-27 11:16:30 +03:00
pod 'RCT-Folly' , :podspec = > " #{ prefix } /third-party-podspecs/RCT-Folly.podspec "
2019-05-16 07:55:26 +03:00
2021-12-14 05:22:35 +03:00
if ENV [ 'USE_CODEGEN_DISCOVERY' ] == '1'
app_path = options [ :app_path ]
config_file_dir = options [ :config_file_dir ]
use_react_native_codegen_discovery! ( {
react_native_path : prefix ,
app_path : app_path ,
fabric_enabled : fabric_enabled ,
config_file_dir : config_file_dir ,
} )
2021-12-14 21:13:31 +03:00
else
# Generate a podspec file for generated files.
# This gets generated in use_react_native_codegen_discovery when codegen discovery is enabled.
react_codegen_spec = get_react_codegen_spec ( fabric_enabled : fabric_enabled )
generate_react_codegen_podspec! ( react_codegen_spec )
2021-12-14 05:22:35 +03:00
end
2021-12-14 21:13:31 +03:00
pod 'React-Codegen' , :path = > $CODEGEN_OUTPUT_DIR
2021-10-26 06:47:13 +03:00
2019-05-16 07:55:26 +03:00
if fabric_enabled
2021-11-17 23:16:48 +03:00
checkAndGenerateEmptyThirdPartyProvider! ( prefix )
2019-05-16 07:55:26 +03:00
pod 'React-Fabric' , :path = > " #{ prefix } /ReactCommon "
2021-10-27 19:43:49 +03:00
pod 'React-rncore' , :path = > " #{ prefix } /ReactCommon "
2020-12-22 19:33:56 +03:00
pod 'React-graphics' , :path = > " #{ prefix } /ReactCommon/react/renderer/graphics "
2019-05-16 07:55:26 +03:00
pod 'React-jsi/Fabric' , :path = > " #{ prefix } /ReactCommon/jsi "
pod 'React-RCTFabric' , :path = > " #{ prefix } /React "
2020-08-27 11:16:30 +03:00
pod 'RCT-Folly/Fabric' , :podspec = > " #{ prefix } /third-party-podspecs/RCT-Folly.podspec "
end
if hermes_enabled
2020-12-04 07:05:00 +03:00
pod 'React-hermes' , :path = > " #{ prefix } /ReactCommon/hermes "
2022-02-25 00:27:11 +03:00
if ENV [ 'BUILD_HERMES_SOURCE' ] == '1'
2022-03-10 22:24:48 +03:00
hermes_source_path = downloadAndConfigureHermesSource ( prefix )
2022-02-25 00:27:11 +03:00
pod 'hermes-engine' , :path = > " #{ hermes_source_path } /hermes-engine.podspec "
else
pod 'hermes-engine' , '~> 0.11.0'
end
2021-02-24 23:20:54 +03:00
pod 'libevent' , '~> 2.1.12'
2019-05-16 07:55:26 +03:00
end
2020-02-13 05:25:42 +03:00
end
2019-07-02 01:12:56 +03:00
2021-12-17 10:40:22 +03:00
def get_default_flags ( )
flags = {
:fabric_enabled = > false ,
:hermes_enabled = > false ,
}
if ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1'
flags [ :fabric_enabled ] = true
flags [ :hermes_enabled ] = true
end
return flags
end
Make flipper pods configurations configurable (#29074)
Summary:
This PR allows the use_flipper! helper function to be used in projects that
have more than just Debug/Release configurations. For example, a project
may have DevDebug, DevRelease, ProdDebug, and ProdRelease configurations.
These projects can now do:
```ruby
use_flipper!(configurations: ['DevDebug', 'ProdDebug'])
```
## Changelog
[iOS][Added] Ability to set which configuration to enable flipper for when using use_flipper!
Pull Request resolved: https://github.com/facebook/react-native/pull/29074
Test Plan:
I don't know how to run code in this repository, so I copy and pasted this function into the Podfile of an existing project. My complete Podfile is as below:
```ruby
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/react-native-community/cli-platform-ios/native_modules'
project 'marketplace',
'Dev.Debug' => :debug,
'Dev.Release' => :release,
'Prod.Debug' => :debug,
'Prod.Release' => :release
def use_flipper!(versions = {}, configurations: ['Debug'])
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configurations => configurations
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configurations => configurations
pod 'Flipper-DoubleConversion', versions['Flipper-DoubleConversion'], :configurations => configurations
pod 'Flipper-Folly', versions['Flipper-Folly'], :configurations => configurations
pod 'Flipper-Glog', versions['Flipper-Glog'], :configurations => configurations
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configurations => configurations
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configurations => configurations
pod 'FlipperKit/Core', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/CppBridge', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBDefines', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configurations => configurations
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target 'marketplace' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#use_frameworks!
pod 'FBLazyVector', :path => '../node_modules/react-native/Libraries/FBLazyVector'
pod 'FBReactNativeSpec', :path => '../node_modules/react-native/Libraries/FBReactNativeSpec'
pod 'RCTRequired', :path => '../node_modules/react-native/Libraries/RCTRequired'
pod 'RCTTypeSafety', :path => '../node_modules/react-native/Libraries/TypeSafety'
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => '../node_modules/react-native/ReactCommon'
pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native/ReactCommon'
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'Intercom', '~> 6.0.0'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'react-native-netinfo', :podspec => '../node_modules/react-native-community/netinfo/react-native-netinfo.podspec'
pod 'BugsnagReactNative', :podspec => '../node_modules/bugsnag-react-native/BugsnagReactNative.podspec'
pod 'rn-fetch-blob', :podspec => '../node_modules/rn-fetch-blob/rn-fetch-blob.podspec'
use_native_modules!
pod 'react-native-intercom', :path => '../node_modules/react-native-intercom'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNCPushNotificationIOS', :path => '../node_modules/react-native-community/push-notification-ios'
pod 'RNDateTimePicker', :path => '../node_modules/react-native-community/datetimepicker'
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!(configurations: ['Dev.Debug', 'Prod.Debug'])
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
end
```
I then ran `pod install`:
```
nico:ios/ (dev*) $ pod install [20:14:43]
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Detected React Native module pods for BVLinearGradient, RNCAsyncStorage, RNCPicker, RNCPushNotificationIOS, RNDateTimePicker, RNFBApp, RNFBAuth, RNFBDatabase, RNFBDynamicLinks, RNFBFirestore, RNFBStorage, RNSVG, RNVectorIcons, ReactNativeNavigation, react-native-camera, react-native-cameraroll, react-native-config, react-native-flipper, react-native-get-random-values, react-native-image-resizer, and react-native-intercom
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 73 dependencies from the Podfile and 88 total pods installed.
[!] use_native_modules! skipped the react-native dependency 'react-native-photo-view'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
[!] use_native_modules! skipped the react-native dependency 'detox'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
```
Reviewed By: cpojer
Differential Revision: D22795421
Pulled By: passy
fbshipit-source-id: 89ba555eadc4918e9ac464a19a318198b237e01e
2020-07-29 12:43:17 +03:00
def use_flipper! ( versions = { } , configurations : [ 'Debug' ] )
2022-01-21 17:52:37 +03:00
versions [ 'Flipper' ] || = '0.125.0'
Bump flipper deps to 0.91 to support XCode 12.5 out of the box (#31562)
Summary:
allow-large-files
This bumps the flipper dependencies to 0.91.
Fresco deps are not in mavenCentral jet, so picked those from bintray, but pinged the team and they'll follow up on it. See also: https://github.com/facebook/fresco/issues/2603
This primarily bumps to the latest pods we have everywhere, which solves several build issues, like reported in https://github.com/facebook/react-native/issues/31480
After this change it should no longer be needed to pass custom version overrides to `use_flipper`, as the defaults will be up to date.
In the template project, I changed the version rangers to exact numbers, so that results of `react-native init` are more consistent / predictable over time, as suggested in the discord channel by Brent
In the long term we are investigating whether we can remove most of the transitive deps by not using RSocket, which is a bigger project plan that should help reduce build issues and times, especially on iOS.
cc priteshrnandgaonkar passy kelset
## Changelog
[general][changed] - [iOS] Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5
Pull Request resolved: https://github.com/facebook/react-native/pull/31562
Test Plan:
_N.B. Locally tested in XCode 12.4 only, but bumped versions have been confirmed to work on 12.5 before by others_
* React Native CI
* Flipper CI with same versions of deps: https://github.com/facebook/flipper/actions/runs/863607686
* Was able to connect from both Android and iOS to Flipper. Couldn't really test further due to a bundling error I didn't understand, suggestions welcome
![Screenshot 2021-05-21 at 11 32 52](https://user-images.githubusercontent.com/1820292/119133806-3d090880-ba34-11eb-8c0b-1ede7bc13751.png)
![Screenshot 2021-05-21 at 12 59 13](https://user-images.githubusercontent.com/1820292/119133892-5c079a80-ba34-11eb-9e72-278c427fdeb0.png)
Reviewed By: fkgozali
Differential Revision: D28623601
Pulled By: mweststrate
fbshipit-source-id: 22130d07821569851956453c4ee6a594b6b83928
2021-06-07 13:18:49 +03:00
versions [ 'Flipper-Boost-iOSX' ] || = '1.76.0.1.11'
fix(ios, flipper): update flipper sub-pods to support macCatalyst (#33406)
Summary:
Flipper-DoubleConversion and Flipper-Glog iOS pods received a build optimization
a few versions back that pre-compiled the pods and references the xcframework slices
Unfortunately, the pre-compile did not include macCatalyst slices, so this disabled support
for flipper on macOS for react-native >0.65
lblasa has re-compiled the pods with the macCatalyst slices added
See https://github.com/facebook/flipper/issues/3117
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[iOS] [Fixed] - update Flipper pods to support re-enable macCatalyst
Pull Request resolved: https://github.com/facebook/react-native/pull/33406
Test Plan:
- [ ] The Flipper repo has a react-native test that appeared to work with these versions, CI should work here
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on arm64
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on x86_64 mac
- [ ] Prove there is no regression, a flipper-enabled build test should work for real device iOS target
- [ ] To prove the issue is resolved, a build should be attempted for a macCatalyst target, and it should work.
Reviewed By: cortinico
Differential Revision: D34789654
Pulled By: lblasa
fbshipit-source-id: 466803dd07b5820220512b7d7d760b94b8aa65f7
2022-03-11 13:47:27 +03:00
versions [ 'Flipper-DoubleConversion' ] || = '3.2.0'
Bump flipper deps to 0.91 to support XCode 12.5 out of the box (#31562)
Summary:
allow-large-files
This bumps the flipper dependencies to 0.91.
Fresco deps are not in mavenCentral jet, so picked those from bintray, but pinged the team and they'll follow up on it. See also: https://github.com/facebook/fresco/issues/2603
This primarily bumps to the latest pods we have everywhere, which solves several build issues, like reported in https://github.com/facebook/react-native/issues/31480
After this change it should no longer be needed to pass custom version overrides to `use_flipper`, as the defaults will be up to date.
In the template project, I changed the version rangers to exact numbers, so that results of `react-native init` are more consistent / predictable over time, as suggested in the discord channel by Brent
In the long term we are investigating whether we can remove most of the transitive deps by not using RSocket, which is a bigger project plan that should help reduce build issues and times, especially on iOS.
cc priteshrnandgaonkar passy kelset
## Changelog
[general][changed] - [iOS] Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5
Pull Request resolved: https://github.com/facebook/react-native/pull/31562
Test Plan:
_N.B. Locally tested in XCode 12.4 only, but bumped versions have been confirmed to work on 12.5 before by others_
* React Native CI
* Flipper CI with same versions of deps: https://github.com/facebook/flipper/actions/runs/863607686
* Was able to connect from both Android and iOS to Flipper. Couldn't really test further due to a bundling error I didn't understand, suggestions welcome
![Screenshot 2021-05-21 at 11 32 52](https://user-images.githubusercontent.com/1820292/119133806-3d090880-ba34-11eb-8c0b-1ede7bc13751.png)
![Screenshot 2021-05-21 at 12 59 13](https://user-images.githubusercontent.com/1820292/119133892-5c079a80-ba34-11eb-9e72-278c427fdeb0.png)
Reviewed By: fkgozali
Differential Revision: D28623601
Pulled By: mweststrate
fbshipit-source-id: 22130d07821569851956453c4ee6a594b6b83928
2021-06-07 13:18:49 +03:00
versions [ 'Flipper-Fmt' ] || = '7.1.7'
2022-01-21 17:52:37 +03:00
versions [ 'Flipper-Folly' ] || = '2.6.10'
fix(ios, flipper): update flipper sub-pods to support macCatalyst (#33406)
Summary:
Flipper-DoubleConversion and Flipper-Glog iOS pods received a build optimization
a few versions back that pre-compiled the pods and references the xcframework slices
Unfortunately, the pre-compile did not include macCatalyst slices, so this disabled support
for flipper on macOS for react-native >0.65
lblasa has re-compiled the pods with the macCatalyst slices added
See https://github.com/facebook/flipper/issues/3117
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[iOS] [Fixed] - update Flipper pods to support re-enable macCatalyst
Pull Request resolved: https://github.com/facebook/react-native/pull/33406
Test Plan:
- [ ] The Flipper repo has a react-native test that appeared to work with these versions, CI should work here
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on arm64
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on x86_64 mac
- [ ] Prove there is no regression, a flipper-enabled build test should work for real device iOS target
- [ ] To prove the issue is resolved, a build should be attempted for a macCatalyst target, and it should work.
Reviewed By: cortinico
Differential Revision: D34789654
Pulled By: lblasa
fbshipit-source-id: 466803dd07b5820220512b7d7d760b94b8aa65f7
2022-03-11 13:47:27 +03:00
versions [ 'Flipper-Glog' ] || = '0.5.0.3'
Bump flipper deps to 0.91 to support XCode 12.5 out of the box (#31562)
Summary:
allow-large-files
This bumps the flipper dependencies to 0.91.
Fresco deps are not in mavenCentral jet, so picked those from bintray, but pinged the team and they'll follow up on it. See also: https://github.com/facebook/fresco/issues/2603
This primarily bumps to the latest pods we have everywhere, which solves several build issues, like reported in https://github.com/facebook/react-native/issues/31480
After this change it should no longer be needed to pass custom version overrides to `use_flipper`, as the defaults will be up to date.
In the template project, I changed the version rangers to exact numbers, so that results of `react-native init` are more consistent / predictable over time, as suggested in the discord channel by Brent
In the long term we are investigating whether we can remove most of the transitive deps by not using RSocket, which is a bigger project plan that should help reduce build issues and times, especially on iOS.
cc priteshrnandgaonkar passy kelset
## Changelog
[general][changed] - [iOS] Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5
Pull Request resolved: https://github.com/facebook/react-native/pull/31562
Test Plan:
_N.B. Locally tested in XCode 12.4 only, but bumped versions have been confirmed to work on 12.5 before by others_
* React Native CI
* Flipper CI with same versions of deps: https://github.com/facebook/flipper/actions/runs/863607686
* Was able to connect from both Android and iOS to Flipper. Couldn't really test further due to a bundling error I didn't understand, suggestions welcome
![Screenshot 2021-05-21 at 11 32 52](https://user-images.githubusercontent.com/1820292/119133806-3d090880-ba34-11eb-8c0b-1ede7bc13751.png)
![Screenshot 2021-05-21 at 12 59 13](https://user-images.githubusercontent.com/1820292/119133892-5c079a80-ba34-11eb-9e72-278c427fdeb0.png)
Reviewed By: fkgozali
Differential Revision: D28623601
Pulled By: mweststrate
fbshipit-source-id: 22130d07821569851956453c4ee6a594b6b83928
2021-06-07 13:18:49 +03:00
versions [ 'Flipper-PeerTalk' ] || = '0.0.4'
versions [ 'Flipper-RSocket' ] || = '1.4.3'
2022-01-21 17:52:37 +03:00
versions [ 'OpenSSL-Universal' ] || = '1.1.1100'
Make flipper pods configurations configurable (#29074)
Summary:
This PR allows the use_flipper! helper function to be used in projects that
have more than just Debug/Release configurations. For example, a project
may have DevDebug, DevRelease, ProdDebug, and ProdRelease configurations.
These projects can now do:
```ruby
use_flipper!(configurations: ['DevDebug', 'ProdDebug'])
```
## Changelog
[iOS][Added] Ability to set which configuration to enable flipper for when using use_flipper!
Pull Request resolved: https://github.com/facebook/react-native/pull/29074
Test Plan:
I don't know how to run code in this repository, so I copy and pasted this function into the Podfile of an existing project. My complete Podfile is as below:
```ruby
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/react-native-community/cli-platform-ios/native_modules'
project 'marketplace',
'Dev.Debug' => :debug,
'Dev.Release' => :release,
'Prod.Debug' => :debug,
'Prod.Release' => :release
def use_flipper!(versions = {}, configurations: ['Debug'])
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configurations => configurations
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configurations => configurations
pod 'Flipper-DoubleConversion', versions['Flipper-DoubleConversion'], :configurations => configurations
pod 'Flipper-Folly', versions['Flipper-Folly'], :configurations => configurations
pod 'Flipper-Glog', versions['Flipper-Glog'], :configurations => configurations
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configurations => configurations
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configurations => configurations
pod 'FlipperKit/Core', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/CppBridge', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBDefines', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configurations => configurations
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target 'marketplace' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#use_frameworks!
pod 'FBLazyVector', :path => '../node_modules/react-native/Libraries/FBLazyVector'
pod 'FBReactNativeSpec', :path => '../node_modules/react-native/Libraries/FBReactNativeSpec'
pod 'RCTRequired', :path => '../node_modules/react-native/Libraries/RCTRequired'
pod 'RCTTypeSafety', :path => '../node_modules/react-native/Libraries/TypeSafety'
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => '../node_modules/react-native/ReactCommon'
pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native/ReactCommon'
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'Intercom', '~> 6.0.0'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'react-native-netinfo', :podspec => '../node_modules/react-native-community/netinfo/react-native-netinfo.podspec'
pod 'BugsnagReactNative', :podspec => '../node_modules/bugsnag-react-native/BugsnagReactNative.podspec'
pod 'rn-fetch-blob', :podspec => '../node_modules/rn-fetch-blob/rn-fetch-blob.podspec'
use_native_modules!
pod 'react-native-intercom', :path => '../node_modules/react-native-intercom'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNCPushNotificationIOS', :path => '../node_modules/react-native-community/push-notification-ios'
pod 'RNDateTimePicker', :path => '../node_modules/react-native-community/datetimepicker'
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!(configurations: ['Dev.Debug', 'Prod.Debug'])
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
end
```
I then ran `pod install`:
```
nico:ios/ (dev*) $ pod install [20:14:43]
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Detected React Native module pods for BVLinearGradient, RNCAsyncStorage, RNCPicker, RNCPushNotificationIOS, RNDateTimePicker, RNFBApp, RNFBAuth, RNFBDatabase, RNFBDynamicLinks, RNFBFirestore, RNFBStorage, RNSVG, RNVectorIcons, ReactNativeNavigation, react-native-camera, react-native-cameraroll, react-native-config, react-native-flipper, react-native-get-random-values, react-native-image-resizer, and react-native-intercom
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 73 dependencies from the Podfile and 88 total pods installed.
[!] use_native_modules! skipped the react-native dependency 'react-native-photo-view'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
[!] use_native_modules! skipped the react-native dependency 'detox'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
```
Reviewed By: cpojer
Differential Revision: D22795421
Pulled By: passy
fbshipit-source-id: 89ba555eadc4918e9ac464a19a318198b237e01e
2020-07-29 12:43:17 +03:00
pod 'FlipperKit' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FlipperKitLayoutPlugin' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/SKIOSNetworkPlugin' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FlipperKitUserDefaultsPlugin' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FlipperKitReactPlugin' , versions [ 'Flipper' ] , :configurations = > configurations
2020-04-07 20:08:55 +03:00
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
Make flipper pods configurations configurable (#29074)
Summary:
This PR allows the use_flipper! helper function to be used in projects that
have more than just Debug/Release configurations. For example, a project
may have DevDebug, DevRelease, ProdDebug, and ProdRelease configurations.
These projects can now do:
```ruby
use_flipper!(configurations: ['DevDebug', 'ProdDebug'])
```
## Changelog
[iOS][Added] Ability to set which configuration to enable flipper for when using use_flipper!
Pull Request resolved: https://github.com/facebook/react-native/pull/29074
Test Plan:
I don't know how to run code in this repository, so I copy and pasted this function into the Podfile of an existing project. My complete Podfile is as below:
```ruby
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/react-native-community/cli-platform-ios/native_modules'
project 'marketplace',
'Dev.Debug' => :debug,
'Dev.Release' => :release,
'Prod.Debug' => :debug,
'Prod.Release' => :release
def use_flipper!(versions = {}, configurations: ['Debug'])
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configurations => configurations
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configurations => configurations
pod 'Flipper-DoubleConversion', versions['Flipper-DoubleConversion'], :configurations => configurations
pod 'Flipper-Folly', versions['Flipper-Folly'], :configurations => configurations
pod 'Flipper-Glog', versions['Flipper-Glog'], :configurations => configurations
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configurations => configurations
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configurations => configurations
pod 'FlipperKit/Core', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/CppBridge', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBDefines', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configurations => configurations
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target 'marketplace' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#use_frameworks!
pod 'FBLazyVector', :path => '../node_modules/react-native/Libraries/FBLazyVector'
pod 'FBReactNativeSpec', :path => '../node_modules/react-native/Libraries/FBReactNativeSpec'
pod 'RCTRequired', :path => '../node_modules/react-native/Libraries/RCTRequired'
pod 'RCTTypeSafety', :path => '../node_modules/react-native/Libraries/TypeSafety'
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => '../node_modules/react-native/ReactCommon'
pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native/ReactCommon'
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'Intercom', '~> 6.0.0'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'react-native-netinfo', :podspec => '../node_modules/react-native-community/netinfo/react-native-netinfo.podspec'
pod 'BugsnagReactNative', :podspec => '../node_modules/bugsnag-react-native/BugsnagReactNative.podspec'
pod 'rn-fetch-blob', :podspec => '../node_modules/rn-fetch-blob/rn-fetch-blob.podspec'
use_native_modules!
pod 'react-native-intercom', :path => '../node_modules/react-native-intercom'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNCPushNotificationIOS', :path => '../node_modules/react-native-community/push-notification-ios'
pod 'RNDateTimePicker', :path => '../node_modules/react-native-community/datetimepicker'
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!(configurations: ['Dev.Debug', 'Prod.Debug'])
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
end
```
I then ran `pod install`:
```
nico:ios/ (dev*) $ pod install [20:14:43]
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Detected React Native module pods for BVLinearGradient, RNCAsyncStorage, RNCPicker, RNCPushNotificationIOS, RNDateTimePicker, RNFBApp, RNFBAuth, RNFBDatabase, RNFBDynamicLinks, RNFBFirestore, RNFBStorage, RNSVG, RNVectorIcons, ReactNativeNavigation, react-native-camera, react-native-cameraroll, react-native-config, react-native-flipper, react-native-get-random-values, react-native-image-resizer, and react-native-intercom
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 73 dependencies from the Podfile and 88 total pods installed.
[!] use_native_modules! skipped the react-native dependency 'react-native-photo-view'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
[!] use_native_modules! skipped the react-native dependency 'detox'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
```
Reviewed By: cpojer
Differential Revision: D22795421
Pulled By: passy
fbshipit-source-id: 89ba555eadc4918e9ac464a19a318198b237e01e
2020-07-29 12:43:17 +03:00
pod 'Flipper' , versions [ 'Flipper' ] , :configurations = > configurations
Bump flipper deps to 0.91 to support XCode 12.5 out of the box (#31562)
Summary:
allow-large-files
This bumps the flipper dependencies to 0.91.
Fresco deps are not in mavenCentral jet, so picked those from bintray, but pinged the team and they'll follow up on it. See also: https://github.com/facebook/fresco/issues/2603
This primarily bumps to the latest pods we have everywhere, which solves several build issues, like reported in https://github.com/facebook/react-native/issues/31480
After this change it should no longer be needed to pass custom version overrides to `use_flipper`, as the defaults will be up to date.
In the template project, I changed the version rangers to exact numbers, so that results of `react-native init` are more consistent / predictable over time, as suggested in the discord channel by Brent
In the long term we are investigating whether we can remove most of the transitive deps by not using RSocket, which is a bigger project plan that should help reduce build issues and times, especially on iOS.
cc priteshrnandgaonkar passy kelset
## Changelog
[general][changed] - [iOS] Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5
Pull Request resolved: https://github.com/facebook/react-native/pull/31562
Test Plan:
_N.B. Locally tested in XCode 12.4 only, but bumped versions have been confirmed to work on 12.5 before by others_
* React Native CI
* Flipper CI with same versions of deps: https://github.com/facebook/flipper/actions/runs/863607686
* Was able to connect from both Android and iOS to Flipper. Couldn't really test further due to a bundling error I didn't understand, suggestions welcome
![Screenshot 2021-05-21 at 11 32 52](https://user-images.githubusercontent.com/1820292/119133806-3d090880-ba34-11eb-8c0b-1ede7bc13751.png)
![Screenshot 2021-05-21 at 12 59 13](https://user-images.githubusercontent.com/1820292/119133892-5c079a80-ba34-11eb-9e72-278c427fdeb0.png)
Reviewed By: fkgozali
Differential Revision: D28623601
Pulled By: mweststrate
fbshipit-source-id: 22130d07821569851956453c4ee6a594b6b83928
2021-06-07 13:18:49 +03:00
pod 'Flipper-Boost-iOSX' , versions [ 'Flipper-Boost-iOSX' ] , :configurations = > configurations
Make flipper pods configurations configurable (#29074)
Summary:
This PR allows the use_flipper! helper function to be used in projects that
have more than just Debug/Release configurations. For example, a project
may have DevDebug, DevRelease, ProdDebug, and ProdRelease configurations.
These projects can now do:
```ruby
use_flipper!(configurations: ['DevDebug', 'ProdDebug'])
```
## Changelog
[iOS][Added] Ability to set which configuration to enable flipper for when using use_flipper!
Pull Request resolved: https://github.com/facebook/react-native/pull/29074
Test Plan:
I don't know how to run code in this repository, so I copy and pasted this function into the Podfile of an existing project. My complete Podfile is as below:
```ruby
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/react-native-community/cli-platform-ios/native_modules'
project 'marketplace',
'Dev.Debug' => :debug,
'Dev.Release' => :release,
'Prod.Debug' => :debug,
'Prod.Release' => :release
def use_flipper!(versions = {}, configurations: ['Debug'])
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configurations => configurations
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configurations => configurations
pod 'Flipper-DoubleConversion', versions['Flipper-DoubleConversion'], :configurations => configurations
pod 'Flipper-Folly', versions['Flipper-Folly'], :configurations => configurations
pod 'Flipper-Glog', versions['Flipper-Glog'], :configurations => configurations
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configurations => configurations
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configurations => configurations
pod 'FlipperKit/Core', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/CppBridge', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBDefines', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configurations => configurations
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target 'marketplace' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#use_frameworks!
pod 'FBLazyVector', :path => '../node_modules/react-native/Libraries/FBLazyVector'
pod 'FBReactNativeSpec', :path => '../node_modules/react-native/Libraries/FBReactNativeSpec'
pod 'RCTRequired', :path => '../node_modules/react-native/Libraries/RCTRequired'
pod 'RCTTypeSafety', :path => '../node_modules/react-native/Libraries/TypeSafety'
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => '../node_modules/react-native/ReactCommon'
pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native/ReactCommon'
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'Intercom', '~> 6.0.0'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'react-native-netinfo', :podspec => '../node_modules/react-native-community/netinfo/react-native-netinfo.podspec'
pod 'BugsnagReactNative', :podspec => '../node_modules/bugsnag-react-native/BugsnagReactNative.podspec'
pod 'rn-fetch-blob', :podspec => '../node_modules/rn-fetch-blob/rn-fetch-blob.podspec'
use_native_modules!
pod 'react-native-intercom', :path => '../node_modules/react-native-intercom'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNCPushNotificationIOS', :path => '../node_modules/react-native-community/push-notification-ios'
pod 'RNDateTimePicker', :path => '../node_modules/react-native-community/datetimepicker'
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!(configurations: ['Dev.Debug', 'Prod.Debug'])
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
end
```
I then ran `pod install`:
```
nico:ios/ (dev*) $ pod install [20:14:43]
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Detected React Native module pods for BVLinearGradient, RNCAsyncStorage, RNCPicker, RNCPushNotificationIOS, RNDateTimePicker, RNFBApp, RNFBAuth, RNFBDatabase, RNFBDynamicLinks, RNFBFirestore, RNFBStorage, RNSVG, RNVectorIcons, ReactNativeNavigation, react-native-camera, react-native-cameraroll, react-native-config, react-native-flipper, react-native-get-random-values, react-native-image-resizer, and react-native-intercom
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 73 dependencies from the Podfile and 88 total pods installed.
[!] use_native_modules! skipped the react-native dependency 'react-native-photo-view'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
[!] use_native_modules! skipped the react-native dependency 'detox'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
```
Reviewed By: cpojer
Differential Revision: D22795421
Pulled By: passy
fbshipit-source-id: 89ba555eadc4918e9ac464a19a318198b237e01e
2020-07-29 12:43:17 +03:00
pod 'Flipper-DoubleConversion' , versions [ 'Flipper-DoubleConversion' ] , :configurations = > configurations
Bump flipper deps to 0.91 to support XCode 12.5 out of the box (#31562)
Summary:
allow-large-files
This bumps the flipper dependencies to 0.91.
Fresco deps are not in mavenCentral jet, so picked those from bintray, but pinged the team and they'll follow up on it. See also: https://github.com/facebook/fresco/issues/2603
This primarily bumps to the latest pods we have everywhere, which solves several build issues, like reported in https://github.com/facebook/react-native/issues/31480
After this change it should no longer be needed to pass custom version overrides to `use_flipper`, as the defaults will be up to date.
In the template project, I changed the version rangers to exact numbers, so that results of `react-native init` are more consistent / predictable over time, as suggested in the discord channel by Brent
In the long term we are investigating whether we can remove most of the transitive deps by not using RSocket, which is a bigger project plan that should help reduce build issues and times, especially on iOS.
cc priteshrnandgaonkar passy kelset
## Changelog
[general][changed] - [iOS] Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5
Pull Request resolved: https://github.com/facebook/react-native/pull/31562
Test Plan:
_N.B. Locally tested in XCode 12.4 only, but bumped versions have been confirmed to work on 12.5 before by others_
* React Native CI
* Flipper CI with same versions of deps: https://github.com/facebook/flipper/actions/runs/863607686
* Was able to connect from both Android and iOS to Flipper. Couldn't really test further due to a bundling error I didn't understand, suggestions welcome
![Screenshot 2021-05-21 at 11 32 52](https://user-images.githubusercontent.com/1820292/119133806-3d090880-ba34-11eb-8c0b-1ede7bc13751.png)
![Screenshot 2021-05-21 at 12 59 13](https://user-images.githubusercontent.com/1820292/119133892-5c079a80-ba34-11eb-9e72-278c427fdeb0.png)
Reviewed By: fkgozali
Differential Revision: D28623601
Pulled By: mweststrate
fbshipit-source-id: 22130d07821569851956453c4ee6a594b6b83928
2021-06-07 13:18:49 +03:00
pod 'Flipper-Fmt' , versions [ 'Flipper-Fmt' ] , :configurations = > configurations
Make flipper pods configurations configurable (#29074)
Summary:
This PR allows the use_flipper! helper function to be used in projects that
have more than just Debug/Release configurations. For example, a project
may have DevDebug, DevRelease, ProdDebug, and ProdRelease configurations.
These projects can now do:
```ruby
use_flipper!(configurations: ['DevDebug', 'ProdDebug'])
```
## Changelog
[iOS][Added] Ability to set which configuration to enable flipper for when using use_flipper!
Pull Request resolved: https://github.com/facebook/react-native/pull/29074
Test Plan:
I don't know how to run code in this repository, so I copy and pasted this function into the Podfile of an existing project. My complete Podfile is as below:
```ruby
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/react-native-community/cli-platform-ios/native_modules'
project 'marketplace',
'Dev.Debug' => :debug,
'Dev.Release' => :release,
'Prod.Debug' => :debug,
'Prod.Release' => :release
def use_flipper!(versions = {}, configurations: ['Debug'])
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configurations => configurations
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configurations => configurations
pod 'Flipper-DoubleConversion', versions['Flipper-DoubleConversion'], :configurations => configurations
pod 'Flipper-Folly', versions['Flipper-Folly'], :configurations => configurations
pod 'Flipper-Glog', versions['Flipper-Glog'], :configurations => configurations
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configurations => configurations
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configurations => configurations
pod 'FlipperKit/Core', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/CppBridge', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FBDefines', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configurations => configurations
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configurations => configurations
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target 'marketplace' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#use_frameworks!
pod 'FBLazyVector', :path => '../node_modules/react-native/Libraries/FBLazyVector'
pod 'FBReactNativeSpec', :path => '../node_modules/react-native/Libraries/FBReactNativeSpec'
pod 'RCTRequired', :path => '../node_modules/react-native/Libraries/RCTRequired'
pod 'RCTTypeSafety', :path => '../node_modules/react-native/Libraries/TypeSafety'
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => '../node_modules/react-native/ReactCommon'
pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native/ReactCommon'
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'Intercom', '~> 6.0.0'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'react-native-netinfo', :podspec => '../node_modules/react-native-community/netinfo/react-native-netinfo.podspec'
pod 'BugsnagReactNative', :podspec => '../node_modules/bugsnag-react-native/BugsnagReactNative.podspec'
pod 'rn-fetch-blob', :podspec => '../node_modules/rn-fetch-blob/rn-fetch-blob.podspec'
use_native_modules!
pod 'react-native-intercom', :path => '../node_modules/react-native-intercom'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNCPushNotificationIOS', :path => '../node_modules/react-native-community/push-notification-ios'
pod 'RNDateTimePicker', :path => '../node_modules/react-native-community/datetimepicker'
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!(configurations: ['Dev.Debug', 'Prod.Debug'])
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
end
```
I then ran `pod install`:
```
nico:ios/ (dev*) $ pod install [20:14:43]
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Detected React Native module pods for BVLinearGradient, RNCAsyncStorage, RNCPicker, RNCPushNotificationIOS, RNDateTimePicker, RNFBApp, RNFBAuth, RNFBDatabase, RNFBDynamicLinks, RNFBFirestore, RNFBStorage, RNSVG, RNVectorIcons, ReactNativeNavigation, react-native-camera, react-native-cameraroll, react-native-config, react-native-flipper, react-native-get-random-values, react-native-image-resizer, and react-native-intercom
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 73 dependencies from the Podfile and 88 total pods installed.
[!] use_native_modules! skipped the react-native dependency 'react-native-photo-view'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
[!] use_native_modules! skipped the react-native dependency 'detox'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good
example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
```
Reviewed By: cpojer
Differential Revision: D22795421
Pulled By: passy
fbshipit-source-id: 89ba555eadc4918e9ac464a19a318198b237e01e
2020-07-29 12:43:17 +03:00
pod 'Flipper-Folly' , versions [ 'Flipper-Folly' ] , :configurations = > configurations
pod 'Flipper-Glog' , versions [ 'Flipper-Glog' ] , :configurations = > configurations
pod 'Flipper-PeerTalk' , versions [ 'Flipper-PeerTalk' ] , :configurations = > configurations
pod 'Flipper-RSocket' , versions [ 'Flipper-RSocket' ] , :configurations = > configurations
pod 'FlipperKit/Core' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/CppBridge' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FBCxxFollyDynamicConvert' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FBDefines' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FKPortForwarding' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FlipperKitHighlightOverlay' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FlipperKitLayoutTextSearchable' , versions [ 'Flipper' ] , :configurations = > configurations
pod 'FlipperKit/FlipperKitNetworkPlugin' , versions [ 'Flipper' ] , :configurations = > configurations
2021-09-02 22:02:44 +03:00
pod 'OpenSSL-Universal' , versions [ 'OpenSSL-Universal' ] , :configurations = > configurations
2019-04-23 15:44:07 +03:00
end
2020-04-16 22:04:20 +03:00
2020-12-15 22:13:12 +03:00
def has_pod ( installer , name )
installer . pods_project . pod_group ( name ) != nil
end
2020-04-16 22:04:20 +03:00
# Post Install processing for Flipper
def flipper_post_install ( installer )
installer . pods_project . targets . each do | target |
if target . name == 'YogaKit'
target . build_configurations . each do | config |
config . build_settings [ 'SWIFT_VERSION' ] = '4.1'
end
end
end
end
2020-12-15 01:06:07 +03:00
2020-12-15 22:13:12 +03:00
def exclude_architectures ( installer )
2020-12-15 01:06:07 +03:00
projects = installer . aggregate_targets
. map { | t | t . user_project }
. uniq { | p | p . path }
. push ( installer . pods_project )
2020-12-15 22:13:12 +03:00
# Hermes does not support `i386` architecture
excluded_archs_default = has_pod ( installer , 'hermes-engine' ) ? " i386 " : " "
2020-12-15 01:06:07 +03:00
projects . each do | project |
project . build_configurations . each do | config |
Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284)
Summary:
Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should.
This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation.
Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done.
Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0`
## Changelog
[iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1
[iOS] [Changed] - Do not exclude the arm64 iphonesimulator
[iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround()
Pull Request resolved: https://github.com/facebook/react-native/pull/32284
Test Plan:
* Build `packages/rn-tester` on M1 and see it still works properly
* Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed
## References:
* Closes https://github.com/facebook/react-native/issues/31480
* The initial fix https://github.com/facebook/react-native/commit/ac4ddec542febda744de218dae3a3d34edc7da84
* Upgrading CocoaPods to 1.11 would bring us https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8 and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves
Reviewed By: lunaleaps
Differential Revision: D31248460
Pulled By: fkgozali
fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
2021-09-29 03:03:31 +03:00
config . build_settings [ " EXCLUDED_ARCHS[sdk=iphonesimulator*] " ] = excluded_archs_default
end
project . save ( )
end
end
def fix_library_search_paths ( installer )
def fix_config ( config )
lib_search_paths = config . build_settings [ " LIBRARY_SEARCH_PATHS " ]
if lib_search_paths
if lib_search_paths . include? ( " $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) " ) || lib_search_paths . include? ( " \" $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) \" " )
# $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1)
# since the libraries there are only built for x86_64 and i386.
lib_search_paths . delete ( " $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) " )
lib_search_paths . delete ( " \" $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) \" " )
if ! ( lib_search_paths . include? ( " $(SDKROOT)/usr/lib/swift " ) || lib_search_paths . include? ( " \" $(SDKROOT)/usr/lib/swift \" " ) )
# however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11
lib_search_paths . insert ( 0 , " $(SDKROOT)/usr/lib/swift " )
end
2020-12-15 01:06:07 +03:00
end
end
Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284)
Summary:
Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should.
This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation.
Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done.
Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0`
## Changelog
[iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1
[iOS] [Changed] - Do not exclude the arm64 iphonesimulator
[iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround()
Pull Request resolved: https://github.com/facebook/react-native/pull/32284
Test Plan:
* Build `packages/rn-tester` on M1 and see it still works properly
* Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed
## References:
* Closes https://github.com/facebook/react-native/issues/31480
* The initial fix https://github.com/facebook/react-native/commit/ac4ddec542febda744de218dae3a3d34edc7da84
* Upgrading CocoaPods to 1.11 would bring us https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8 and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves
Reviewed By: lunaleaps
Differential Revision: D31248460
Pulled By: fkgozali
fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
2021-09-29 03:03:31 +03:00
end
projects = installer . aggregate_targets
. map { | t | t . user_project }
. uniq { | p | p . path }
. push ( installer . pods_project )
2020-12-15 01:06:07 +03:00
Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284)
Summary:
Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should.
This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation.
Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done.
Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0`
## Changelog
[iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1
[iOS] [Changed] - Do not exclude the arm64 iphonesimulator
[iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround()
Pull Request resolved: https://github.com/facebook/react-native/pull/32284
Test Plan:
* Build `packages/rn-tester` on M1 and see it still works properly
* Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed
## References:
* Closes https://github.com/facebook/react-native/issues/31480
* The initial fix https://github.com/facebook/react-native/commit/ac4ddec542febda744de218dae3a3d34edc7da84
* Upgrading CocoaPods to 1.11 would bring us https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8 and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves
Reviewed By: lunaleaps
Differential Revision: D31248460
Pulled By: fkgozali
fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
2021-09-29 03:03:31 +03:00
projects . each do | project |
project . build_configurations . each do | config |
fix_config ( config )
end
project . native_targets . each do | target |
target . build_configurations . each do | config |
fix_config ( config )
end
end
2020-12-15 01:06:07 +03:00
project . save ( )
end
end
2020-12-15 22:13:12 +03:00
def react_native_post_install ( installer )
if has_pod ( installer , 'Flipper' )
flipper_post_install ( installer )
end
exclude_architectures ( installer )
Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284)
Summary:
Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should.
This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation.
Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done.
Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0`
## Changelog
[iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1
[iOS] [Changed] - Do not exclude the arm64 iphonesimulator
[iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround()
Pull Request resolved: https://github.com/facebook/react-native/pull/32284
Test Plan:
* Build `packages/rn-tester` on M1 and see it still works properly
* Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed
## References:
* Closes https://github.com/facebook/react-native/issues/31480
* The initial fix https://github.com/facebook/react-native/commit/ac4ddec542febda744de218dae3a3d34edc7da84
* Upgrading CocoaPods to 1.11 would bring us https://github.com/CocoaPods/CocoaPods/commit/6985cbf7de73f645029e8a716cad0c89ff81e3c8 and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves
Reviewed By: lunaleaps
Differential Revision: D31248460
Pulled By: fkgozali
fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
2021-09-29 03:03:31 +03:00
fix_library_search_paths ( installer )
2021-12-17 10:40:22 +03:00
cpp_flags = DEFAULT_OTHER_CPLUSPLUSFLAGS
if ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1'
cpp_flags = NEW_ARCH_OTHER_CPLUSPLUSFLAGS
end
modify_flags_for_new_architecture ( installer , cpp_flags )
end
def modify_flags_for_new_architecture ( installer , cpp_flags )
# Add RCT_NEW_ARCH_ENABLED to Target pods xcconfig
installer . aggregate_targets . each do | aggregate_target |
aggregate_target . xcconfigs . each do | config_name , config_file |
config_file . attributes [ 'OTHER_CPLUSPLUSFLAGS' ] = cpp_flags
xcconfig_path = aggregate_target . xcconfig_path ( config_name )
Pod :: UI . puts xcconfig_path
config_file . save_as ( xcconfig_path )
end
end
# Add RCT_NEW_ARCH_ENABLED to Pods project xcconfig
installer . pods_project . targets . each do | target |
# if target.name == 'React-Core'
if target . name == 'React-Core'
puts " #{ target . name } "
target . build_configurations . each do | config |
config . build_settings [ 'OTHER_CPLUSPLUSFLAGS' ] = cpp_flags
end
end
end
2020-12-15 22:13:12 +03:00
end
2020-12-30 03:08:29 +03:00
2021-12-01 04:09:24 +03:00
def build_codegen! ( react_native_path )
2022-03-14 20:31:18 +03:00
codegen_repo_path = " #{ react_native_path } /packages/react-native-codegen " ;
codegen_npm_path = " #{ react_native_path } /../react-native-codegen " ;
2021-12-01 04:09:24 +03:00
codegen_cli_path = " "
if Dir . exist? ( codegen_repo_path )
codegen_cli_path = codegen_repo_path
elsif Dir . exist? ( codegen_npm_path )
codegen_cli_path = codegen_npm_path
else
raise " [codegen] Couldn't not find react-native-codegen. "
end
if ! Dir . exist? ( " #{ codegen_cli_path } /lib " )
Pod :: UI . puts " [Codegen] building #{ codegen_cli_path } . "
system ( " #{ codegen_cli_path } /scripts/oss/build.sh " )
end
end
2021-11-17 23:16:48 +03:00
# This is a temporary supporting function until we enable use_react_native_codegen_discovery by default.
def checkAndGenerateEmptyThirdPartyProvider! ( react_native_path )
return if ENV [ 'USE_CODEGEN_DISCOVERY' ] == '1'
relative_installation_root = Pod :: Config . instance . installation_root . relative_path_from ( Pathname . pwd )
output_dir = " #{ relative_installation_root } / #{ $CODEGEN_OUTPUT_DIR } "
provider_h_path = " #{ output_dir } /RCTThirdPartyFabricComponentsProvider.h "
provider_cpp_path = " #{ output_dir } /RCTThirdPartyFabricComponentsProvider.cpp "
if ( ! File . exist? ( provider_h_path ) || ! File . exist? ( provider_cpp_path ) )
2021-12-01 04:09:24 +03:00
# build codegen
build_codegen! ( react_native_path )
2021-11-17 23:16:48 +03:00
# Just use a temp empty schema list.
temp_schema_list_path = " #{ output_dir } /tmpSchemaList.txt "
File . open ( temp_schema_list_path , 'w' ) do | f |
f . write ( '[]' )
f . fsync
end
Pod :: UI . puts '[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider'
Pod :: Executable . execute_command (
'node' ,
[
2022-03-14 20:31:18 +03:00
" #{ react_native_path } /scripts/generate-provider-cli.js " ,
2021-11-17 23:16:48 +03:00
" --platform " , 'ios' ,
" --schemaListPath " , temp_schema_list_path ,
" --outputDir " , " #{ output_dir } "
] )
File . delete ( temp_schema_list_path ) if File . exist? ( temp_schema_list_path )
end
end
2021-10-19 01:32:45 +03:00
2021-12-14 21:13:31 +03:00
def get_react_codegen_spec ( options = { } )
fabric_enabled = options [ :fabric_enabled ] || = false
script_phases = options [ :script_phases ] || = nil
2021-10-19 01:32:45 +03:00
package = JSON . parse ( File . read ( File . join ( __dir__ , " .. " , " package.json " ) ) )
version = package [ 'version' ]
2021-10-26 06:47:13 +03:00
source = { :git = > 'https://github.com/facebook/react-native.git' }
if version == '1000.0.0'
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’ re presumably in.
source [ :commit ] = ` git rev-parse HEAD ` . strip if system ( " git rev-parse --git-dir > /dev/null 2>&1 " )
else
source [ :tag ] = " v #{ version } "
end
2021-10-19 01:32:45 +03:00
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
2021-10-26 06:47:13 +03:00
folly_version = '2021.06.28.00-v2'
2021-10-19 01:32:45 +03:00
boost_version = '1.76.0'
boost_compiler_flags = '-Wno-documentation'
spec = {
2021-10-26 06:47:13 +03:00
'name' = > " React-Codegen " ,
2021-10-19 01:32:45 +03:00
'version' = > version ,
'summary' = > 'Temp pod for generated files for React Native' ,
'homepage' = > 'https://facebook.com/' ,
'license' = > 'Unlicense' ,
'authors' = > 'Facebook' ,
2022-03-04 18:25:59 +03:00
'compiler_flags' = > " #{ folly_compiler_flags } #{ boost_compiler_flags } -Wno-nullability-completeness -std=c++17 " ,
2021-10-19 01:32:45 +03:00
'source' = > { :git = > '' } ,
2021-10-26 06:47:13 +03:00
'header_mappings_dir' = > './' ,
2021-10-19 01:32:45 +03:00
'platforms' = > {
'ios' = > '11.0' ,
} ,
'source_files' = > " **/*.{h,mm,cpp} " ,
'pod_target_xcconfig' = > { " HEADER_SEARCH_PATHS " = >
[
" \" $(PODS_ROOT)/boost \" " ,
" \" $(PODS_ROOT)/RCT-Folly \" " ,
2021-10-26 06:47:13 +03:00
" \" ${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components \" " ,
2021-11-17 23:16:48 +03:00
" \" $(PODS_ROOT)/Headers/Private/React-Fabric \" " ,
" \" $(PODS_ROOT)/Headers/Private/React-RCTFabric \" " ,
2021-10-19 01:32:45 +03:00
] . join ( ' ' )
} ,
'dependencies' : {
2021-10-26 06:47:13 +03:00
" FBReactNativeSpec " : [ version ] ,
2021-10-19 01:32:45 +03:00
" React-jsiexecutor " : [ version ] ,
" RCT-Folly " : [ folly_version ] ,
" RCTRequired " : [ version ] ,
" RCTTypeSafety " : [ version ] ,
" React-Core " : [ version ] ,
" React-jsi " : [ version ] ,
" ReactCommon/turbomodule/core " : [ version ]
}
}
2021-10-26 11:16:49 +03:00
if fabric_enabled
2021-10-27 19:43:49 +03:00
spec [ :'dependencies' ] . merge! ( {
'React-graphics' : [ version ] ,
'React-rncore' : [ version ] ,
} ) ;
2021-10-26 11:16:49 +03:00
end
2021-12-14 21:13:31 +03:00
if script_phases
Pod :: UI . puts " [Codegen] Adding script_phases to React-Codegen. "
spec [ :'script_phases' ] = script_phases
end
return spec
end
2021-12-14 22:33:00 +03:00
def get_codegen_config_from_file ( config_path , config_key )
2021-12-15 05:41:54 +03:00
empty = { 'libraries' = > [ ] }
2021-12-14 22:33:00 +03:00
if ! File . exist? ( config_path )
return empty
end
config = JSON . parse ( File . read ( config_path ) )
return config [ config_key ] ? config [ config_key ] : empty
end
2021-12-14 21:13:31 +03:00
def get_react_codegen_script_phases ( options = { } )
app_path = options [ :app_path ] || = ''
if ! app_path
Pod :: UI . warn '[Codegen] error: app_path is requried to use codegen discovery.'
exit 1
end
# We need to convert paths to relative path from installation_root for the script phase for CI.
2022-03-10 15:34:53 +03:00
relative_app_root = Pathname . new ( app_path ) . realpath ( ) . relative_path_from ( Pod :: Config . instance . installation_root )
2021-12-14 21:13:31 +03:00
config_file_dir = options [ :config_file_dir ] || = ''
relative_config_file_dir = ''
2021-12-15 05:41:54 +03:00
if config_file_dir != ''
2021-12-14 21:13:31 +03:00
relative_config_file_dir = Pathname . new ( config_file_dir ) . relative_path_from ( Pod :: Config . instance . installation_root )
end
fabric_enabled = options [ :fabric_enabled ] || = false
# react_native_path should be relative already.
react_native_path = options [ :react_native_path ] || = " ../node_modules/react-native "
2021-12-14 22:33:00 +03:00
# Generate input files for in-app libaraies which will be used to check if the script needs to be run.
# TODO: Ideally, we generate the input_files list from generate-artifacts.js and read the result here.
# Or, generate this podspec in generate-artifacts.js as well.
config_key = options [ :config_key ] || = 'codegenConfig'
app_package_path = File . join ( app_path , 'package.json' )
app_codegen_config = get_codegen_config_from_file ( app_package_path , config_key )
file_list = [ ]
app_codegen_config [ 'libraries' ] . each do | library |
library_dir = File . join ( app_path , library [ 'jsSrcsDir' ] )
file_list . concat ( ` find #{ library_dir } -type f \\ ( -name "Native*.js" -or -name "*NativeComponent.js" \\ ) ` . split ( " \n " ) . sort )
end
2022-03-10 15:34:53 +03:00
input_files = file_list . map { | filename | " ${PODS_ROOT}/../ #{ Pathname . new ( filename ) . realpath ( ) . relative_path_from ( Pod :: Config . instance . installation_root ) } " }
2021-12-14 22:33:00 +03:00
2021-12-14 21:13:31 +03:00
# Add a script phase to trigger generate artifact.
# Some code is duplicated so that it's easier to delete the old way and switch over to this once it's stabilized.
return {
'name' : 'Generate Specs' ,
'execution_position' : :before_compile ,
2021-12-14 22:33:00 +03:00
'input_files' = > input_files ,
2021-12-14 21:13:31 +03:00
'show_env_vars_in_log' : true ,
'output_files' : [ " ${DERIVED_FILE_DIR}/react-codegen.log " ] ,
2021-12-16 03:10:03 +03:00
'script' : get_script_phases_with_codegen_discovery (
react_native_path : react_native_path ,
relative_app_root : relative_app_root ,
relative_config_file_dir : relative_config_file_dir ,
fabric_enabled : fabric_enabled
) ,
2021-12-14 21:13:31 +03:00
}
end
def set_react_codegen_podspec_generated ( value )
$REACT_CODEGEN_PODSPEC_GENERATED = value
end
def has_react_codegen_podspec_generated ( )
return $REACT_CODEGEN_PODSPEC_GENERATED
end
def generate_react_codegen_podspec! ( spec )
# This podspec file should only be create once in the session/pod install.
# This happens when multiple targets are calling use_react_native!.
if has_react_codegen_podspec_generated ( )
Pod :: UI . puts " [Codegen] Skipping React-Codegen podspec generation. "
return
end
relative_installation_root = Pod :: Config . instance . installation_root . relative_path_from ( Pathname . pwd )
output_dir = " #{ relative_installation_root } / #{ $CODEGEN_OUTPUT_DIR } "
Pod :: Executable . execute_command ( " mkdir " , [ " -p " , output_dir ] ) ;
2021-10-26 06:47:13 +03:00
podspec_path = File . join ( output_dir , 'React-Codegen.podspec.json' )
Pod :: UI . puts " [Codegen] Generating #{ podspec_path } "
2021-10-19 01:32:45 +03:00
File . open ( podspec_path , 'w' ) do | f |
f . write ( spec . to_json )
f . fsync
end
2021-12-14 21:13:31 +03:00
set_react_codegen_podspec_generated ( true )
2021-10-19 01:32:45 +03:00
return {
" spec " = > spec ,
2021-11-04 03:48:19 +03:00
" path " = > $CODEGEN_OUTPUT_DIR , # Path needs to be relative to `Podfile`
2021-10-19 01:32:45 +03:00
}
end
2021-11-05 21:28:13 +03:00
def use_react_native_codegen_discovery! ( options = { } )
2021-02-02 01:36:52 +03:00
return if ENV [ 'DISABLE_CODEGEN' ] == '1'
2021-12-14 21:13:31 +03:00
if $REACT_CODEGEN_DISCOVERY_DONE
Pod :: UI . puts " [Codegen] Skipping use_react_native_codegen_discovery. "
return
end
2021-11-05 21:28:13 +03:00
Pod :: UI . warn '[Codegen] warn: using experimental new codegen integration'
react_native_path = options [ :react_native_path ] || = " ../node_modules/react-native "
app_path = options [ :app_path ]
2021-11-12 19:27:00 +03:00
fabric_enabled = options [ :fabric_enabled ] || = false
2021-11-19 00:30:52 +03:00
config_file_dir = options [ :config_file_dir ] || = ''
2021-12-14 21:13:31 +03:00
if ! app_path
Pod :: UI . warn '[Codegen] Error: app_path is required for use_react_native_codegen_discovery.'
2021-12-14 05:22:35 +03:00
Pod :: UI . warn '[Codegen] If you are calling use_react_native_codegen_discovery! in your Podfile, please remove the call and pass `app_path` and/or `config_file_dir` to `use_react_native!`.'
2021-11-05 21:28:13 +03:00
exit 1
end
2021-12-14 21:13:31 +03:00
# Generate React-Codegen podspec here to add the script phases.
script_phases = get_react_codegen_script_phases ( options )
react_codegen_spec = get_react_codegen_spec ( fabric_enabled : fabric_enabled , script_phases : script_phases )
generate_react_codegen_podspec! ( react_codegen_spec )
out = Pod :: Executable . execute_command (
'node' ,
[
2022-03-14 20:31:18 +03:00
" #{ react_native_path } /scripts/generate-artifacts.js " ,
2021-12-14 21:13:31 +03:00
" -p " , " #{ app_path } " ,
" -o " , Pod :: Config . instance . installation_root ,
" -e " , " #{ fabric_enabled } " ,
" -c " , " #{ config_file_dir } " ,
] )
Pod :: UI . puts out ;
$REACT_CODEGEN_DISCOVERY_DONE = true
2021-11-05 21:28:13 +03:00
end
def use_react_native_codegen! ( spec , options = { } )
return if ENV [ 'USE_CODEGEN_DISCOVERY' ] == '1'
# TODO: Once the new codegen approach is ready for use, we should output a warning here to let folks know to migrate.
2021-07-13 21:34:34 +03:00
# The prefix to react-native
2021-12-16 03:10:03 +03:00
react_native_path = options [ :react_native_path ] || = " ../.. "
2020-12-30 03:08:29 +03:00
# Library name (e.g. FBReactNativeSpec)
2021-09-17 00:09:22 +03:00
library_name = options [ :library_name ] || = " #{ spec . name . gsub ( '_' , '-' ) . split ( '-' ) . collect ( & :capitalize ) . join } Spec "
2021-11-05 21:28:13 +03:00
Pod :: UI . puts " [Codegen] Found #{ library_name } "
2021-07-13 20:13:56 +03:00
2022-03-07 17:44:25 +03:00
relative_installation_root = Pod :: Config . instance . installation_root . relative_path_from ( Pathname . pwd )
2021-11-12 08:54:44 +03:00
output_dir = options [ :output_dir ] || = $CODEGEN_OUTPUT_DIR
output_dir_module = " #{ output_dir } / #{ $CODEGEN_MODULE_DIR } "
output_dir_component = " #{ output_dir } / #{ $CODEGEN_COMPONENT_DIR } "
2021-09-11 02:06:43 +03:00
codegen_config = {
" modules " = > {
:js_srcs_pattern = > " Native*.js " ,
2022-03-07 17:44:25 +03:00
:generated_dir = > " #{ relative_installation_root } / #{ output_dir_module } / #{ library_name } " ,
2021-09-11 02:06:43 +03:00
:generated_files = > [
" #{ library_name } .h " ,
" #{ library_name } -generated.mm "
]
} ,
" components " = > {
:js_srcs_pattern = > " *NativeComponent.js " ,
2022-03-07 17:44:25 +03:00
:generated_dir = > " #{ relative_installation_root } / #{ output_dir_component } / #{ library_name } " ,
2021-09-11 02:06:43 +03:00
:generated_files = > [
" ComponentDescriptors.h " ,
" EventEmitters.cpp " ,
" EventEmitters.h " ,
" Props.cpp " ,
" Props.h " ,
" RCTComponentViewHelpers.h " ,
" ShadowNodes.cpp " ,
" ShadowNodes.h "
]
}
}
# The path to JavaScript files
js_srcs_dir = options [ :js_srcs_dir ] || = " ./ "
library_type = options [ :library_type ]
if library_type
2021-10-26 00:51:00 +03:00
if ! codegen_config [ library_type ]
raise " [Codegen] invalid library_type: #{ library_type } . Check your podspec to make sure it's set to 'modules' or 'components'. Removing the option will generate files for both "
end
2021-09-11 02:06:43 +03:00
js_srcs_pattern = codegen_config [ library_type ] [ :js_srcs_pattern ]
end
if library_type
generated_dirs = [ codegen_config [ library_type ] [ :generated_dir ] ]
generated_files = codegen_config [ library_type ] [ :generated_files ] . map { | filename | " #{ codegen_config [ library_type ] [ :generated_dir ] } / #{ filename } " }
else
generated_dirs = [ codegen_config [ " modules " ] [ :generated_dir ] , codegen_config [ " components " ] [ :generated_dir ] ]
generated_files = codegen_config [ " modules " ] [ :generated_files ] . map { | filename | " #{ codegen_config [ " modules " ] [ :generated_dir ] } / #{ filename } " }
generated_files = generated_files . concat ( codegen_config [ " components " ] [ :generated_files ] . map { | filename | " #{ codegen_config [ " components " ] [ :generated_dir ] } / #{ filename } " } )
end
if js_srcs_pattern
file_list = ` find #{ js_srcs_dir } -type f -name #{ js_srcs_pattern } ` . split ( " \n " ) . sort
input_files = file_list . map { | filename | " ${PODS_TARGET_SRCROOT}/ #{ filename } " }
else
input_files = [ js_srcs_dir ]
end
2020-12-30 03:08:29 +03:00
2021-07-13 20:13:56 +03:00
# Prepare filesystem by creating empty files that will be picked up as references by CocoaPods.
2021-08-06 20:41:32 +03:00
prepare_command = " mkdir -p #{ generated_dirs . join ( " " ) } && touch -a #{ generated_files . join ( " " ) } "
2021-09-11 02:06:43 +03:00
system ( prepare_command ) # Always run prepare_command when a podspec uses the codegen, as CocoaPods may skip invoking this command in certain scenarios. Replace with pre_integrate_hook after updating to CocoaPods 1.11
2021-08-06 20:41:32 +03:00
spec . prepare_command = prepare_command
2021-07-13 20:13:56 +03:00
2021-02-02 01:36:52 +03:00
spec . script_phase = {
:name = > 'Generate Specs' ,
2021-09-11 02:06:43 +03:00
:input_files = > input_files , # This also needs to be relative to Xcode
2022-03-07 17:44:25 +03:00
:output_files = > [ " ${DERIVED_FILE_DIR}/codegen- #{ library_name } .log " ] . concat ( generated_files . map { | filename | " ${PODS_TARGET_SRCROOT}/ #{ filename } " } ) ,
2021-07-13 20:13:56 +03:00
# The final generated files will be created when this script is invoked at Xcode build time.
2021-12-16 03:10:03 +03:00
:script = > get_script_phases_no_codegen_discovery (
react_native_path : react_native_path ,
codegen_output_dir : $CODEGEN_OUTPUT_DIR ,
codegen_module_dir : $CODEGEN_MODULE_DIR ,
codegen_component_dir : $CODEGEN_COMPONENT_DIR ,
library_name : library_name ,
library_type : library_type ,
js_srcs_pattern : js_srcs_pattern ,
js_srcs_dir : js_srcs_dir ,
file_list : file_list
) ,
2021-02-02 01:36:52 +03:00
:execution_position = > :before_compile ,
:show_env_vars_in_log = > true
}
2020-12-30 03:08:29 +03:00
end
2021-09-01 10:15:04 +03:00
2022-03-10 22:24:48 +03:00
def downloadAndConfigureHermesSource ( react_native_path )
hermes_tarball_base_url = " https://github.com/facebook/hermes/tarball/ "
sdks_dir = " #{ react_native_path } /sdks "
download_dir = " #{ sdks_dir } /download "
hermes_dir = " #{ sdks_dir } /hermes "
hermes_tag_file = " #{ sdks_dir } /.hermesversion "
tarball_path = " #{ download_dir } /hermes.tar.gz "
system ( " mkdir -p #{ hermes_dir } #{ download_dir } " )
if ( File . exist? ( hermes_tag_file ) )
hermes_tag = file_data = File . read ( hermes_tag_file ) . strip
hermes_tarball_url = hermes_tarball_base_url + hermes_tag
else
hermes_tarball_url = hermes_tarball_base_url + " main "
end
system ( " wget --timestamping -O #{ tarball_path } #{ hermes_tarball_url } " )
system ( " tar -xzf #{ tarball_path } --strip-components=1 -C #{ hermes_dir } " )
hermes_dir
end
2022-02-25 00:27:11 +03:00
def locatePathToHermesSource! ( react_native_path )
return if ENV [ 'BUILD_HERMES_SOURCE' ] != '1'
hermes_source_path = " #{ react_native_path } /sdks/hermes "
if ! File . exist? ( hermes_source_path )
Pod :: UI . warn " [Hermes] Error: Hermes source code must be present at #{ hermes_source_path } when BUILD_HERMES_SOURCE is enabled. "
Pod :: UI . warn '[Hermes] Verify that the release of React Native that you are using has the Hermes source code included.'
exit 1
end
hermes_source_path
end
2021-09-01 10:15:04 +03:00
# This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon (M1) machines.
# Call this in the app's main Podfile's post_install hook.
# See https://github.com/facebook/react-native/issues/31480#issuecomment-902912841 for more context.
# Actual fix was authored by https://github.com/mikehardy.
# New app template will call this for now until the underlying issue is resolved.
def __apply_Xcode_12_5_M1_post_install_workaround ( installer )
2021-10-25 21:32:27 +03:00
# Flipper podspecs are still targeting an older iOS deployment target, and may cause an error like:
# "error: thread-local storage is not supported for the current target"
# The most reliable known workaround is to bump iOS deployment target to match react-native (iOS 11 now).
installer . pods_project . targets . each do | target |
target . build_configurations . each do | config |
2021-11-30 21:20:39 +03:00
# ensure IPHONEOS_DEPLOYMENT_TARGET is at least 11.0
2021-12-14 20:31:59 +03:00
deployment_target = config . build_settings [ 'IPHONEOS_DEPLOYMENT_TARGET' ] . to_f
should_upgrade = deployment_target < 11 . 0 && deployment_target != 0 . 0
2021-11-30 21:20:39 +03:00
if should_upgrade
config . build_settings [ 'IPHONEOS_DEPLOYMENT_TARGET' ] = '11.0'
2021-10-25 21:32:27 +03:00
end
2021-11-30 21:20:39 +03:00
end
2021-10-25 21:32:27 +03:00
end
# But... doing so caused another issue in Flipper:
# "Time.h:52:17: error: typedef redefinition with different types"
2021-11-30 21:20:39 +03:00
# We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
2021-10-25 21:32:27 +03:00
# See https://github.com/facebook/flipper/issues/834 for more details.
2022-01-25 00:29:10 +03:00
time_header = " #{ Pod :: Config . instance . installation_root . to_s } /Pods/RCT-Folly/folly/portability/Time.h "
` sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' #{ time_header } `
2021-09-01 10:15:04 +03:00
end