1
1
platform :ios , '9.0'
2
2
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3
3
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
+
4
39
target 'HelloWorld' do
5
40
# Pods for HelloWorld
6
41
pod 'FBLazyVector' , :path => "../node_modules/react-native/Libraries/FBLazyVector"
@@ -35,11 +70,19 @@ target 'HelloWorld' do
35
70
pod 'Folly' , :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
36
71
37
72
target 'HelloWorldTests' do
38
- inherit! :search_paths
73
+ inherit! :complete
39
74
# Pods for testing
40
75
end
41
76
42
77
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
43
86
end
44
87
45
88
target 'HelloWorld-tvOS' do
@@ -49,5 +92,4 @@ target 'HelloWorld-tvOS' do
49
92
inherit! :search_paths
50
93
# Pods for testing
51
94
end
52
-
53
95
end
0 commit comments