From 17f025bc26da13da795845a3f7daee65563420c0 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Tue, 21 Apr 2020 17:43:59 -0700 Subject: [PATCH] Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android ## Changelog [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 --- RNTester/Podfile.lock | 88 +++++++++---------- .../RNTesterPods.xcodeproj/project.pbxproj | 14 +++ RNTester/android/app/gradle.properties | 2 +- scripts/react_native_pods.rb | 35 ++++++-- template/android/gradle.properties | 2 +- 5 files changed, 90 insertions(+), 51 deletions(-) diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 6f28a766139286..e5124ddbd7c54e 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -11,11 +11,11 @@ PODS: - React-Core (= 1000.0.0) - React-jsi (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - - Flipper (0.33.1): - - Flipper-Folly (~> 2.1) - - Flipper-RSocket (~> 1.0) + - Flipper (0.37.0): + - Flipper-Folly (~> 2.2) + - Flipper-RSocket (~> 1.1) - Flipper-DoubleConversion (1.1.7) - - Flipper-Folly (2.1.1): + - Flipper-Folly (2.2.0): - boost-for-react-native - CocoaLibEvent (~> 1.0) - Flipper-DoubleConversion @@ -23,38 +23,38 @@ PODS: - OpenSSL-Universal (= 1.0.2.19) - Flipper-Glog (0.3.6) - Flipper-PeerTalk (0.0.4) - - Flipper-RSocket (1.0.0): - - Flipper-Folly (~> 2.0) - - FlipperKit (0.33.1): - - FlipperKit/Core (= 0.33.1) - - FlipperKit/Core (0.33.1): - - Flipper (~> 0.33.1) + - Flipper-RSocket (1.1.0): + - Flipper-Folly (~> 2.2) + - FlipperKit (0.37.0): + - FlipperKit/Core (= 0.37.0) + - FlipperKit/Core (0.37.0): + - Flipper (~> 0.37.0) - 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): + - FlipperKit/CppBridge (0.37.0): + - Flipper (~> 0.37.0) + - FlipperKit/FBCxxFollyDynamicConvert (0.37.0): + - Flipper-Folly (~> 2.2) + - FlipperKit/FBDefines (0.37.0) + - FlipperKit/FKPortForwarding (0.37.0): - CocoaAsyncSocket (~> 7.6) - Flipper-PeerTalk (~> 0.0.4) - - FlipperKit/FlipperKitHighlightOverlay (0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (0.33.1): + - FlipperKit/FlipperKitHighlightOverlay (0.37.0) + - FlipperKit/FlipperKitLayoutPlugin (0.37.0): - FlipperKit/Core - FlipperKit/FlipperKitHighlightOverlay - FlipperKit/FlipperKitLayoutTextSearchable - YogaKit (~> 1.18) - - FlipperKit/FlipperKitLayoutTextSearchable (0.33.1) - - FlipperKit/FlipperKitNetworkPlugin (0.33.1): + - FlipperKit/FlipperKitLayoutTextSearchable (0.37.0) + - FlipperKit/FlipperKitNetworkPlugin (0.37.0): - FlipperKit/Core - - FlipperKit/FlipperKitReactPlugin (0.33.1): + - FlipperKit/FlipperKitReactPlugin (0.37.0): - FlipperKit/Core - - FlipperKit/FlipperKitUserDefaultsPlugin (0.33.1): + - FlipperKit/FlipperKitUserDefaultsPlugin (0.37.0): - FlipperKit/Core - - FlipperKit/SKIOSNetworkPlugin (0.33.1): + - FlipperKit/SKIOSNetworkPlugin (0.37.0): - FlipperKit/Core - FlipperKit/FlipperKitNetworkPlugin - Folly (2020.01.13.00): @@ -343,25 +343,25 @@ DEPENDENCIES: - DoubleConversion (from `../third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../Libraries/FBLazyVector`) - FBReactNativeSpec (from `../Libraries/FBReactNativeSpec`) - - Flipper (~> 0.33.1) + - Flipper (~> 0.37.0) - Flipper-DoubleConversion (= 1.1.7) - - Flipper-Folly (~> 2.1) + - Flipper-Folly (~> 2.2) - Flipper-Glog (= 0.3.6) - Flipper-PeerTalk (~> 0.0.4) - - Flipper-RSocket (~> 1.0) - - FlipperKit (~> 0.33.1) - - FlipperKit/Core (~> 0.33.1) - - FlipperKit/CppBridge (~> 0.33.1) - - FlipperKit/FBCxxFollyDynamicConvert (~> 0.33.1) - - FlipperKit/FBDefines (~> 0.33.1) - - FlipperKit/FKPortForwarding (~> 0.33.1) - - FlipperKit/FlipperKitHighlightOverlay (~> 0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (~> 0.33.1) - - FlipperKit/FlipperKitLayoutTextSearchable (~> 0.33.1) - - FlipperKit/FlipperKitNetworkPlugin (~> 0.33.1) - - FlipperKit/FlipperKitReactPlugin (~> 0.33.1) - - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.33.1) - - FlipperKit/SKIOSNetworkPlugin (~> 0.33.1) + - Flipper-RSocket (~> 1.1) + - FlipperKit (~> 0.37.0) + - FlipperKit/Core (~> 0.37.0) + - FlipperKit/CppBridge (~> 0.37.0) + - FlipperKit/FBCxxFollyDynamicConvert (~> 0.37.0) + - FlipperKit/FBDefines (~> 0.37.0) + - FlipperKit/FKPortForwarding (~> 0.37.0) + - FlipperKit/FlipperKitHighlightOverlay (~> 0.37.0) + - FlipperKit/FlipperKitLayoutPlugin (~> 0.37.0) + - FlipperKit/FlipperKitLayoutTextSearchable (~> 0.37.0) + - FlipperKit/FlipperKitNetworkPlugin (~> 0.37.0) + - FlipperKit/FlipperKitReactPlugin (~> 0.37.0) + - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.37.0) + - FlipperKit/SKIOSNetworkPlugin (~> 0.37.0) - Folly (from `../third-party-podspecs/Folly.podspec`) - glog (from `../third-party-podspecs/glog.podspec`) - RCTRequired (from `../Libraries/RCTRequired`) @@ -474,13 +474,13 @@ SPEC CHECKSUMS: DoubleConversion: cde416483dac037923206447da6e1454df403714 FBLazyVector: 8ea0285646adaf7fa725c20ed737c49ee5ea680a FBReactNativeSpec: e8f07c749b9cf184c819f5a8ca44b91ab61fca12 - Flipper: 6c1f484f9a88d30ab3e272800d53688439e50f69 + Flipper: 1670db365568191bd123a0c905b834e77ba9e3d3 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 - Flipper-Folly: 2de3d03e0acc7064d5e4ed9f730e2f217486f162 + Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 - Flipper-RSocket: 1260a31c05c238eabfa9bb8a64e3983049048371 - FlipperKit: 6dc9b8f4ef60d9e5ded7f0264db299c91f18832e + Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 + FlipperKit: afd4259ef9eadeeb2d30250b37d95cb3b6b97a69 Folly: b73c3869541e86821df3c387eb0af5f65addfab4 glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 @@ -512,4 +512,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5f0be4be03d6934478b9dd621bfbab4383b8c85d -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.1 diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index c29e9d2ec0f6a3..8f9b9b6a6a2142 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -784,6 +784,10 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", ); "LIBRARY_SEARCH_PATHS[arch=*]" = "$(inherited)"; + OTHER_CFLAGS = ( + "$(inherited)", + "-DFB_SONARKIT_ENABLED=1", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -791,6 +795,7 @@ "-framework", "\"JavaScriptCore\"", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp; PRODUCT_NAME = RNTester; TARGETED_DEVICE_FAMILY = "1,2"; @@ -845,6 +850,10 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", ); + OTHER_CFLAGS = ( + "$(inherited)", + "-DFB_SONARKIT_ENABLED=1", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -852,6 +861,7 @@ "-framework", "\"JavaScriptCore\"", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp; PRODUCT_NAME = RNTester; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1044,6 +1054,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterUnitTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1079,6 +1090,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterUnitTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1115,6 +1127,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1148,6 +1161,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/RNTester/android/app/gradle.properties b/RNTester/android/app/gradle.properties index 3d9a626c164f38..4ff9751aab7d8b 100644 --- a/RNTester/android/app/gradle.properties +++ b/RNTester/android/app/gradle.properties @@ -9,4 +9,4 @@ android.useAndroidX=true android.enableJetifier=true # Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.33.1 +FLIPPER_VERSION=0.37.0 diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 21984326468080..5a2726e0d85354 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -58,19 +58,17 @@ def use_react_native! (options={}) end def use_flipper!(versions = {}) - versions['Flipper'] ||= '~> 0.33.1' + versions['Flipper'] ||= '~> 0.37.0' versions['DoubleConversion'] ||= '1.1.7' - versions['Flipper-Folly'] ||= '~> 2.1' + versions['Flipper-Folly'] ||= '~> 2.2' versions['Flipper-Glog'] ||= '0.3.6' versions['Flipper-PeerTalk'] ||= '~> 0.0.4' - versions['Flipper-RSocket'] ||= '~> 1.0' - + versions['Flipper-RSocket'] ||= '~> 1.1' pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug' pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug' pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug' pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug' pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug' - # List all transitive dependencies for FlipperKit pods # to avoid them being linked in Release builds pod 'Flipper', versions['Flipper'], :configuration => 'Debug' @@ -98,4 +96,31 @@ def flipper_post_install(installer) end end end + file_name = Dir.glob("*.xcodeproj")[0] + app_project = Xcodeproj::Project.open(file_name) + app_project.native_targets.each do |target| + target.build_configurations.each do |config| + cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) ' + unless cflags.include? '-DFB_SONARKIT_ENABLED=1' + puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...' + cflags << '-DFB_SONARKIT_ENABLED=1' + end + config.build_settings['OTHER_CFLAGS'] = cflags + if (config.build_settings['OTHER_SWIFT_FLAGS']) + unless config.build_settings['OTHER_SWIFT_FLAGS'].include? '-DFB_SONARKIT_ENABLED' + puts 'Adding -DFB_SONARKIT_ENABLED ...' + swift_flags = config.build_settings['OTHER_SWIFT_FLAGS'] + if swift_flags.split.last != '-Xcc' + config.build_settings['OTHER_SWIFT_FLAGS'] << ' -Xcc' + end + config.build_settings['OTHER_SWIFT_FLAGS'] << ' -DFB_SONARKIT_ENABLED' + end + else + puts 'OTHER_SWIFT_FLAGS does not exist thus assigning it to `$(inherited) -Xcc -DFB_SONARKIT_ENABLED`' + config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -Xcc -DFB_SONARKIT_ENABLED' + end + app_project.save + end + end + installer.pods_project.save end diff --git a/template/android/gradle.properties b/template/android/gradle.properties index 1bbc8cc20f27f5..04ca0ef29e7d10 100644 --- a/template/android/gradle.properties +++ b/template/android/gradle.properties @@ -25,4 +25,4 @@ android.useAndroidX=true android.enableJetifier=true # Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.33.1 +FLIPPER_VERSION=0.37.0