From c3c3726b369f9ea69a1df95de724d1df11eb28b8 Mon Sep 17 00:00:00 2001 From: Arnaud de Mouhy Date: Thu, 29 Apr 2021 18:54:49 +0200 Subject: [PATCH] ci: Compile on Xcode 12.5 --- example/ios/Podfile | 37 +++++++- example/ios/Podfile.lock | 88 +------------------- example/ios/RadioPlayerExample/AppDelegate.m | 32 +++---- 3 files changed, 54 insertions(+), 103 deletions(-) diff --git a/example/ios/Podfile b/example/ios/Podfile index bed29ed..64eadbb 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -9,6 +9,7 @@ def add_flipper_pods! pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug' pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug' end + # Post Install processing for Flipper def flipper_post_install(installer) installer.pods_project.targets.each do |target| @@ -20,6 +21,19 @@ def flipper_post_install(installer) end end +def find_and_replace(dir, findstr, replacestr) + Dir[dir].each do |name| + text = File.read(name) + replace = text.gsub(findstr,replacestr) + if text != replace + puts "Fix: " + name + File.open(name, "w") { |file| file.puts replace } + STDOUT.flush + end + end + Dir[dir + '*/'].each(&method(:find_and_replace)) +end + target 'RadioPlayerExample' do # Pods for RadioPlayerExample pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" @@ -61,8 +75,25 @@ target 'RadioPlayerExample' do # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. - add_flipper_pods! + #add_flipper_pods! post_install do |installer| - flipper_post_install(installer) - end + #flipper_post_install(installer) + + ## Fix for XCode 12.5 & RN 0.62.2 - See https://github.com/facebook/react-native/issues/28405 + find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm", + "_initializeModules:(NSArray> *)modules", "_initializeModules:(NSArray *)modules") + + find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", + "RCTBridgeModuleNameForClass(strongModule))", "RCTBridgeModuleNameForClass(Class(strongModule)))") + + ## Fix for Flipper-Folly on iOS 14.5 + #find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", + #"atomic_notify_one(state)", "folly::atomic_notify_one(state)") + + #find_and_replace("Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h", + #"atomic_notify_one(state)", "folly::atomic_notify_one(state)") + + #find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", + #"atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)") + end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7a0f176..0f721c8 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,7 +1,5 @@ PODS: - boost-for-react-native (1.63.0) - - CocoaAsyncSocket (7.6.4) - - CocoaLibEvent (1.0.0) - DoubleConversion (1.1.6) - FBLazyVector (0.62.2) - FBReactNativeSpec (0.62.2): @@ -11,52 +9,6 @@ PODS: - React-Core (= 0.62.2) - React-jsi (= 0.62.2) - ReactCommon/turbomodule/core (= 0.62.2) - - Flipper (0.33.1): - - Flipper-Folly (~> 2.1) - - Flipper-RSocket (~> 1.0) - - Flipper-DoubleConversion (1.1.7) - - Flipper-Folly (2.2.0): - - boost-for-react-native - - CocoaLibEvent (~> 1.0) - - Flipper-DoubleConversion - - Flipper-Glog - - OpenSSL-Universal (= 1.0.2.19) - - Flipper-Glog (0.3.6) - - Flipper-PeerTalk (0.0.4) - - Flipper-RSocket (1.1.0): - - Flipper-Folly (~> 2.2) - - FlipperKit (0.33.1): - - FlipperKit/Core (= 0.33.1) - - FlipperKit/Core (0.33.1): - - Flipper (~> 0.33.1) - - FlipperKit/CppBridge - - FlipperKit/FBCxxFollyDynamicConvert - - FlipperKit/FBDefines - - FlipperKit/FKPortForwarding - - FlipperKit/CppBridge (0.33.1): - - Flipper (~> 0.33.1) - - FlipperKit/FBCxxFollyDynamicConvert (0.33.1): - - Flipper-Folly (~> 2.1) - - FlipperKit/FBDefines (0.33.1) - - FlipperKit/FKPortForwarding (0.33.1): - - CocoaAsyncSocket (~> 7.6) - - Flipper-PeerTalk (~> 0.0.4) - - FlipperKit/FlipperKitHighlightOverlay (0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (0.33.1): - - FlipperKit/Core - - FlipperKit/FlipperKitHighlightOverlay - - FlipperKit/FlipperKitLayoutTextSearchable - - YogaKit (~> 1.18) - - FlipperKit/FlipperKitLayoutTextSearchable (0.33.1) - - FlipperKit/FlipperKitNetworkPlugin (0.33.1): - - FlipperKit/Core - - FlipperKit/FlipperKitReactPlugin (0.33.1): - - FlipperKit/Core - - FlipperKit/FlipperKitUserDefaultsPlugin (0.33.1): - - FlipperKit/Core - - FlipperKit/SKIOSNetworkPlugin (0.33.1): - - FlipperKit/Core - - FlipperKit/FlipperKitNetworkPlugin - Folly (2018.10.22.00): - boost-for-react-native - DoubleConversion @@ -68,9 +20,6 @@ PODS: - glog - FRadioPlayer (0.1.20) - glog (0.3.5) - - OpenSSL-Universal (1.0.2.19): - - OpenSSL-Universal/Static (= 1.0.2.19) - - OpenSSL-Universal/Static (1.0.2.19) - RCTRequired (0.62.2) - RCTTypeSafety (0.62.2): - FBLazyVector (= 0.62.2) @@ -234,7 +183,7 @@ PODS: - React-cxxreact (= 0.62.2) - React-jsi (= 0.62.2) - React-jsinspector (0.62.2) - - react-native-radio-player (0.1.0): + - react-native-radio-player (0.2.2): - FRadioPlayer - React - React-RCTActionSheet (0.62.2): @@ -297,18 +246,11 @@ PODS: - React-jsi (= 0.62.2) - ReactCommon/callinvoker (= 0.62.2) - Yoga (1.14.0) - - YogaKit (1.18.1): - - Yoga (~> 1.14) DEPENDENCIES: - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) - - FlipperKit (~> 0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (~> 0.33.1) - - FlipperKit/FlipperKitReactPlugin (~> 0.33.1) - - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.33.1) - - FlipperKit/SKIOSNetworkPlugin (~> 0.33.1) - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) @@ -339,18 +281,7 @@ DEPENDENCIES: SPEC REPOS: trunk: - boost-for-react-native - - CocoaAsyncSocket - - CocoaLibEvent - - Flipper - - Flipper-DoubleConversion - - Flipper-Folly - - Flipper-Glog - - Flipper-PeerTalk - - Flipper-RSocket - - FlipperKit - FRadioPlayer - - OpenSSL-Universal - - YogaKit EXTERNAL SOURCES: DoubleConversion: @@ -408,22 +339,12 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c - CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 - CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 FBLazyVector: 4aab18c93cd9546e4bfed752b4084585eca8b245 FBReactNativeSpec: 5465d51ccfeecb7faa12f9ae0024f2044ce4044e - Flipper: 6c1f484f9a88d30ab3e272800d53688439e50f69 - Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 - Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 - Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 - Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 - Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 - FlipperKit: 6dc9b8f4ef60d9e5ded7f0264db299c91f18832e Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 FRadioPlayer: 5c35ba963b69663a4f7d34405c09847d7aebbfcc glog: 1f3da668190260b06b429bb211bfbee5cd790c28 - OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035 RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3 @@ -433,7 +354,7 @@ SPEC CHECKSUMS: React-jsi: b6dc94a6a12ff98e8877287a0b7620d365201161 React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493 - react-native-radio-player: b2af2429095ba5e718b3c4d53df3ca1fbd970900 + react-native-radio-player: f0306f5776333c4b8809119770009a116975faeb React-RCTActionSheet: f41ea8a811aac770e0cc6e0ad6b270c644ea8b7c React-RCTAnimation: 49ab98b1c1ff4445148b72a3d61554138565bad0 React-RCTBlob: a332773f0ebc413a0ce85942a55b064471587a71 @@ -445,8 +366,7 @@ SPEC CHECKSUMS: React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256 ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3 Yoga: 3ebccbdd559724312790e7742142d062476b698e - YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 744861ee7474b4b7f6136f78f6285666f90653b6 +PODFILE CHECKSUM: 973a2176240c0436bb8e38f2433eed1c8e164c7c -COCOAPODS: 1.9.3 +COCOAPODS: 1.10.1 diff --git a/example/ios/RadioPlayerExample/AppDelegate.m b/example/ios/RadioPlayerExample/AppDelegate.m index 4873284..15c1d72 100644 --- a/example/ios/RadioPlayerExample/AppDelegate.m +++ b/example/ios/RadioPlayerExample/AppDelegate.m @@ -12,21 +12,21 @@ #import #if DEBUG -#import -#import -#import -#import -#import -#import -static void InitializeFlipper(UIApplication *application) { - FlipperClient *client = [FlipperClient sharedClient]; - SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; - [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; - [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; - [client addPlugin:[FlipperKitReactPlugin new]]; - [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; - [client start]; -} +//#import +//#import +//#import +//#import +//#import +//#import +//static void InitializeFlipper(UIApplication *application) { +// FlipperClient *client = [FlipperClient sharedClient]; +// SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; +// [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; +// [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; +// [client addPlugin:[FlipperKitReactPlugin new]]; +// [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; +// [client start]; +//} #endif @implementation AppDelegate @@ -34,7 +34,7 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { #if DEBUG - InitializeFlipper(application); +//InitializeFlipper(application); #endif RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge