11platform :ios , '9.0'
22require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33
4+ # Add Flipper Poods
5+ def flipper_pods ( )
6+ flipperkit_version = '0.23.4'
7+ pod 'FlipperKit' , '~>' + flipperkit_version , :configuration => 'Debug'
8+ pod 'FlipperKit/FlipperKitLayoutPlugin' , '~>' + flipperkit_version , :configuration => 'Debug'
9+ pod 'FlipperKit/SKIOSNetworkPlugin' , '~>' + flipperkit_version , :configuration => 'Debug'
10+ pod 'FlipperKit/FlipperKitUserDefaultsPlugin' , '~>' + flipperkit_version , :configuration => 'Debug'
11+ end
12+
13+ # Post Install processing for Flipper
14+ def flipper_post_install ( installer )
15+ installer . pods_project . targets . each do |target |
16+ if target . name == 'YogaKit'
17+ target . build_configurations . each do |config |
18+ config . build_settings [ 'SWIFT_VERSION' ] = '4.1'
19+ end
20+ end
21+ end
22+ file_name = Dir . glob ( "*.xcodeproj" ) [ 0 ]
23+ app_project = Xcodeproj ::Project . open ( file_name )
24+ app_project . native_targets . each do |target |
25+ target . build_configurations . each do |config |
26+ cflags = config . build_settings [ 'OTHER_CFLAGS' ] || '$(inherited) '
27+ unless cflags . include? '-DFB_SONARKIT_ENABLED=1'
28+ puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
29+ cflags << '-DFB_SONARKIT_ENABLED=1'
30+ end
31+ config . build_settings [ 'OTHER_CFLAGS' ] = cflags
32+ end
33+ app_project . save
34+ end
35+ installer . pods_project . save
36+ end
37+
38+
439target 'HelloWorld' do
540 # Pods for HelloWorld
641 pod 'FBLazyVector' , :path => "../node_modules/react-native/Libraries/FBLazyVector"
@@ -35,11 +70,19 @@ target 'HelloWorld' do
3570 pod 'Folly' , :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
3671
3772 target 'HelloWorldTests' do
38- inherit! :search_paths
73+ inherit! :complete
3974 # Pods for testing
4075 end
4176
4277 use_native_modules!
78+
79+ # For enabling Flipper.
80+ # Note that if you use_framework!, flipper will no work.
81+ # Disable these lines if you are doing use_framework!
82+ flipper_pods ( )
83+ post_install do |installer |
84+ flipper_post_install ( installer )
85+ end
4386end
4487
4588target 'HelloWorld-tvOS' do
@@ -49,5 +92,4 @@ target 'HelloWorld-tvOS' do
4992 inherit! :search_paths
5093 # Pods for testing
5194 end
52-
5395end
0 commit comments